|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSystem.ValueType
Microsoft.Xna.Framework.Vector3
public final class Vector3
Defines a vector with three components.
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 |
---|
public static final Vector3 Backward
public static final Vector3 Down
public static final Vector3 Forward
public static final Vector3 Left
public static final Vector3 One
public static final Vector3 Right
public static final Vector3 UnitX
public static final Vector3 UnitY
public static final Vector3 UnitZ
public float X
public float Y
public float Z
public static final Vector3 Zero
Constructor Detail |
---|
public Vector3(float value)
value
- Value to initialize each component to.public Vector3(Vector2 value, float z)
value
- A vector containing the values to initialize x and y components with.z
- Initial value for the z-component of the vector.public Vector3(float x, float y, float z)
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.public Vector3()
Method Detail |
---|
public void Add(Vector3 other)
other
- Source vector.public static Vector3 Add(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public static void Add(Vector3 value1, Vector3 value2, Vector3 result)
value1
- Source vector.value2
- Source vector.result
- [OutAttribute] Sum of the source vectors.public static Vector3 Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2)
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).public static void Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2, Vector3 result)
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.public static Vector3 CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount)
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.public static void CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount, Vector3 result)
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.public static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max)
value1
- The value to clamp.min
- The minimum value.max
- The maximum value.public static void Clamp(Vector3 value1, Vector3 min, Vector3 max, Vector3 result)
value1
- The value to clamp.min
- The minimum value.max
- The maximum value.result
- [OutAttribute] The clamped value.public static Vector3 Cross(Vector3 vector1, Vector3 vector2)
vector1
- Source vector.vector2
- Source vector.public static void Cross(Vector3 vector1, Vector3 vector2, Vector3 result)
vector1
- Source vector.vector2
- Source vector.result
- [OutAttribute] The cross product of the vectors.public static float Distance(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public static void Distance(Vector3 value1, Vector3 value2, float result)
value1
- Source vector.value2
- Source vector.result
- [OutAttribute] The distance between the vectors.public static float DistanceSquared(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public static void DistanceSquared(Vector3 value1, Vector3 value2, float result)
value1
- Source vector.value2
- Source vector.result
- [OutAttribute] The distance between the two vectors squared.public void Divide(Vector3 other)
other
- Source vector.public static Vector3 Divide(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public void Divide(float value)
value
- The divisor.public static Vector3 Divide(Vector3 value1, float value2)
value1
- Source vector.value2
- The divisor.public static void Divide(Vector3 value1, Vector3 value2, Vector3 result)
value1
- Source vector.value2
- The divisor.result
- [OutAttribute] The result of the division.public static void Divide(Vector3 value1, float value2, Vector3 result)
value1
- Source vector.value2
- The divisor.result
- [OutAttribute] The result of the division.public static float Dot(Vector3 vector1, Vector3 vector2)
vector1
- Source vector.vector2
- Source vector.public static void Dot(Vector3 vector1, Vector3 vector2, float result)
vector1
- Source vector.vector2
- Source vector.result
- [OutAttribute] The dot product of the two vectors.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object to make the comparison with.public boolean Equals(Vector3 other)
Equals
in interface IEquatable<Vector3>
other
- The Vector3 to compare with the current Vector3.
public int hashCode()
hashCode
in class java.lang.Object
public static Vector3 Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount)
value1
- Source position vector.tangent1
- Source tangent vector.value2
- Source position vector.tangent2
- Source tangent vector.amount
- Weighting factor.public static void Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount, Vector3 result)
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.public float Length()
public float LengthSquared()
public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
value1
- Source vector.value2
- Source vector.amount
- Value between 0 and 1 indicating the weight of value2.public static void Lerp(Vector3 value1, Vector3 value2, float amount, Vector3 result)
value1
- Source vector.value2
- Source vector.amount
- Value between 0 and 1 indicating the weight of value2.result
- [OutAttribute] The result of the interpolation.public static Vector3 Max(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public static void Max(Vector3 value1, Vector3 value2, Vector3 result)
value1
- Source vector.value2
- Source vector.result
- [OutAttribute] The maximized vector.public static Vector3 Min(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public static void Min(Vector3 value1, Vector3 value2, Vector3 result)
value1
- Source vector.value2
- Source vector.result
- [OutAttribute] The minimized vector.public void Multiply(Vector3 other)
other
- Source vector.public static Vector3 Multiply(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public void Multiply(float scaleFactor)
scaleFactor
- Scalar value.public static Vector3 Multiply(Vector3 value1, float scaleFactor)
value1
- Source vector.scaleFactor
- Scalar value.public static void Multiply(Vector3 value1, float scaleFactor, Vector3 result)
value1
- Source vector.scaleFactor
- Scalar value.result
- [OutAttribute] The result of the multiplication.public static void Multiply(Vector3 value1, Vector3 value2, Vector3 result)
value1
- Source vector.value2
- Source vector.result
- [OutAttribute] The result of the multiplication.public void Negate()
public static Vector3 Negate(Vector3 value)
value
- Source vector.public static void Negate(Vector3 value, Vector3 result)
value
- Source vector.result
- [OutAttribute] Vector pointing in the opposite direction.public void Normalize()
public static Vector3 Normalize(Vector3 value)
value
- Source vector.public static void Normalize(Vector3 value, Vector3 result)
value
- Source vector.result
- [OutAttribute] The normalized vector.public static Vector3 Reflect(Vector3 vector, Vector3 normal)
vector
- Source vector.normal
- Normal of the surface.public static void Reflect(Vector3 vector, Vector3 normal, Vector3 result)
vector
- Source vector.normal
- Normal of the surface.result
- [OutAttribute] The reflected vector.public static Vector3 SmoothStep(Vector3 value1, Vector3 value2, float amount)
value1
- Source value.value2
- Source value.amount
- Weighting value.public static void SmoothStep(Vector3 value1, Vector3 value2, float amount, Vector3 result)
value1
- Source value.value2
- Source value.amount
- Weighting value.result
- [OutAttribute] The interpolated value.public void Subtract(Vector3 other)
other
- Source vector.public static Vector3 Subtract(Vector3 value1, Vector3 value2)
value1
- Source vector.value2
- Source vector.public static void Subtract(Vector3 value1, Vector3 value2, Vector3 result)
value1
- Source vector.value2
- Source vector.result
- [OutAttribute] The result of the subtraction.public java.lang.String ToString()
public static Vector3 Transform(Vector3 position, Matrix matrix)
position
- The source vector.matrix
- The transformation matrix.public static Vector3 Transform(Vector3 value, Quaternion rotation)
value
- The Vector3 to rotate.rotation
- The Quaternion rotation to apply.public static void Transform(Vector3[] sourceArray, Matrix matrix, Vector3[] destinationArray)
sourceArray
- The source array.matrix
- The transform Matrix to apply.destinationArray
- An existing destination array into which the transformed Vector3s are written.public static void Transform(Vector3[] sourceArray, Quaternion rotation, Vector3[] destinationArray)
sourceArray
- The source array.rotation
- The Quaternion rotation to apply.destinationArray
- An existing destination array into which the transformed Vector3s are written.public static void Transform(Vector3 position, Matrix matrix, Vector3 result)
position
- The source Vector3.matrix
- The transformation Matrix.result
- [OutAttribute] The transformed vector.public static void Transform(Vector3 value, Quaternion rotation, Vector3 result)
value
- The Vector3 to rotate.rotation
- The Quaternion rotation to apply.result
- [OutAttribute] An existing Vector3 filled in with the results of the rotation.public static void Transform(Vector3[] sourceArray, int sourceIndex, Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
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.public static void Transform(Vector3[] sourceArray, int sourceIndex, Quaternion rotation, Vector3[] destinationArray, int destinationIndex, int length)
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.public static Vector3 TransformNormal(Vector3 normal, Matrix matrix)
normal
- The source vector.matrix
- The transformation matrix.public static void TransformNormal(Vector3[] sourceArray, Matrix matrix, Vector3[] destinationArray)
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.public static void TransformNormal(Vector3 normal, Matrix matrix, Vector3 result)
normal
- The source vector.matrix
- The transformation Matrix.result
- [OutAttribute] The Vector3 resulting from the transformation.public static void TransformNormal(Vector3[] sourceArray, int sourceIndex, Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |