All pastes #504373 Raw Edit

Miscellany

public cpp v1 · immutable
·published 2007-05-23 03:25 UTC
rendered paste body
	//Get the Forwards vector, we will use this for our quat	irr::core::vector3df Forwards = (Camera->getTarget() - Camera->getPosition()).normalize();	//Create a quat, facing in the same direction as our camera	//with a 45 degree rotation	irr::core::quaternion TiltRotation;	TiltRotation.fromAngleAxis( 45, Forwards );		//Now we need to get that rotation in Euler so we can use it	irr::core::vector3df EulerRot;	TiltRotation.toEuler( EulerRot );	//Its stored in radians, convert to a degrees	EulerRot = EulerRot * 57.2957795f;	//Set our tilt matrix to that rotation	TiltMatrix.setRotationDegrees( EulerRot );	//The Upvector tilted	TiltMatrix.transformVect( UpVector );	//Set the upvector for the camera	Camera->setUpVector( UpVector);