RFGR Extended Camera DLL/CameraWrapper.cpp
/*Currently broken and unused as previous attempts at rotation code failed.*/
Currently broken and unused as previous attempts at rotation code failed.
Currently broken and unused as previous attempts at rotation code failed .
void CameraWrapper::RecalculateOrientationMatrix()
{
	*(float*)RealRightX = cosd(Yaw) * cosd(Roll);
	*(float*)RealUpX = -1.0f * cosd(Yaw) * sind(Roll);
	*(float*)RealDirectionX = sind(Yaw);
	*(float*)RealRightY = cosd(Roll) * sind(Pitch) * sind(Yaw) + cosd(Pitch) * sind(Roll);
	*(float*)RealUpY = cosd(Pitch) * cosd(Roll) - sind(Pitch) * sind(Yaw) * sind(Roll);
	*(float*)RealDirectionY = -1.0f * cosd(Yaw) * sind(Pitch);
	*(float*)RealRightZ = 1.0f * cosd(Roll) * sind(Yaw) + sind(Pitch) * sind(Roll);
	*(float*)RealUpZ = cosd(Roll) * sind(Pitch) + 1.0f * sind(Yaw) * sind(Roll);
	*(float*)RealDirectionZ = cosd(Pitch) * cosd(Yaw);
}
void CameraWrapper :: RecalculateOrientationMatrix ( ) { * ( float * ) RealRightX = cosd ( Yaw ) * cosd ( Roll ) ; * ( float * ) RealUpX = -1.0f * cosd ( Yaw ) * sind ( Roll ) ; * ( float * ) RealDirectionX = sind ( Yaw ) ; * ( float * ) RealRightY = cosd ( Roll ) * sind ( Pitch ) * sind ( Yaw ) + cosd ( Pitch ) * sind ( Roll ) ; * ( float * ) RealUpY = cosd ( Pitch ) * cosd ( Roll ) - sind ( Pitch ) * sind ( Yaw ) * sind ( Roll ) ; * ( float * ) RealDirectionY = -1.0f * cosd ( Yaw ) * sind ( Pitch ) ; * ( float * ) RealRightZ = 1.0f * cosd ( Roll ) * sind ( Yaw ) + sind ( Pitch ) * sind ( Roll ) ; * ( float * ) RealUpZ = cosd ( Roll ) * sind ( Pitch ) + 1.0f * sind ( Yaw ) * sind ( Roll ) ; * ( float * ) RealDirectionZ = cosd ( Pitch ) * cosd ( Yaw ) ; }
Currently broken and unused as previous attempts at rotation code failed.
Currently broken and unused as previous attempts at rotation code failed .
/*
	See the second answer (xyz form) in the link below for the math used here. 
	Switched pitch and yaw since the axes are different: https://stackoverflow.com/questions/1568568/how-to-convert-euler-angles-to-directional-vector
	*/