Hi, I am new to these forums and new to using newton. I am integrating it into a self-made 3D engine (directX and C++) and I am currently trying to get completley situated with the engine. I have 2 questions that I did not find adressed in the FAQ section. Thanks in advance to anyone who can help.
1. When I use float values (this includes the dFloat class packaged with newton), whenever I try to perform a "Get" function such as "GetBodyMatrix" and link to the correct size array of floats (4x4), I am hit with a runtime error that says "stack around variable "outMatrix" is corrupt" (with outMatrix being the 4x4 float array I am attemtping to output to). After some reasearch, I figured out that apparently it is attemtping to output more data than that 2D array can hold. If I try with the dMatrix class, the same thing happens. Then I found out if I use an array of doubles for the matrix, it suddenly works (telling me that it is outputting 64 bit variables rather than 32) and the object behaves correctly. The only way I can get the dFloat class to work is by setting "double precision mode" by using #define. Can anyone tell me what might be going on?
2. The next question is quite a bit simpler:
I have an optimization idea that my application can use. My game world is divided into chunks and obviously the ones that cannot be seen do not need to have newtons full attention, which could waste a lot of CPU time. My idea was to have 2 main worlds for each significant area of the world. One is a high persicion version (running every frame with a time incriment of about 1/40, varying with framerate obviously), and one a low percision version only dealt with once every 10 frames or so. The furthest areas would be shut off completley. So my question is, without re-allocating objects over and over and putting my memory into a blender, is there some way to have one world "give up" a rigid body and give it to the other low precision world? My thought was somewhat along the lines of passing a pointer to the other world and removing the body from the active list of the first.
I hope both of these are clear. My vocabulary is not the best in these aspects (I'm self taught).