Skip to content

Instantly share code, notes, and snippets.

@lalanikarim
Created September 11, 2012 04:33
Show Gist options
  • Save lalanikarim/3695986 to your computer and use it in GitHub Desktop.
Save lalanikarim/3695986 to your computer and use it in GitHub Desktop.
Render-Physics Loop
for(int i = 0; i < bodyCount; i++)
{
neRigidBody * body = rigidBodies[i];
ISceneNode * node = sceneNodes[body->GetUserData()];
neV3 bodyPos = body->GetPos();
vector3df nodePos = tokVectorToIrrlicht(bodyPos);
node->setPosition(nodePos);
neQ bodyRot = body->GetRotationQ();
quaternion nodeRotQ;
nodeRotQ.set(bodyRot.X,bodyRot.Y,bodyRot.Z,bodyRot.W);
vector3df nodeRotE;
nodeRotQ.toEuler(nodeRotE);
nodeRotE *= 180/PI;
node->setRotation(nodeRotE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment