Hi all
I add a FPS camera and a cube scene node in my project.
In order to let the camera not go through the cube node, I tried to add a collision detection to the camera node.
When I used function setPosition() to set the position of the camera, the camera node might not be set correctly at the position.
When I debugged the project, the position parameter of the camera was right, but it was not in the correct position on the screen.
So, what's wrong?
Thanks!
Set position of the camera incorrectly
Re: Set position of the camera incorrectly
What do you mean by "not in the correct position on the screen"? Do you mean that the camera isn't where you'd expect it to be (but I doubt it, since you confirmed the position was correct)? Or do you mean the camera is not facing the direction you expect it to look at?
Have you checked Tutorial #7 on collision detection?
If you're trying to roll your own collision detection, I suggest you take a look at the code in CSceneNodeAnimatorCollisionResponse.cpp.
Have you checked Tutorial #7 on collision detection?
If you're trying to roll your own collision detection, I suggest you take a look at the code in CSceneNodeAnimatorCollisionResponse.cpp.