Microsoft.Xna.Framework
Class Vector2

java.lang.Object
  extended by System.ValueType
      extended by Microsoft.Xna.Framework.Vector2

public final class Vector2
extends ValueType

Defines a vector with two components.

Author:
Halofreak1990

Field Summary
static Vector2 One
          Returns a Vector2 with both of its components set to one.
static Vector2 UnitX
          Returns the unit vector for the x-axis.
static Vector2 UnitY
          Returns the unit vector for the y-axis.
 float X
          Gets or sets the x-component of the vector.
 float Y
          Gets or sets the y-component of the vector.
static Vector2 Zero
          Returns a Vector2 with all of its components set to zero.
 
Constructor Summary
Vector2()
          Initializes a new instance of Vector2.
Vector2(float value)
          Initializes a new instance of Vector2.
Vector2(float x, float y)
          Initializes a new instance of Vector2.
 
Method Summary
 void Add(Vector2 other)
          Adds the specified Vector2 to the current Vector2.
static Vector2 Add(Vector2 value1, Vector2 value2)
          Adds two vectors.
static void Add(Vector2 value1, Vector2 value2, Vector2 result)
          Adds two vectors.
static Vector2 Barycentric(Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2)
          Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
static void Barycentric(Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2, Vector2 result)
          Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
static Vector2 CatmullRom(Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount)
          Performs a Catmull-Rom interpolation using the specified positions.
static void CatmullRom(Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount, Vector2 result)
          Performs a Catmull-Rom interpolation using the specified positions.
static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)
          Restricts a value to be within a specified range.
static void Clamp(Vector2 value1, Vector2 min, Vector2 max, Vector2 result)
          Restricts a value to be within a specified range.
static float Distance(Vector2 value1, Vector2 value2)
          Calculates the distance between two vectors.
static void Distance(Vector2 value1, Vector2 value2, float result)
          Calculates the distance between two vectors.
static float DistanceSquared(Vector2 value1, Vector2 value2)
          Calculates the distance between two vectors squared.
static void DistanceSquared(Vector2 value1, Vector2 value2, float result)
          Calculates the distance between two vectors squared.
 void Divide(float divider)
          Divides the current vector by a scalar value.
 void Divide(Vector2 other)
          Divides the components of the current vector by the components of another vector.
static Vector2 Divide(Vector2 value1, float divider)
          Divides a vector by a scalar value.
static void Divide(Vector2 value1, float divider, Vector2 result)
          Divides a vector by a scalar value.
static Vector2 Divide(Vector2 value1, Vector2 value2)
          Divides the components of a vector by the components of another vector.
static void Divide(Vector2 value1, Vector2 value2, Vector2 result)
          Divides the components of a vector by the components of another vector.
static float Dot(Vector2 value1, Vector2 value2)
          Calculates the dot product of two vectors.
static void Dot(Vector2 value1, Vector2 value2, float result)
          Calculates the dot product of two vectors and writes the result to a user-specified variable.
 boolean equals(java.lang.Object obj)
          Returns a value that indicates whether the current instance is equal to a specified object.
 boolean Equals(Vector2 other)
          Determines whether the specified Object is equal to the Vector2.
 int hashCode()
          Gets the hash code of the vector object.
static Vector2 Hermite(Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount)
          Performs a Hermite spline interpolation.
static void Hermite(Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount, Vector2 result)
          Performs a Hermite spline interpolation.
 float Length()
          Calculates the length of the vector.
 float LengthSquared()
          Calculates the length of the vector squared.
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
          Performs a linear interpolation between two vectors.
static void Lerp(Vector2 value1, Vector2 value2, float amount, Vector2 result)
          Performs a linear interpolation between two vectors.
static Vector2 Max(Vector2 value1, Vector2 value2)
          Returns a vector that contains the highest value from each matching pair of components.
static void Max(Vector2 value1, Vector2 value2, Vector2 result)
          Returns a vector that contains the highest value from each matching pair of components.
static Vector2 Min(Vector2 value1, Vector2 value2)
          Returns a vector that contains the lowest value from each matching pair of components.
