Пример #1
0
        /// <summary>
        /// Rotate the vertices with the defined value in radians.
        /// </summary>
        /// <param name="value">The amount to rotate by in radians.</param>
        public void Rotate(float value)
        {
            FMatrix rotationMatrix;

            FMatrix.CreateRotationZ(value, out rotationMatrix);

            for (int i = 0; i < Count; i++)
            {
                this[i] = FVector2.Transform(this[i], rotationMatrix);
            }
        }
Пример #2
0
        public void Transform(FMatrix transform)
        {
            // Transform main polygon
            for (int i = 0; i < this.Count; i++)
            {
                this[i] = FVector2.Transform(this[i], transform);
            }

            // Transform holes
            FVector2[] temp = null;
            if (_holes != null && _holes.Count > 0)
            {
                for (int i = 0; i < _holes.Count; i++)
                {
                    temp = _holes[i].ToArray();
                    FVector2.Transform(temp, ref transform, temp);

                    _holes[i] = new Vertices(temp);
                }
            }
        }
Пример #3
0
 public static void TransformNormal(ref FVector3 normal, ref FMatrix matrix, out FVector3 result)
 {
     result = new FVector3((normal.X * matrix.M11) + (normal.Y * matrix.M21) + (normal.Z * matrix.M31),
                           (normal.X * matrix.M12) + (normal.Y * matrix.M22) + (normal.Z * matrix.M32),
                           (normal.X * matrix.M13) + (normal.Y * matrix.M23) + (normal.Z * matrix.M33));
 }
Пример #4
0
 public static FVector3 TransformNormal(FVector3 normal, FMatrix matrix)
 {
     TransformNormal(ref normal, ref matrix, out normal);
     return(normal);
 }
Пример #5
0
 public static void TransformNormal(FVector3[] sourceArray, int sourceIndex, ref FMatrix matrix,
                                    FVector3[] destinationArray, int destinationIndex, int length)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public static void TransformNormal(FVector3[] sourceArray, ref FMatrix matrix, FVector3[] destinationArray)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public static FVector3 Transform(FVector3 position, FMatrix matrix)
 {
     Transform(ref position, ref matrix, out position);
     return(position);
 }
Пример #8
0
 public static void TransformNormal(ref FVector2 normal, ref FMatrix matrix, out FVector2 result)
 {
     result = new FVector2((normal.X * matrix.M11) + (normal.Y * matrix.M21),
                           (normal.X * matrix.M12) + (normal.Y * matrix.M22));
 }
Пример #9
0
 public static void Transform(ref FVector2 position, ref FMatrix matrix, out FVector2 result)
 {
     result = new FVector2((position.X * matrix.M11) + (position.Y * matrix.M21) + matrix.M41,
                           (position.X * matrix.M12) + (position.Y * matrix.M22) + matrix.M42);
 }