Пример #1
0
        /** @return the maximum magnitude of any row of the matrix. */
        public float GetMaximumAxisScale()
        {
            float MaxRowScaleSquared = FMath.Max(
                GetScaledAxis(EAxis.X).SizeSquared(),
                FMath.Max(
                    GetScaledAxis(EAxis.Y).SizeSquared(),
                    GetScaledAxis(EAxis.Z).SizeSquared()
                    )
                );

            return((float)FMath.Sqrt(MaxRowScaleSquared));
        }
Пример #2
0
        /**
         * Get the axis of rotation of the Quaternion.
         * This is the axis around which rotation occurs to transform the canonical coordinate system to the target orientation.
         * For the identity Quaternion which has no such rotation, FVector(1,0,0) is returned.
         */
        public FVector GetRotationAxis()
        {
            // Ensure we never try to sqrt a neg number
            float S = (float)(FMath.Sqrt(FMath.Max(1.0f - (W * W), 0.0f)));

            if (S >= 0.0001f)
            {
                return(new FVector(X / S, Y / S, Z / S));
            }

            return(new FVector(1.0f, 0.0f, 0.0f));
        }
Пример #3
0
 /**
  * Get the maximum absolute value of the vector's components.
  *
  * @return The maximum absolute value of the vector's components.
  */
 public float GetAbsMax()
 {
     return(FMath.Max(FMath.Max(FMath.Abs(X), FMath.Abs(Y)), FMath.Abs(Z)));
 }
Пример #4
0
 /** Gets the component-wise max of two vectors. */
 public FVector ComponentMax(FVector Other)
 {
     return(new FVector(FMath.Max(X, Other.X), FMath.Max(Y, Other.Y), FMath.Max(Z, Other.Z)));
 }
Пример #5
0
 /**
  * Get the maximum value of the vector's components.
  *
  * @return The maximum value of the vector's components.
  */
 public float GetMax()
 {
     return(FMath.Max(FMath.Max(X, Y), Z));
 }