I finally figured out what was happening with my tokamak simulation. As a result I think I found two things that should really change in Irrlicht base classes.
First, both the onprerender and onpostrender calls are made inside the drawAll method of scenemanager. This causes a problem when you have something like physics that wants to change the position and rotations of things before they are rendered. The only way to do this seems to be by making an animator (animators also get called inside the drawAll loop) - really, the pre and post render calls should be separately callable as part of scenemanager so things other than animators can modify things
Second, i want to make the transform matrix of the scenenode match the one inside tokamak - but if i call getAbsoluteTransform it gets reset during the onpostrender call - so in my case i only want to update the physics based on a clock, not on every call (otherwise the sim is too slow) - but if i do this my objects flash between their original positions and the physics positions - how can i match the matrices? - it seems i need some way to set the transform matrix of the object directly rather than using setPosition and setRotation
Problem with drawAll
Hi powerpop
I think your tokamak problem can be resolved if your writing a dummy scenenode which overwrites the getRelativeTransformation() method of irr::scene::ISceneNode. then you'll use this new scenenode to update the matrix and set the original node (md2, md3 etc.) with the default settings as a child of the new one.
I think your tokamak problem can be resolved if your writing a dummy scenenode which overwrites the getRelativeTransformation() method of irr::scene::ISceneNode. then you'll use this new scenenode to update the matrix and set the original node (md2, md3 etc.) with the default settings as a child of the new one.
yes, that would work and is useful sometimes BUT for the tokamak integration i do not want to place dummy objects in the scenenode tree - i want all the objects to be separate and managed by a physicsmanager object i created - so i will need do some calculations on the tokamak bodies and send pos, rot info into the effected scenenodes - but in the long term it would be better to have drawBegin and drawEnd calls in scenemanager so that more objects than just animators get access in between render calls
i have been getting some good advice over on the tokamak forums - things that will smooth out the physics sim and make integration easier - i am close to posting a set of objects for you all to use ... give me a day or so!
i have been getting some good advice over on the tokamak forums - things that will smooth out the physics sim and make integration easier - i am close to posting a set of objects for you all to use ... give me a day or so!