public static CreateFromAxisAngle ( BEPUutilities.Vector3 axis, float angle ) : |
||
axis | BEPUutilities.Vector3 | Axis of rotation. |
angle | float | Angle to rotate around the axis. |
return |
public static Quaternion CreateFromAxisAngle(Vector3 axis, float angle)
{
float halfAngle = angle * .5f;
float s = (float)Math.Sin(halfAngle);
Quaternion q;
q.X = axis.X * s;
q.Y = axis.Y * s;
q.Z = axis.Z * s;
q.W = (float)Math.Cos(halfAngle);
return q;
}
Quaternion::CreateFromAxisAngle ( BEPUutilities.Vector3 &axis, float angle, &q ) : void |