Camera up vector

Problems building or running the engine, queries about how to use features etc.
Post Reply
Klarre
Kobold
Posts: 31
Joined: Mon Feb 14, 2005 9:52 pm

Camera up vector

Post by Klarre »

Hi!

This question is going to be about the OgreCamera. But first a short info about my project.

We are creating a game that will take place on a very small planet. This planet is technically a sphere. So in this FPS game it is also possible to run around it. There are no ends.

To my problem:
To make this work, I have to modify both the camera and the physics. So far I have been trying to modify the camera. And here to my question:

What is the name of the OgreCamera:s up vector? I have been experimenting with the setFixedYawAxis() function. But this seems just to change the rotate axis, when I move the mouse. I did a function like this...

void Camera::yawToGround(void)
{
// Get the position of the camera
Vector3 eyePos = getPosition();
// Normalise the up vector
Vector3 up = eyePos.normalisedCopy();
// Set the up vector
setFixedYawAxis(true, up);
}

...that i invoke each time the camera updates. But what else should I do?
The planets centrum is in (0,0,0). With this function above I calculate the vector
from the planets centrum to the cameras eye. This vector I then want to be the up vector
of my camera. What is the name of the vector I should set this value to?

Thank you for helping

/Klarre
User avatar
Clay
OGRE Community Helper
OGRE Community Helper
Posts: 518
Joined: Wed Mar 17, 2004 4:14 am
x 1
Contact:

Post by Clay »

Quick suggestion, have you considered using something like the paging landscape manager, and modifying it so that tiles "loop"? It seems that you are doing a LOT of work when you could just modify that scene manager to make it repeat tiles after you are so far on it.

Just a thought.
Klarre
Kobold
Posts: 31
Joined: Mon Feb 14, 2005 9:52 pm

Post by Klarre »

Thanks for the thought.
But it is not that simple. The big idea is to make the planet so small, so you can easily see the "end" in front of you. Like just 30 meters or so. The skybox should also be fixed, so the sky changes when beeing on the other side.

/Klarre
Post Reply