static void Min(Vector2 value1, Vector2 value2, Vector2 result)
          Returns a vector that contains the lowest value from each matching pair of components.
 void Multiply(float scaleFactor)
          Multiplies the current vector by a scalar value.
 void Multiply(Vector2 other)
          Multiplies the components of the current vector by the components of another vector.
static Vector2 Multiply(Vector2 value1, float scaleFactor)
          Multiplies a vector by a scalar value.
static void Multiply(Vector2 value1, float scaleFactor, Vector2 result)
          Multiplies a vector by a scalar value.
static Vector2 Multiply(Vector2 value1, Vector2 value2)
          Multiplies the components of two vectors by each other.
static void Multiply(Vector2 value1, Vector2 value2, Vector2 result)
          Multiplies the components of two vectors by each other.
 void Negate()
          Returns the current vector pointing in the opposite direction.
static Vector2 Negate(Vector2 value)
          Returns a vector pointing in the opposite direction.
static void Negate(Vector2 value, Vector2 result)
          Returns a vector pointing in the opposite direction.
 void Normalize()
          Turns the current vector into a unit vector.
static Vector2 Normalize(Vector2 value)
          Creates a unit vector from the specified vector.
static void Normalize(Vector2 value, Vector2 result)
          Creates a unit vector from the specified vector, writing the result to a user-specified variable.
static Vector2 Reflect(Vector2 vector, Vector2 normal)
          Determines the reflect vector of the given vector and normal.
static void Reflect(Vector2 vector, Vector2 normal, Vector2 result)
          Determines the reflect vector of the given vector and normal.
static Vector2 SmoothStep(Vector2 value1, Vector2 value2, float amount)
          Interpolates between two values using a cubic equation.
static void SmoothStep(Vector2 value1, Vector2 value2, float amount, Vector2 result)
          Interpolates between two values using a cubic equation.
 void Subtract(Vector2 other)
          Subtracts a vector from the current vector.
static Vector2 Subtract(Vector2 value1, Vector2 value2)
          Subtracts a vector from a vector.
static void Subtract(Vector2 value1, Vector2 value2, Vector2 result)
          Subtracts a vector from a vector.
 java.lang.String toString()
          Retrieves a string representation of the current object.
static void Transform(Vector2[] sourceArray, int sourceIndex, Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length)
          Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array.
static void Transform(Vector2[] sourceArray, int sourceIndex, Quaternion rotation, Vector2[] destinationArray, int destinationIndex, int length)
          Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array.
static void Transform(Vector2[] sourceArray, Matrix matrix, Vector2[] destinationArray)
          Transforms an array of Vector2s by a specified Matrix.
static void Transform(Vector2[] sourceArray, Quaternion rotation, Vector2[] destinationArray)
          Transforms an array of Vector2s by a specified Quaternion.
static Vector2 Transform(Vector2 position, Matrix matrix)
          Transforms the vector (x, y, 0, 1) by the specified matrix.
static void Transform(Vector2 position, Matrix matrix, Vector2 result)
          Transforms the vector (x, y, 0, 1) by the specified matrix.
static Vector2 Transform(Vector2 value, Quaternion rotation)
          Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
static void Transform(Vector2 value, Quaternion rotation, Vector2 result)
          Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
static void TransformNormal(Vector2[] sourceArray, int sourceIndex, Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length)
          Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array.
static void TransformNormal(Vector2[] sourceArray, Matrix matrix, Vector2[] destinationArray)
          Transforms an array of Vector2 vector normals by a specified Matrix.
static Vector2 TransformNormal(Vector2 normal, Matrix matrix)
          Transforms a 2D vector normal by a matrix.
static void TransformNormal(Vector2 normal, Matrix matrix, Vector2 result)
          Transforms a vector normal by a matrix.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

One

public static final Vector2 One
Returns a Vector2 with both of its components set to one.


UnitX

public static final Vector2 UnitX
Returns the unit vector for the x-axis.


UnitY

public static final Vector2 UnitY
Returns the unit vector for the y-axis.


