Camera collision

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?

micken

16-08-2008 22:33:15

The callback function gets called every frame that the body is moving.
Here are a couple of things to try:

- Make sure you are updating your world - nothing can move if the world is not being updated.
- camerabody->setAutoFreeze(false); - Your camera body could be getting autofrozen.