Hello,
I have a problem. For an older project I've been using the Tumle physics wrapper. Recently I've recompiled the project using the SVN version of Irrlicht, and now the Tumle physics FPS camera doesn't work correctly anymore. I can translate the camera, but rotation doesn't work. Were there any large changes made to the Irrlicht FPS camera node between 1.4 and SVN revision 1471 relating to rotation? I'd rather keep using Tumle for this application, but if not I've been thinking about switching to IrrNewt. When compiling IrrNewt from SVN, the dll is created normally, but when creating the lib, it weights almost 18 MB. Is this normal, or am I doing something wrong with the compiler (VC) settings?
Thanks in advance.
Irrlicht and Tumle camera rotation problem
Ok, thank you. I've also been experimenting with irrNewt and managed to compile it using the Irrlicht SVN version. For anyone else interested in this: use the irrNewt svn version source files and includes copied over the normal (0.4) version, and the project should compile after a small modification to the round function - fix here.
A little update:
I managed to get the camera to rotate, by calling OnEvent for the camera node which in turn sends the event to the ISceneNodeAnimatorCameraFPS of the camera. So now the camera can move and rotate.
A problem persists though: translation is not made along the camera direction, but rather for the initial direction (I think). Looking through the tumle code in the newton callback (newtonForceAndTorqueCallback):
Is the getRelativeTransformation line correct, or does camera rotation now work differently with animators?
Another thing I found in the engine source is the animateNode function. Maybe calling this before the physics update fuction will solve the problem, but i don't know exacly how to access it.
This:
doesn't work.
I managed to get the camera to rotate, by calling OnEvent for the camera node which in turn sends the event to the ISceneNodeAnimatorCameraFPS of the camera. So now the camera can move and rotate.
A problem persists though: translation is not made along the camera direction, but rather for the initial direction (I think). Looking through the tumle code in the newton callback (newtonForceAndTorqueCallback):
Code: Select all
//get the current velocity
f32 cv[3];
NewtonBodyGetVelocity(cPNode->getNewtonBody(), cv);
//rotate the desired velocity relative to the node
core::vector3df dv = cPNode->getDesiredVelocity();
cPNode->getIrrlichtNode()->getRelativeTransformation().rotateVect(dv);
//calculate the force needed to move the node
core::vector3df newForce = ( dv - core::vector3df(cv[0],0,cv[2]) ) * cPNode->getMass();
Another thing I found in the engine source is the animateNode function. Maybe calling this before the physics update fuction will solve the problem, but i don't know exacly how to access it.
This:
Code: Select all
ISceneNode *node = physicsCam->getIrrlichtNode();
node->getAnimators().begin()->animateNode(node,device->getTimer()->getTime());