sensius
13-08-2008 05:24:57
hi guys,
I want to use OgreNewt to implement camera collision detection (still use WASD to move camera). After surfing the forum, I think the process is:
1) Create a camera node.
2) Define a body and collision for the camera.
3) Define a callback function to update force to camera body.
And here is how I implement:
- I create camera body in TutorialFrameListener constructor (I use Ogre sample), yes I pass World to this listener.
- with WASD keypress and release, I update the force vector.
- callback function in TutorialFrameListener: _body->setForce(v3CamDirt);
But things don't go as I expected. callback function was not called when I pressed WASD.
What's wrong with this?
I want to use OgreNewt to implement camera collision detection (still use WASD to move camera). After surfing the forum, I think the process is:
1) Create a camera node.
2) Define a body and collision for the camera.
3) Define a callback function to update force to camera body.
And here is how I implement:
- I create camera body in TutorialFrameListener constructor (I use Ogre sample), yes I pass World to this listener.
- with WASD keypress and release, I update the force vector.
- callback function in TutorialFrameListener: _body->setForce(v3CamDirt);
But things don't go as I expected. callback function was not called when I pressed WASD.
What's wrong with this?