Stunt Playground camera system in vehicle demo

capture

03-06-2007 22:16:00

I am pretty much using loading the same vehicle used for the simple vehicle demo in my application, and then i have completely copied Stunt Playground's camera system into my code. My problem is my camera is not working the way it should and i think it is a problem with the settings i am giving it. Could someone tell me what is wrong with my settings? I just want the camera to follow.

my settings so far

mFollowCam->setJustFollow(true);
mFollowCam->setGoalDistance(8);
mFollowCam->setGoalNode(mCar->mMainNode);
mFollowCam->setLookNode(mCar->mSightNode); // mSightNode is a child of mainnode with a position of 0,1,0
mFollowCam->setGoalYawAngle(Ogre::Radian(90));
mFollowCam->setGoalPitchAngle(Ogre::Radian(15));
mFollowCam->setJustFollowHeight(25);

walaber

04-06-2007 01:37:54

what is the camera doing?

if i remember correctly, "goalNode" is a scene node that the camera will try to move to (the goal "position" of the camera), and "lookNode" is a node that the camera will always look at.

right now it seems that goalnode is at the center of your car, and lookNode is 1 unit higher on the Y axis.

with this config, the followCam would be inside the car, looking straight up.


try attaching a child node to your vehicle that is behind / away from the vehicle, and set that as the goalnode.

capture

04-06-2007 16:14:22

Thank you, yeah i should have noticed that because i had the a child for the goal node i just wasnt using it lol.

If any one wants to see what i used for my goal node here it is.


mGoalNode = mMainNode->createChildSceneNode(Ogre::Vector3(mMainNode->getPosition().x - 2, mMainNode->getPosition().y + 2, mMainNode->getPosition().z), Ogre::Quaternion(Ogre::Quaternion(sqrt(0.5),0,-sqrt(0.5),0)));