CameraYaw (instead of cameraRoll) ?
by F.W. Hardijzer · in Torque Game Engine · 10/05/2005 (1:49 pm) · 0 replies
Hi,
I'm trying to make a game in which cars will be making loopings.
To prevent the camdera from going all spaztic, I need an extra variable like cameraRoll, that'd prevent the camera from rotating when the car makes a looping.
I've already implemented the variable in the datablock, and I think I know what to edit,
but I'm completely lost at 3D Math, and I was hoping someone could help...
I think the first if is just a total camera control, obviously that should only be executed if both cameraRoll AND cameraYaw are set to true.
However, the rest is all magic...
Could anyone clear it up for me?
Thank you,
TB
I'm trying to make a game in which cars will be making loopings.
To prevent the camdera from going all spaztic, I need an extra variable like cameraRoll, that'd prevent the camera from rotating when the car makes a looping.
I've already implemented the variable in the datablock, and I think I know what to edit,
but I'm completely lost at 3D Math, and I was hoping someone could help...
if (mDataBlock->cameraRoll)
mat->mul(eye,rot);
else {
MatrixF cam(1);
VectorF x,y,z(0,0,1);
eye.getColumn(1, &y);
mCross(y, z, &x);
x.normalize();
mCross(x, y, &z);
z.normalize();
cam.setColumn(0,x);
cam.setColumn(1,y);
cam.setColumn(2,z);
mat->mul(cam,rot);
}(vehicle.cc line 756 for me)I think the first if is just a total camera control, obviously that should only be executed if both cameraRoll AND cameraYaw are set to true.
However, the rest is all magic...
Could anyone clear it up for me?
Thank you,
TB
About the author