public static Vector3 RotateVertexAroundAxis(float Angle, Vector3 Axis, Vector3 Vertex) { //Rodrigues Rotation Formula //Efficient way of rotating a vector in space, given an axis angle of rotation. Vector3 rv = (Vertex * Mathf.Cos(Angle)) + PlayerVector.DotProduct(Vertex, Axis) * Axis * (1 - Mathf.Cos(Angle)) + EulerCalculation.VectorCrossProduct(Axis, Vertex) * Mathf.Sin(Angle); return(rv); }
public static PlayerVector ScaleVector(PlayerVector Vec1, float Scaler) { //Initialise our return value PlayerVector ReturnValue = new PlayerVector(0, 0); //Scale the vector ReturnValue.x = Vec1.x * Scaler; ReturnValue.y = Vec1.y * Scaler; return(ReturnValue); }