Skip to main content
gamedev.net
🔒 Locked

Ageia PhysX problem

Started by JohnnyCode 6 replies 2.2k views
Original Post
JohnnyCode
JohnnyCode
hello, I have this problem with NxActor::setGlobalPose() function , when I call it with an ok parameter, and then call NxActor::getGlobalPose() function to check the matrix I get a different matrix. So when does NxActor::setGlobalPose() take effect? How do I set NxActor's matricies?
elurahu
elurahu
PhysX uses a double buffered shape state. You will need to perform a simulationstep before your values will be valid. This is also mentioned in the documentation.
JohnnyCode
JohnnyCode
I call the simulation between setGlobalPose and getGlobalPose function, like this

actor->setGlobalPose(modelMat);
m_gScene->fetchResults(NX_RIGID_BODY_FINISHED,block);
m_fDeltaTime = UpdateTime();
m_gScene->simulate(m_fDeltaTime*2.0f);
m_gScene->flushStream();
phWorldTrans=actor->getGlobalPose(); // here I get wrong matrix

elurahu
elurahu
Taken directly from the docs

"Note:
Because the SDK double buffers shape state, a shape will not be updated until a simulation step is taken. For example the result of setting the global pose is not immediatly visible."

You are not getting the results from the simulation.
JohnnyCode
JohnnyCode
But I call NxScene::fetchResults(), how do I get the results then?
JohnnyCode
JohnnyCode
If I call NxScene::fetchResults() after flushStream once again I simply get a different matrix then the one I've set with setGlobalPose() and that is quite understandable becouse the simulation took a time step. So my question is How do I influence actor's world matrix?
JohnnyCode
JohnnyCode
please help me someone. When I call setGlobalPose the simulation starts at an identity matrix not the matrix I have set with setGlobalPose

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.