Microsoft.Xna.Framework
Class Vector3

java.lang.Object
  extended by System.ValueType
      extended by Microsoft.Xna.Framework.Vector3
All Implemented Interfaces:
IEquatable<Vector3>

public final class Vector3
extends ValueType
implements IEquatable<Vector3>

Defines a vector with three components.

Author:
Halofreak1990

Field Summary
static Vector3 Backward
          Returns a unit Vector3 designating backward in a right-handed coordinate system (0, 0, 1).
static Vector3 Down
          Returns a unit Vector3 designating down (0, −1, 0).
static Vector3 Forward
          Returns a unit Vector3 designating forward in a right-handed coordinate system(0, 0, −1).
static Vector3 Left
          Returns a unit Vector3 designating left (−1, 0, 0).
static Vector3 One
          Returns a Vector3 with ones in all of its components.
static Vector3 Right
          Returns a unit Vector3 pointing to the right (1, 0, 0).
static Vector3 UnitX
          Returns the x unit Vector3 (1, 0, 0).
static Vector3 UnitY
          Returns the y unit Vector3 (0, 1, 0).
static Vector3 UnitZ
          Returns the z unit Vector3 (0, 0, 1).
 float X
          Gets or sets the x-component of the vector.
 float Y
          Gets or sets the y-component of the vector.
 float Z
          Gets or sets the z-component of the vector.
static Vector3 Zero
          Returns a Vector3 with all of its components set to zero.
 
Constructor Summary
Vector3()
          Creates a new instance of Vector3.
Vector3(float value)
          Creates a new instance of Vector3.
Vector3(float x, float y, float z)
          Creates a new instance of Vector3.
Vector3(Vector2 value, float z)
          Initializes a new instance of Vector3.
 
Method Summary
 void Add(Vector3 other)
          Adds the specified vector to the current vector.
static Vector3 Add(Vector3 value1, Vector3 value2)
          Adds two vectors.
static void Add(Vector3 value1, Vector3 value2, Vector3 result)
          Adds two vectors.
static Vector3 Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2)
          Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
static void Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2, Vector3 result)
          Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
static Vector3 CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount)
          Performs a Catmull-Rom interpolation using the specified positions.
static void CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount, Vector3 result)
          Performs a Catmull-Rom interpolation using the specified positions.
static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max)
          Restricts a value to be within a specified range.
static void Clamp(Vector3 value1, Vector3 min, Vector3 max, Vector3 result)
          Restricts a value to be within a specified range.
static Vector3 Cross(Vector3 vector1, Vector3 vector2)
          Calculates the cross product of two vectors.
static void Cross(Vector3 vector1, Vector3 vector2, Vector3 result)
          Calculates the cross product of two vectors.
static float Distance(Vector3 value1, Vector3 value2)
          Calculates the distance between two vectors.
static void Distance(Vector3 value1, Vector3 value2, float result)
          Calculates the distance between two vectors.
static float DistanceSquared(Vector3 value1, Vector3 value2)
          Calculates the distance between two vectors squared.
static void DistanceSquared(Vector3 value1, Vector3 value2, float result)
          Calculates the distance between two vectors squared.
 void Divide(float value)
          Divides the current vector by a scalar value.
 void Divide(Vector3 other)
          Divides the components of the current vector by the components of another vector.
static Vector3 Divide(Vector3 value1, float value2)
          Divides a vector by a scalar value.
static void Divide(Vector3 value1, float value2, Vector3 result)
          Divides a vector by a scalar value.
static Vector3 Divide(Vector3 value1, Vector3 value2)
          Divides the components of a vector by the components of another vector.
static void Divide(Vector3 value1, Vector3 value2, Vector3 result)
          Divides the components of a vector by the components of another vector.
static float Dot(Vector3 vector1, Vector3 vector2)
          Calculates the dot product of two vectors.
static void Dot(Vector3 vector1, Vector3 vector2, float result)
          Calculates the dot product of two vectors.
 boolean equals(java.lang.Object obj)
          Returns a value that indicates whether the current instance is equal to a specified object.
 boolean Equals(Vector3 other)
          Determines whether the specified Object is equal to the Vector3.
 int hashCode()
          Gets the hash code of the vector object.
static Vector3 Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount)
          Performs a Hermite spline interpolation.
static void Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount, Vector3 result)
          Performs a Hermite spline interpolation.
 float Length()
          Calculates the length of the vector.
 float LengthSquared()
          Calculates the length of the vector squared.
static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
          Performs a linear interpolation between two vectors.
static void Lerp(Vector3 value1, Vector3 value2, float amount, Vector3 result)
          Performs a linear interpolation between two vectors.
