Tuesday, July 13, 2010

Week Three / Day Two

Today was fairly uneventful, and I'm a bit rattled from dealing with pointer issues all afternoon. I have a structure called vertex which contains a vector for position and a vector for color. I use it to define vertices within the gamespace. To do so I needed a place to keep track of collection of dynamically allocated vertices, a vector of vertices, or rather vector. But if I'm dynamically allocating, I need to keep these somewhere as well. A vector suffices, and I want to be able to pass these around amongst vectors, so that leaves me with a vector<>* >. Now, as I said before a Vertex contains a vector of position and a vector of color, each with x,y, and z values. Now, for me to actually use these values I pass a reference to the space in memory where the first x value occurs; this isn't too bad, except that to reference that point requires the following line:
&(*(*void)[0])[0]).Position.x)
Or something similar, I think I have the index wrong. It's a mouthful, and referencing and dereferencing that many layers of points gets a little messy. I ended up replacing the inner vector with an object structure, but my memory reference errors remain. To make things worse, it runs fine on the simulator and seg faults on the device. Fantastic.

Earlier today I did get some camera issues worked out, as well as some control smoothing. There is still jitter that occurs around the first 30 seconds of execution as well as randomly throughout the use of the app, but I'm pretty sure I've isolated it as an issue with accelerometer data which shouldn't be too large of an issue. Other than that I just worked on the tornado model design a bit more but haven't coded anything in yet. I posted a thread on idevgames about my issue, so hopefully someone gives me some pointers. Ha, computer joke.

No comments:

Post a Comment