X

public float X
Gets or sets the x-component of the vector.


Y

public float Y
Gets or sets the y-component of the vector.


Zero

public static final Vector2 Zero
Returns a Vector2 with all of its components set to zero.

Constructor Detail

Vector2

public Vector2(float x,
               float y)
Initializes a new instance of Vector2.

Parameters:
x - Initial value for the x-component of the vector.
y - Initial value for the y-component of the vector.

Vector2

public Vector2(float value)
Initializes a new instance of Vector2.

Parameters:
value - Value to initialize both components to.

Vector2

public Vector2()
Initializes a new instance of Vector2.

Method Detail

Add

public void Add(Vector2 other)
Adds the specified Vector2 to the current Vector2.

Parameters:
other - Source vector.

Add

public static Vector2 Add(Vector2 value1,
                          Vector2 value2)
Adds two vectors.

Parameters:
value1 - Source vector.
value2 - Source vector.

Add

public static void Add(Vector2 value1,
                       Vector2 value2,
                       Vector2 result)
Adds two vectors.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] Sum of the source vectors.

Barycentric

public static Vector2 Barycentric(Vector2 value1,
                                  Vector2 value2,
                                  Vector2 value3,
                                  float amount1,
                                  float amount2)
Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Parameters:
value1 - A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2 - A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3 - A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1 - Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2 - Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Barycentric

public static void Barycentric(Vector2 value1,
                               Vector2 value2,
                               Vector2 value3,
                               float amount1,
                               float amount2,
                               Vector2 result)
Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Parameters:
value1 - A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2 - A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3 - A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1 - Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2 - Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result - [OutAttribute] The 2D Cartesian coordinates of the specified point are placed in this Vector2 on exit.

CatmullRom

public static Vector2 CatmullRom(Vector2 value1,
                                 Vector2 value2,
                                 Vector2 value3,
                                 Vector2 value4,
                                 float amount)
Performs a Catmull-Rom interpolation using the specified positions.

Parameters:
value1 - The first position in the interpolation.
value2 - The second position in the interpolation.
value3 - The third position in the interpolation.
value4 - The fourth position in the interpolation.
amount - Weighting factor.

CatmullRom

public static void CatmullRom(Vector2 value1,
                              Vector2 value2,
                              Vector2 value3,
                              Vector2 value4,
                              float amount,
                              Vector2 result)
Performs a Catmull-Rom interpolation using the specified positions.

Parameters:
value1 - The first position in the interpolation.
value2 - The second position in the interpolation.
value3 - The third position in the interpolation.
value4 - The fourth position in the interpolation.
amount - Weighting factor.
result - [OutAttribute] A vector that is the result of the Catmull-Rom interpolation.

Clamp

public static Vector2 Clamp(Vector2 value1,
                            Vector2 min,
                            Vector2 max)
Restricts a value to be within a specified range.

Parameters:
value1 - The value to clamp.
min - The minimum value.
max - The maximum value.

Clamp

public static void Clamp(Vector2 value1,
                         Vector2 min,
                         Vector2 max,
                         Vector2 result)
Restricts a value to be within a specified range.

Parameters:
value1 - The value to clamp.
min - The minimum value.
max - The maximum value.
result - [OutAttribute] The clamped value.

Distance

public static float Distance(Vector2 value1,
                             Vector2 value2)
Calculates the distance between two vectors.

Parameters:
value1 - Source vector.
value2 - Source vector.

Distance

public static void Distance(Vector2 value1,
                            Vector2 value2,
                            float result)
Calculates the distance between two vectors.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] The distance between the vectors.

DistanceSquared

public static float DistanceSquared(Vector2 value1,
                                    Vector2 value2)
Calculates the distance between two vectors squared.

Parameters:
value1 - Source vector.
value2 - Source vector.

DistanceSquared

public static void DistanceSquared(Vector2 value1,
                                   Vector2 value2,
                                   float result)
Calculates the distance between two vectors squared.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] The distance between the vectors squared.

Divide

