Esempio n. 1
0
// TODO: Optimize this (super easy)
Matrix Matrix::CreateRotation(Vector3 rotation)
{
	Matrix x = CreateRotationX(rotation.x);
	Matrix y = CreateRotationY(rotation.y);
	Matrix z = CreateRotationZ(rotation.z);

	return z * x * y;
}
Esempio n. 2
0
Matrix Matrix::CreateRotationX(float radians)
{
    Matrix m;

    CreateRotationX(m,radians);
    
    return m;
    
}
Esempio n. 3
0
/* Rotate matrix around X axis.
 * ARGUMENTS:
 * - rotation angle in degrees
 *     float angle;
 * RETURNS: 
 * - rotated matrix around axis X
 *     Matrix &;
 */
Matrix &Matrix::RotateX( float angle )
{
  Matrix temp = CreateRotationX(angle);

  temp *= *this;
  *this = temp;

  return *this;
} /* End of 'RotateX' function */
Esempio n. 4
0
Matrix Matrix::CreateRotation(float x, float y, float z)
{
    auto m = CreateRotationX(x) * CreateRotationY(y) * CreateRotationZ(z);
    
    return m;
}
Esempio n. 5
0
Matrix4x4 Matrix4x4::CreateRotation( const float pitch, const float yaw, const float roll, bool radians )
{
    return CreateRotationX( pitch, radians ) *
           CreateRotationY( yaw, radians ) *
           CreateRotationZ( roll, radians );
}