Created
September 11, 2012 04:33
-
-
Save lalanikarim/3695986 to your computer and use it in GitHub Desktop.
Render-Physics Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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