static Vector3 Max(Vector3 value1, Vector3 value2)
          Returns a vector that contains the highest value from each matching pair of components.
static void Max(Vector3 value1, Vector3 value2, Vector3 result)
          Returns a vector that contains the highest value from each matching pair of components.
static Vector3 Min(Vector3 value1, Vector3 value2)
          Returns a vector that contains the lowest value from each matching pair of components.
static void Min(Vector3 value1, Vector3 value2, Vector3 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(Vector3 other)
          Multiplies the components of the current vector by the components of another vector.
static Vector3 Multiply(Vector3 value1, float scaleFactor)
          Multiplies a vector by a scalar value.
static void Multiply(Vector3 value1, float scaleFactor, Vector3 result)
          Multiplies a vector by a scalar value.
static Vector3 Multiply(Vector3 value1, Vector3 value2)
          Multiplies the components of two vectors by each other.
static void Multiply(Vector3 value1, Vector3 value2, Vector3 result)
          Multiplies the components of two vectors by each other.
 void Negate()
          Returns the current vector pointing in the opposite direction.
static Vector3 Negate(Vector3 value)
          Returns a vector pointing in the opposite direction.
static void Negate(Vector3 value, Vector3 result)
          Returns a vector pointing in the opposite direction.
 void Normalize()
          Turns the current vector into a unit vector.
static Vector3 Normalize(Vector3 value)
          Creates a unit vector from the specified vector.
static void Normalize(Vector3 value, Vector3 result)
          Creates a unit vector from the specified vector, writing the result to a user-specified variable.
static Vector3 Reflect(Vector3 vector, Vector3 normal)
          Returns the reflection of a vector off a surface that has the specified normal.
static void Reflect(Vector3 vector, Vector3 normal, Vector3 result)
          Returns the reflection of a vector off a surface that has the specified normal.
static Vector3 SmoothStep(Vector3 value1, Vector3 value2, float amount)
          Interpolates between two values using a cubic equation.
static void SmoothStep(Vector3 value1, Vector3 value2, float amount, Vector3 result)
          Interpolates between two values using a cubic equation.
 void Subtract(Vector3 other)
          Subtracts the specified vector from the current vector.
static Vector3 Subtract(Vector3 value1, Vector3 value2)
          Subtracts a vector from a vector.
static void Subtract(Vector3 value1, Vector3 value2, Vector3 result)
          Subtracts a vector from a vector.
 java.lang.String ToString()
          Retrieves a string representation of the current object.
static void Transform(Vector3[] sourceArray, int sourceIndex, Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
          Applies a specified transform Matrix to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.
static void Transform(Vector3[] sourceArray, int sourceIndex, Quaternion rotation, Vector3[] destinationArray, int destinationIndex, int length)
          Applies a specified Quaternion rotation to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.
static void Transform(Vector3[] sourceArray, Matrix matrix, Vector3[] destinationArray)
          Transforms a source array of Vector3s by a specified Matrix and writes the results to an existing destination array.
static void Transform(Vector3[] sourceArray, Quaternion rotation, Vector3[] destinationArray)
          Transforms a source array of Vector3s by a specified Quaternion rotation and writes the results to an existing destination array.
static Vector3 Transform(Vector3 position, Matrix matrix)
          Transforms a 3D vector by the given matrix.
static void Transform(Vector3 position, Matrix matrix, Vector3 result)
          Transforms a Vector3 by the given Matrix.
static Vector3 Transform(Vector3 value, Quaternion rotation)
          Transforms a Vector3 by a specified Quaternion rotation.
static void Transform(Vector3 value, Quaternion rotation, Vector3 result)
          Transforms a Vector3 by a specified Quaternion rotation.
static void TransformNormal(Vector3[] sourceArray, int sourceIndex, Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
          Transforms a specified range in an array of 3D vector normals by a specified Matrix and writes the results to a specified range in a destination array.
static void TransformNormal(Vector3[] sourceArray, Matrix matrix, Vector3[] destinationArray)
          Transforms an array of 3D vector normals by a specified Matrix.
static Vector3 TransformNormal(Vector3 normal, Matrix matrix)
          Transforms a 3D vector normal by a matrix.
static void TransformNormal(Vector3 normal, Matrix matrix, Vector3 result)
          Transforms a vector normal by a matrix.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Backward

public static final Vector3 Backward
Returns a unit Vector3 designating backward in a right-handed coordinate system (0, 0, 1).


Down

public static final Vector3 Down
Returns a unit Vector3 designating down (0, −1, 0).


Forward

public static final Vector3 Forward
Returns a unit Vector3 designating forward in a right-handed coordinate system(0, 0, −1).


Left

public static final Vector3 Left
Returns a unit Vector3 designating left (−1, 0, 0).


One

public static final Vector3 One
Returns a Vector3 with ones in all of its components.


Right

public static final Vector3 Right
Returns a unit Vector3 pointing to the right (1, 0, 0).


UnitX

public static final Vector3 UnitX
Returns the x unit Vector3 (1, 0, 0).


UnitY

public static final Vector3 UnitY
Returns the y unit Vector3 (0, 1, 0).


UnitZ

public static final Vector3 UnitZ
Returns the z unit Vector3 (0, 0, 1).


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.


Z

public float Z
Gets or sets the z-component of the vector.


Zero

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

Constructor Detail

Vector3

public Vector3(float value)
Creates a new instance of Vector3.

Parameters:
value - Value to initialize each component to.

Vector3

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

Parameters:
value - A vector containing the values to initialize x and y components with.
z - Initial value for the z-component of the vector.

Vector3

public Vector3(float x,
               float y,
               float z)
Creates a new instance of Vector3.

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

Vector3

public Vector3()
Creates a new instance of Vector3.

Method Detail

Add

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

Parameters:
other - Source vector.

Add

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

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

Add

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

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

Barycentric

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

Parameters:
value1 - A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.
value2 - A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.
value3 - A Vector3 containing the 3D 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(Vector3 value1,
                               Vector3 value2,
                               Vector3 value3,
                               float amount1,
                               float amount2,
                               Vector3 result)
Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.

Parameters:
value1 - A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.
value2 - A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.
value3 - A Vector3 containing the 3D 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 3D Cartesian coordinates of the specified point are placed in this Vector3 on exit.

CatmullRom

public static Vector3 CatmullRom(Vector3 value1,
                                 Vector3 value2,
                                 Vector3 value3,
                                 Vector3 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(Vector3 value1,
                              Vector3 value2,
                              Vector3 value3,
                              Vector3 value4,
                              float amount,
                              Vector3 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 Vector3 Clamp(Vector3 value1,
                            Vector3 min,
                            Vector3 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(Vector3 value1,
                         Vector3 min,
                         Vector3 max,
                         Vector3 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.

Cross

public static Vector3 Cross(Vector3 vector1,
                            Vector3 vector2)
Calculates the cross product of two vectors.

Parameters:
vector1 - Source vector.
vector2 - Source vector.

Cross

public static void Cross(Vector3 vector1,
                         Vector3 vector2,
                         Vector3 result)
Calculates the cross product of two vectors.

Parameters:
vector1 - Source vector.
vector2 - Source vector.
result - [OutAttribute] The cross product of the vectors.

Distance

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

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

Distance

public static void Distance(Vector3 value1,
                            Vector3 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(Vector3 value1,
                                    Vector3 value2)
Calculates the distance between two vectors squared.

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

DistanceSquared

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

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

Divide

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

Parameters:
other - Source vector.

Divide

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

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

Divide

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

Parameters:
value - The divisor.

Divide

public static Vector3 Divide(Vector3 value1,
                             float value2)
Divides a vector by a scalar value.

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

Divide

public static void Divide(Vector3 value1,
                          Vector3 value2,
                          Vector3 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(Vector3 value1,
                          float value2,
                          Vector3 result)
Divides a vector by a scalar value.

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

Dot

public static float Dot(Vector3 vector1,
                        Vector3 vector2)
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:
vector1 - Source vector.
vector2 - Source vector.

Dot

public static void Dot(Vector3 vector1,
                       Vector3 vector2,
                       float result)
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:
vector1 - Source vector.
vector2 - 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.

Equals

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

Specified by:
Equals in interface IEquatable<Vector3>
Parameters:
other - The Vector3 to compare with the current Vector3.
Returns:
true if the current object is equal to the other parameter; otherwise, false.

hashCode

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

Overrides:
hashCode in class java.lang.Object

Hermite

public static Vector3 Hermite(Vector3 value1,
                              Vector3 tangent1,
                              Vector3 value2,
                              Vector3 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(Vector3 value1,
                           Vector3 tangent1,
                           Vector3 value2,
                           Vector3 tangent2,
                           float amount,
                           Vector3 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 Vector3 Lerp(Vector3 value1,
                           Vector3 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(Vector3 value1,
                        Vector3 value2,
                        float amount,
                        Vector3 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 Vector3 Max(Vector3 value1,
                          Vector3 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(Vector3 value1,
                       Vector3 value2,
                       Vector3 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 Vector3 Min(Vector3 value1,
                          Vector3 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(Vector3 value1,
                       Vector3 value2,
                       Vector3 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(Vector3 other)
Multiplies the components of the current vector by the components of another vector.

Parameters:
other - Source vector.

Multiply

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

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

Multiply

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

Parameters:
scaleFactor - Scalar value.

Multiply

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

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

Multiply

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

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

Multiply

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

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

Negate

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


Negate

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

Parameters:
value - Source vector.

Negate

public static void Negate(Vector3 value,
                          Vector3 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 Vector3 Normalize(Vector3 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 vector.

Normalize

public static void Normalize(Vector3 value,
                             Vector3 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] The normalized vector.

Reflect

public static Vector3 Reflect(Vector3 vector,
                              Vector3 normal)
Returns the reflection of a vector off a surface that has the specified normal.

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

Reflect

public static void Reflect(Vector3 vector,
                           Vector3 normal,
                           Vector3 result)
Returns the reflection of a vector off a surface that has the specified normal.

Parameters:
vector - Source vector.
normal - Normal of the surface.
result - [OutAttribute] The reflected vector.

SmoothStep

public static Vector3 SmoothStep(Vector3 value1,
                                 Vector3 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(Vector3 value1,
                              Vector3 value2,
                              float amount,
                              Vector3 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(Vector3 other)
Subtracts the specified vector from the current vector.

Parameters:
other - Source vector.

Subtract

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

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

Subtract

public static void Subtract(Vector3 value1,
                            Vector3 value2,
                            Vector3 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.


Transform

public static Vector3 Transform(Vector3 position,
                                Matrix matrix)
Transforms a 3D vector by the given matrix.

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

Transform

public static Vector3 Transform(Vector3 value,
                                Quaternion rotation)
Transforms a Vector3 by a specified Quaternion rotation.

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

Transform

public static void Transform(Vector3[] sourceArray,
                             Matrix matrix,
                             Vector3[] destinationArray)
Transforms a source array of Vector3s by a specified Matrix and writes the results to an existing destination array.

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

Transform

public static void Transform(Vector3[] sourceArray,
                             Quaternion rotation,
                             Vector3[] destinationArray)
Transforms a source array of Vector3s by a specified Quaternion rotation and writes the results to an existing destination array.

Parameters:
sourceArray - The source array.
rotation - The Quaternion rotation to apply.
destinationArray - An existing destination array into which the transformed Vector3s are written.

Transform

public static void Transform(Vector3 position,
                             Matrix matrix,
                             Vector3 result)
Transforms a Vector3 by the given Matrix.

Parameters:
position - The source Vector3.
matrix - The transformation Matrix.
result - [OutAttribute] The transformed vector.

Transform

public static void Transform(Vector3 value,
                             Quaternion rotation,
                             Vector3 result)
Transforms a Vector3 by a specified Quaternion rotation.

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

Transform

public static void Transform(Vector3[] sourceArray,
                             int sourceIndex,
                             Matrix matrix,
                             Vector3[] destinationArray,
                             int destinationIndex,
                             int length)
Applies a specified transform Matrix to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.

Parameters:
sourceArray - The source array.
sourceIndex - The index in the source array at which to start.
matrix - The transform Matrix to apply.
destinationArray - The existing destination array.
destinationIndex - The index in the destination array at which to start.
length - The number of Vector3s to transform.

Transform

public static void Transform(Vector3[] sourceArray,
                             int sourceIndex,
                             Quaternion rotation,
                             Vector3[] destinationArray,
                             int destinationIndex,
                             int length)
Applies a specified Quaternion rotation to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.

Parameters:
sourceArray - The source array.
sourceIndex - The index in the source array at which to start.
rotation - The Quaternion rotation to apply.
destinationArray - The existing destination array.
destinationIndex - The index in the destination array at which to start.
length - The number of Vector3s to transform.

TransformNormal

public static Vector3 TransformNormal(Vector3 normal,
                                      Matrix matrix)
Transforms a 3D vector normal by a matrix.

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

TransformNormal

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

Parameters:
sourceArray - The array of Vector3 normals to transform.
matrix - The transform matrix to apply.
destinationArray - An existing Vector3 array into which the results of the transforms are written.

TransformNormal

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

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

TransformNormal

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

Parameters:
sourceArray - The source array of Vector3 normals.
sourceIndex - The starting index in the source array.
matrix - The transform Matrix to apply.
destinationArray - The destination Vector3 array.
destinationIndex - The starting index in the destination array.
length - The number of vectors to transform.