Set position of the camera incorrectly

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jsyzljj
Posts: 2
Joined: Mon Dec 12, 2016 1:23 am

Set position of the camera incorrectly

Post by jsyzljj »

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!
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Set position of the camera incorrectly

Post by MartinVee »

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.
Post Reply