public void Divide(Vector2 other)
Divides the components of the current vector by the components of another vector.

Parameters:
other - Divisor vector.

Divide

public static Vector2 Divide(Vector2 value1,
                             Vector2 value2)
Divides the components of a vector by the components of another vector.

Parameters:
value1 - Source vector.
value2 - Divisor vector.

Divide

public void Divide(float divider)
Divides the current vector by a scalar value.

Parameters:
divider - The divisor.

Divide

public static Vector2 Divide(Vector2 value1,
                             float divider)
Divides a vector by a scalar value.

Parameters:
value1 - Source vector.
divider - The divisor.

Divide

public static void Divide(Vector2 value1,
                          Vector2 value2,
                          Vector2 result)
Divides the components of a vector by the components of another vector.

Parameters:
value1 - Source vector.
value2 - The divisor.
result - [OutAttribute] The result of the division.

Divide

public static void Divide(Vector2 value1,
                          float divider,
                          Vector2 result)
Divides a vector by a scalar value.

Parameters:
value1 - Source vector.
divider - The divisor.
result - [OutAttribute] The result of the division.

Dot

public static float Dot(Vector2 value1,
                        Vector2 value2)
Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Parameters:
value1 - Source vector.
value2 - Source vector.

Dot

public static void Dot(Vector2 value1,
                       Vector2 value2,
                       float result)
Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] The dot product of the two vectors.

equals

public boolean equals(java.lang.Object obj)
Returns a value that indicates whether the current instance is equal to a specified object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object to make the comparison with.
Returns:
true if the current instance is equal to the specified object; false otherwise.

Equals

public boolean Equals(Vector2 other)
Determines whether the specified Object is equal to the Vector2.

Parameters:
other - The Object to compare with the current Vector2.

hashCode

public int hashCode()
Gets the hash code of the vector object.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code of the vector object.

Hermite

public static Vector2 Hermite(Vector2 value1,
                              Vector2 tangent1,
                              Vector2 value2,
                              Vector2 tangent2,
                              float amount)
Performs a Hermite spline interpolation.

Parameters:
value1 - Source position vector.
tangent1 - Source tangent vector.
value2 - Source position vector.
tangent2 - Source tangent vector.
amount - Weighting factor.

Hermite

public static void Hermite(Vector2 value1,
                           Vector2 tangent1,
                           Vector2 value2,
                           Vector2 tangent2,
                           float amount,
                           Vector2 result)
Performs a Hermite spline interpolation.

Parameters:
value1 - Source position vector.
tangent1 - Source tangent vector.
value2 - Source position vector.
tangent2 - Source tangent vector.
amount - Weighting factor.
result - [OutAttribute] The result of the Hermite spline interpolation.

Length

public float Length()
Calculates the length of the vector.


LengthSquared

public float LengthSquared()
Calculates the length of the vector squared.


Lerp

public static Vector2 Lerp(Vector2 value1,
                           Vector2 value2,
                           float amount)
Performs a linear interpolation between two vectors.

Parameters:
value1 - Source vector.
value2 - Source vector.
amount - Value between 0 and 1 indicating the weight of value2.

Lerp

public static void Lerp(Vector2 value1,
                        Vector2 value2,
                        float amount,
                        Vector2 result)
Performs a linear interpolation between two vectors.

Parameters:
value1 - Source vector.
value2 - Source vector.
amount - Value between 0 and 1 indicating the weight of value2.
result - [OutAttribute] The result of the interpolation.

Max

public static Vector2 Max(Vector2 value1,
                          Vector2 value2)
Returns a vector that contains the highest value from each matching pair of components.

Parameters:
value1 - Source vector.
value2 - Source vector.

Max

public static void Max(Vector2 value1,
                       Vector2 value2,
                       Vector2 result)
Returns a vector that contains the highest value from each matching pair of components.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] The maximized vector.

Min

public static Vector2 Min(Vector2 value1,
                          Vector2 value2)
Returns a vector that contains the lowest value from each matching pair of components.

Parameters:
value1 - Source vector.
value2 - Source vector.

