How to get current position of an actor

Night Elf

06-09-2007 16:55:19

I need to synchronise some special effects (for example, explosions or the effect of a gun shooting) with the physics simulation. The problem is that these non-physical objects seem to be one frame behind the rest. For example, if a character's shooting and moving sideways, the effect on the weapon appears in its previous position.

I think the problem is that I get the current position/orientation of the actor before it is transformed by the simulation. How can I make sure to get the actual transformation so that everything is synchronised?

betajaen

06-09-2007 17:26:59

In NxOgre 0.9'35, by default there is a preprocessor flag called "NX_RENDER_IN_FRAMESTARTED" set to true. So all of the rending (and simulation) is done before the frame is rendered.

So theoretically assuming your frameListener is ran after NxOgre's, they should be in sync.

Solution: Upgrade to '35.

Night Elf

06-09-2007 20:01:17

So theoretically assuming your frameListener is ran after NxOgre's, they should be in sync.

Ok, but how can I make sure my frame listener is run after NxOgre's?

betajaen

06-09-2007 20:10:04

I believe you tell Ogre about it after World is created or if you wanted to, you could use your own frameListener to simulate/render with NxOgre' framelistener off.