Min

public static void Min(Vector2 value1,
                       Vector2 value2,
                       Vector2 result)
Returns a vector that contains the lowest value from each matching pair of components.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] The minimized vector.

Multiply

public void Multiply(Vector2 other)
Multiplies the components of the current vector by the components of another vector.

Parameters:
other - Source vector.

Multiply

public void Multiply(float scaleFactor)
Multiplies the current vector by a scalar value.

Parameters:
scaleFactor - Scalar value.

Multiply

public static Vector2 Multiply(Vector2 value1,
                               Vector2 value2)
Multiplies the components of two vectors by each other.

Parameters:
value1 - Source vector.
value2 - Source vector.

Multiply

public static Vector2 Multiply(Vector2 value1,
                               float scaleFactor)
Multiplies a vector by a scalar value.

Parameters:
value1 - Source vector.
scaleFactor - Scalar value.

Multiply

public static void Multiply(Vector2 value1,
                            Vector2 value2,
                            Vector2 result)
Multiplies the components of two vectors by each other.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] The result of the multiplication.

Multiply

public static void Multiply(Vector2 value1,
                            float scaleFactor,
                            Vector2 result)
Multiplies a vector by a scalar value.

Parameters:
value1 - Source vector.
scaleFactor - Scalar value.
result - [OutAttribute] The result of the multiplication.

Negate

public void Negate()
Returns the current vector pointing in the opposite direction.


Negate

public static Vector2 Negate(Vector2 value)
Returns a vector pointing in the opposite direction.

Parameters:
value - Source vector.

Negate

public static void Negate(Vector2 value,
                          Vector2 result)
Returns a vector pointing in the opposite direction.

Parameters:
value - Source vector.
result - [OutAttribute] Vector pointing in the opposite direction.

Normalize

public void Normalize()
Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.


Normalize

public static Vector2 Normalize(Vector2 value)
Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Parameters:
value - Source Vector2.

Normalize

public static void Normalize(Vector2 value,
                             Vector2 result)
Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.

Parameters:
value - Source vector.
result - [OutAttribute] Normalized vector.

Reflect

public static Vector2 Reflect(Vector2 vector,
                              Vector2 normal)
Determines the reflect vector of the given vector and normal.

Parameters:
vector - Source vector.
normal - Normal of vector.

Reflect

public static void Reflect(Vector2 vector,
                           Vector2 normal,
                           Vector2 result)
Determines the reflect vector of the given vector and normal.

Parameters:
vector - Source vector.
normal - Normal of vector.
result - [OutAttribute] The created reflect vector.

SmoothStep

public static Vector2 SmoothStep(Vector2 value1,
                                 Vector2 value2,
                                 float amount)
Interpolates between two values using a cubic equation.

Parameters:
value1 - Source value.
value2 - Source value.
amount - Weighting value.

SmoothStep

public static void SmoothStep(Vector2 value1,
                              Vector2 value2,
                              float amount,
                              Vector2 result)
Interpolates between two values using a cubic equation.

Parameters:
value1 - Source value.
value2 - Source value.
amount - Weighting value.
result - [OutAttribute] The interpolated value.

Subtract

public void Subtract(Vector2 other)
Subtracts a vector from the current vector.

Parameters:
other - Source vector.

Subtract

public static Vector2 Subtract(Vector2 value1,
                               Vector2 value2)
Subtracts a vector from a vector.

Parameters:
value1 - Source vector.
value2 - Source vector.

Subtract

public static void Subtract(Vector2 value1,
                            Vector2 value2,
                            Vector2 result)
Subtracts a vector from a vector.

Parameters:
value1 - Source vector.
value2 - Source vector.
result - [OutAttribute] The result of the subtraction.

toString

public java.lang.String toString()
Retrieves a string representation of the current object.

Overrides:
toString in class java.lang.Object

Transform

public static Vector2 Transform(Vector2 position,
                                Matrix matrix)
Transforms the vector (x, y, 0, 1) by the specified matrix.

Parameters:
position - The source vector.
matrix - The transformation matrix.

Transform

public static Vector2 Transform(Vector2 value,
                                Quaternion rotation)
Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Parameters:
value - The vector to rotate.
rotation - The Quaternion rotation to apply.

Transform

public static void Transform(Vector2 position,
                             Matrix matrix,
                             Vector2 result)
Transforms the vector (x, y, 0, 1) by the specified matrix.

Parameters:
position - The source vector.
matrix - The transformation matrix.
result - [OutAttribute] The Vector2 resulting from the transformation.

Transform

public static void Transform(Vector2[] sourceArray,
                             Matrix matrix,
                             Vector2[] destinationArray)
Transforms an array of Vector2s by a specified Matrix.

Parameters:
sourceArray - The array of Vector2s to transform.
matrix - The transform Matrix to apply.
destinationArray - An existing array into which the transformed Vector2s are written.

Transform

public static void Transform(Vector2[] sourceArray,
                             Quaternion rotation,
                             Vector2[] destinationArray)
Transforms an array of Vector2s by a specified Quaternion.

Parameters:
sourceArray - The array of Vector2s to transform.
rotation - The transform Matrix to use.
destinationArray - An existing array into which the transformed Vector2s are written.

Transform

public static void Transform(Vector2 value,
                             Quaternion rotation,
                             Vector2 result)
Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Parameters:
value - The vector to rotate.
rotation - The Quaternion rotation to apply.
result - [OutAttribute] An existing Vector2 filled in with the result of the rotation.

Transform

public static void Transform(Vector2[] sourceArray,
                             int sourceIndex,
                             Matrix matrix,
                             Vector2[] destinationArray,
                             int destinationIndex,
                             int length)
Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array.

Parameters:
sourceArray - The source array.
sourceIndex - The index of the first Vector2 to transform in the source array.
matrix - The Matrix to transform by.
destinationArray - The destination array into which the resulting Vector2s will be written.
destinationIndex - The index of the position in the destination array where the first result Vector2 should be written.
length - The number of Vector2s to be transformed.

Transform

public static void Transform(Vector2[] sourceArray,
                             int sourceIndex,
                             Quaternion rotation,
                             Vector2[] destinationArray,
                             int destinationIndex,
                             int length)
Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array.

Parameters:
sourceArray - The source array.
sourceIndex - The index of the first Vector2 to transform in the source array.
rotation - The Quaternion rotation to apply.
destinationArray - The destination array into which the resulting Vector2s are written.
destinationIndex - The index of the position in the destination array where the first result Vector2 should be written.
length - The number of Vector2s to be transformed.

TransformNormal

public static Vector2 TransformNormal(Vector2 normal,
                                      Matrix matrix)
Transforms a 2D vector normal by a matrix.

Parameters:
normal - The source vector.
matrix - The transformation matrix.

TransformNormal

public static void TransformNormal(Vector2 normal,
                                   Matrix matrix,
                                   Vector2 result)
Transforms a vector normal by a matrix.

Parameters:
normal - The source vector.
matrix - The transformation matrix.
result - [OutAttribute] The Vector2 resulting from the transformation.

TransformNormal

public static void TransformNormal(Vector2[] sourceArray,
                                   Matrix matrix,
                                   Vector2[] destinationArray)
Transforms an array of Vector2 vector normals by a specified Matrix.

Parameters:
sourceArray - The array of vector normals to transform.
matrix - The transform Matrix to apply.
destinationArray - An existing array into which the transformed vector normals are written.

TransformNormal

public static void TransformNormal(Vector2[] sourceArray,
                                   int sourceIndex,
                                   Matrix matrix,
                                   Vector2[] destinationArray,
                                   int destinationIndex,
                                   int length)
Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array.

Parameters:
sourceArray - The source array.
sourceIndex - The index of the first Vector2 to transform in the source array.
matrix - The Matrix to apply.
destinationArray - The destination array into which the resulting Vector2s are written.
destinationIndex - The index of the position in the destination array where the first result Vector2 should be written.
length - The number of vector normals to be transformed.