Nebula
|
Describes a 4D-vector.
Inherits IEquatable< Vector4 >.
Public Member Functions | |
Vector4 (float x, float y, float z, float w) | |
Constructs a 3d vector with X, Y, Z and W from four values. | |
Vector4 (Vector2 value, float z, float w) | |
Constructs a 3d vector with X and Z from Vector2 and Z and W from the scalars. | |
Vector4 (Vector3 value, float w) | |
Constructs a 3d vector with X, Y, Z from Vector3 and W from a scalar. | |
Vector4 (float value) | |
Constructs a 4d vector with X, Y, Z and W set to the same value. | |
void | Ceiling () |
Round the members of this Vector4 towards positive infinity. | |
override bool | Equals (object obj) |
Compares whether current instance is equal to specified Object. | |
bool | Equals (Vector4 other) |
Compares whether current instance is equal to specified Vector4. | |
void | Floor () |
Round the members of this Vector4 towards negative infinity. | |
override int | GetHashCode () |
Gets the hash code of this Vector4. | |
float | Length () |
Returns the length of this Vector4. | |
float | LengthSquared () |
Returns the squared length of this Vector4. | |
void | Normalize () |
Turns this Vector4 to a unit vector with the same direction. | |
void | Round () |
Round the members of this Vector4 to the nearest integer value. | |
override string | ToString () |
Returns a String representation of this Vector4 in the format: {X:[X] Y:[Y] Z:[Z] W:[W]}. | |
void | Deconstruct (out float x, out float y, out float z, out float w) |
Deconstruction method for Vector4. | |
Static Public Member Functions | |
static Vector4 | Add (Vector4 value1, Vector4 value2) |
Performs vector addition on value1 and value2 . | |
static void | Add (ref Vector4 value1, ref Vector4 value2, out Vector4 result) |
Performs vector addition on value1 and value2 , storing the result of the addition in result . | |
static Vector4 | Barycentric (Vector4 value1, Vector4 value2, Vector4 value3, float amount1, float amount2) |
Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle. | |
static void | Barycentric (ref Vector4 value1, ref Vector4 value2, ref Vector4 value3, float amount1, float amount2, out Vector4 result) |
Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle. | |
static Vector4 | CatmullRom (Vector4 value1, Vector4 value2, Vector4 value3, Vector4 value4, float amount) |
Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors. | |
static void | CatmullRom (ref Vector4 value1, ref Vector4 value2, ref Vector4 value3, ref Vector4 value4, float amount, out Vector4 result) |
Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors. | |
static Vector4 | Ceiling (Vector4 value) |
Creates a new Vector4 that contains members from another vector rounded towards positive infinity. | |
static void | Ceiling (ref Vector4 value, out Vector4 result) |
Creates a new Vector4 that contains members from another vector rounded towards positive infinity. | |
static Vector4 | Clamp (Vector4 value1, Vector4 min, Vector4 max) |
Clamps the specified value within a range. | |
static void | Clamp (ref Vector4 value1, ref Vector4 min, ref Vector4 max, out Vector4 result) |
Clamps the specified value within a range. | |
static float | Distance (Vector4 value1, Vector4 value2) |
Returns the distance between two vectors. | |
static void | Distance (ref Vector4 value1, ref Vector4 value2, out float result) |
Returns the distance between two vectors. | |
static float | DistanceSquared (Vector4 value1, Vector4 value2) |
Returns the squared distance between two vectors. | |
static void | DistanceSquared (ref Vector4 value1, ref Vector4 value2, out float result) |
Returns the squared distance between two vectors. | |
static Vector4 | Divide (Vector4 value1, Vector4 value2) |
Divides the components of a Vector4 by the components of another Vector4. | |
static Vector4 | Divide (Vector4 value1, float divider) |
Divides the components of a Vector4 by a scalar. | |
static void | Divide (ref Vector4 value1, float divider, out Vector4 result) |
Divides the components of a Vector4 by a scalar. | |
static void | Divide (ref Vector4 value1, ref Vector4 value2, out Vector4 result) |
Divides the components of a Vector4 by the components of another Vector4. | |
static float | Dot (Vector4 value1, Vector4 value2) |
Returns a dot product of two vectors. | |
static void | Dot (ref Vector4 value1, ref Vector4 value2, out float result) |
Returns a dot product of two vectors. | |
static Vector4 | Floor (Vector4 value) |
Creates a new Vector4 that contains members from another vector rounded towards negative infinity. | |
static void | Floor (ref Vector4 value, out Vector4 result) |
Creates a new Vector4 that contains members from another vector rounded towards negative infinity. | |
static Vector4 | Hermite (Vector4 value1, Vector4 tangent1, Vector4 value2, Vector4 tangent2, float amount) |
Creates a new Vector4 that contains hermite spline interpolation. | |
static void | Hermite (ref Vector4 value1, ref Vector4 tangent1, ref Vector4 value2, ref Vector4 tangent2, float amount, out Vector4 result) |
Creates a new Vector4 that contains hermite spline interpolation. | |
static Vector4 | Lerp (Vector4 value1, Vector4 value2, float amount) |
Creates a new Vector4 that contains linear interpolation of the specified vectors. | |
static void | Lerp (ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result) |
Creates a new Vector4 that contains linear interpolation of the specified vectors. | |
static Vector4 | LerpPrecise (Vector4 value1, Vector4 value2, float amount) |
Creates a new Vector4 that contains linear interpolation of the specified vectors. | |
static void | LerpPrecise (ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result) |
Creates a new Vector4 that contains linear interpolation of the specified vectors. | |
static Vector4 | Max (Vector4 value1, Vector4 value2) |
Creates a new Vector4 that contains a maximal values from the two vectors. | |
static void | Max (ref Vector4 value1, ref Vector4 value2, out Vector4 result) |
Creates a new Vector4 that contains a maximal values from the two vectors. | |
static Vector4 | Min (Vector4 value1, Vector4 value2) |
Creates a new Vector4 that contains a minimal values from the two vectors. | |
static void | Min (ref Vector4 value1, ref Vector4 value2, out Vector4 result) |
Creates a new Vector4 that contains a minimal values from the two vectors. | |
static Vector4 | Multiply (Vector4 value1, Vector4 value2) |
Creates a new Vector4 that contains a multiplication of two vectors. | |
static Vector4 | Multiply (Vector4 value1, float scaleFactor) |
Creates a new Vector4 that contains a multiplication of Vector4 and a scalar. | |
static void | Multiply (ref Vector4 value1, float scaleFactor, out Vector4 result) |
Creates a new Vector4 that contains a multiplication of Vector4 and a scalar. | |
static void | Multiply (ref Vector4 value1, ref Vector4 value2, out Vector4 result) |
Creates a new Vector4 that contains a multiplication of two vectors. | |
static Vector4 | Negate (Vector4 value) |
Creates a new Vector4 that contains the specified vector inversion. | |
static void | Negate (ref Vector4 value, out Vector4 result) |
Creates a new Vector4 that contains the specified vector inversion. | |
static Vector4 | Normalize (Vector4 value) |
Creates a new Vector4 that contains a normalized values from another vector. | |
static void | Normalize (ref Vector4 value, out Vector4 result) |
Creates a new Vector4 that contains a normalized values from another vector. | |
static Vector4 | Round (Vector4 value) |
Creates a new Vector4 that contains members from another vector rounded to the nearest integer value. | |
static void | Round (ref Vector4 value, out Vector4 result) |
Creates a new Vector4 that contains members from another vector rounded to the nearest integer value. | |
static Vector4 | SmoothStep (Vector4 value1, Vector4 value2, float amount) |
Creates a new Vector4 that contains cubic interpolation of the specified vectors. | |
static void | SmoothStep (ref Vector4 value1, ref Vector4 value2, float amount, out Vector4 result) |
Creates a new Vector4 that contains cubic interpolation of the specified vectors. | |
static Vector4 | Subtract (Vector4 value1, Vector4 value2) |
Creates a new Vector4 that contains subtraction of on Vector4 from a another. | |
static void | Subtract (ref Vector4 value1, ref Vector4 value2, out Vector4 result) |
Creates a new Vector4 that contains subtraction of on Vector4 from a another. | |
static Vector4 | Transform (Vector2 value, Matrix matrix) |
Creates a new Vector4 that contains a transformation of 2d-vector by the specified Matrix. | |
static Vector4 | Transform (Vector2 value, Quaternion rotation) |
Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion. | |
static Vector4 | Transform (Vector3 value, Matrix matrix) |
Creates a new Vector4 that contains a transformation of 3d-vector by the specified Matrix. | |
static Vector4 | Transform (Vector3 value, Quaternion rotation) |
Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion. | |
static Vector4 | Transform (Vector4 value, Matrix matrix) |
Creates a new Vector4 that contains a transformation of 4d-vector by the specified Matrix. | |
static Vector4 | Transform (Vector4 value, Quaternion rotation) |
Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion. | |
static void | Transform (ref Vector2 value, ref Matrix matrix, out Vector4 result) |
Creates a new Vector4 that contains a transformation of 2d-vector by the specified Matrix. | |
static void | Transform (ref Vector2 value, ref Quaternion rotation, out Vector4 result) |
Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion. | |
static void | Transform (ref Vector3 value, ref Matrix matrix, out Vector4 result) |
Creates a new Vector4 that contains a transformation of 3d-vector by the specified Matrix. | |
static void | Transform (ref Vector3 value, ref Quaternion rotation, out Vector4 result) |
Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion. | |
static void | Transform (ref Vector4 value, ref Matrix matrix, out Vector4 result) |
Creates a new Vector4 that contains a transformation of 4d-vector by the specified Matrix. | |
static void | Transform (ref Vector4 value, ref Quaternion rotation, out Vector4 result) |
Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion. | |
static void | Transform (Vector4[] sourceArray, int sourceIndex, ref Matrix matrix, Vector4[] destinationArray, int destinationIndex, int length) |
Apply transformation on vectors within array of Vector4 by the specified Matrix and places the results in an another array. | |
static void | Transform (Vector4[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector4[] destinationArray, int destinationIndex, int length) |
Apply transformation on vectors within array of Vector4 by the specified Quaternion and places the results in an another array. | |
static void | Transform (Vector4[] sourceArray, ref Matrix matrix, Vector4[] destinationArray) |
Apply transformation on all vectors within array of Vector4 by the specified Matrix and places the results in an another array. | |
static void | Transform (Vector4[] sourceArray, ref Quaternion rotation, Vector4[] destinationArray) |
Apply transformation on all vectors within array of Vector4 by the specified Quaternion and places the results in an another array. | |
static Vector4 | operator- (Vector4 value) |
Inverts values in the specified Vector4. | |
static bool | operator== (Vector4 value1, Vector4 value2) |
Compares whether two Vector4 instances are equal. | |
static bool | operator!= (Vector4 value1, Vector4 value2) |
Compares whether two Vector4 instances are not equal. | |
static Vector4 | operator+ (Vector4 value1, Vector4 value2) |
Adds two vectors. | |
static Vector4 | operator- (Vector4 value1, Vector4 value2) |
Subtracts a Vector4 from a Vector4. | |
static Vector4 | operator* (Vector4 value1, Vector4 value2) |
Multiplies the components of two vectors by each other. | |
static Vector4 | operator* (Vector4 value, float scaleFactor) |
Multiplies the components of vector by a scalar. | |
static Vector4 | operator* (float scaleFactor, Vector4 value) |
Multiplies the components of vector by a scalar. | |
static Vector4 | operator/ (Vector4 value1, Vector4 value2) |
Divides the components of a Vector4 by the components of another Vector4. | |
static Vector4 | operator/ (Vector4 value1, float divider) |
Divides the components of a Vector4 by a scalar. | |
Public Attributes | |
float | X |
The x coordinate of this Vector4. | |
float | Y |
The y coordinate of this Vector4. | |
float | Z |
The z coordinate of this Vector4. | |
float | W |
The w coordinate of this Vector4. | |
Properties | |
static Vector4 | Zero [get] |
Returns a Vector4 with components 0, 0, 0, 0. | |
static Vector4 | One [get] |
Returns a Vector4 with components 1, 1, 1, 1. | |
static Vector4 | UnitX [get] |
Returns a Vector4 with components 1, 0, 0, 0. | |
static Vector4 | UnitY [get] |
Returns a Vector4 with components 0, 1, 0, 0. | |
static Vector4 | UnitZ [get] |
Returns a Vector4 with components 0, 0, 1, 0. | |
static Vector4 | UnitW [get] |
Returns a Vector4 with components 0, 0, 0, 1. | |
string | DebugDisplayString [get] |
Static Private Attributes | |
static readonly Vector4 | zero = new Vector4() |
static readonly Vector4 | one = new Vector4(1f, 1f, 1f, 1f) |
static readonly Vector4 | unitX = new Vector4(1f, 0f, 0f, 0f) |
static readonly Vector4 | unitY = new Vector4(0f, 1f, 0f, 0f) |
static readonly Vector4 | unitZ = new Vector4(0f, 0f, 1f, 0f) |
static readonly Vector4 | unitW = new Vector4(0f, 0f, 0f, 1f) |
|
inline |
Constructs a 3d vector with X, Y, Z and W from four values.
x | The x coordinate in 4d-space. |
y | The y coordinate in 4d-space. |
z | The z coordinate in 4d-space. |
w | The w coordinate in 4d-space. |
|
inline |
Constructs a 3d vector with X and Z from Vector2 and Z and W from the scalars.
value | The x and y coordinates in 4d-space. |
z | The z coordinate in 4d-space. |
w | The w coordinate in 4d-space. |
|
inline |
Constructs a 3d vector with X, Y, Z from Vector3 and W from a scalar.
value | The x, y and z coordinates in 4d-space. |
w | The w coordinate in 4d-space. |
|
inline |
Constructs a 4d vector with X, Y, Z and W set to the same value.
value | The x, y, z and w coordinates in 4d-space. |
|
inlinestatic |
Performs vector addition on value1 and value2 , storing the result of the addition in result .
value1 | The first vector to add. |
value2 | The second vector to add. |
result | The result of the vector addition. |
Performs vector addition on value1 and value2 .
value1 | The first vector to add. |
value2 | The second vector to add. |
|
inlinestatic |
Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle.
value1 | The first vector of 4d-triangle. |
value2 | The second vector of 4d-triangle. |
value3 | The third vector of 4d-triangle. |
amount1 | Barycentric scalar b2 which represents a weighting factor towards second vector of 4d-triangle. |
amount2 | Barycentric scalar b3 which represents a weighting factor towards third vector of 4d-triangle. |
result | The cartesian translation of barycentric coordinates as an output parameter. |
|
inlinestatic |
Creates a new Vector4 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 4d-triangle.
value1 | The first vector of 4d-triangle. |
value2 | The second vector of 4d-triangle. |
value3 | The third vector of 4d-triangle. |
amount1 | Barycentric scalar b2 which represents a weighting factor towards second vector of 4d-triangle. |
amount2 | Barycentric scalar b3 which represents a weighting factor towards third vector of 4d-triangle. |
|
inlinestatic |
Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors.
value1 | The first vector in interpolation. |
value2 | The second vector in interpolation. |
value3 | The third vector in interpolation. |
value4 | The fourth vector in interpolation. |
amount | Weighting factor. |
result | The result of CatmullRom interpolation as an output parameter. |
|
inlinestatic |
Creates a new Vector4 that contains CatmullRom interpolation of the specified vectors.
value1 | The first vector in interpolation. |
value2 | The second vector in interpolation. |
value3 | The third vector in interpolation. |
value4 | The fourth vector in interpolation. |
amount | Weighting factor. |
|
inlinestatic |
Clamps the specified value within a range.
value1 | The value to clamp. |
min | The min value. |
max | The max value. |
result | The clamped value as an output parameter. |
Clamps the specified value within a range.
value1 | The value to clamp. |
min | The min value. |
max | The max value. |
|
inline |
Deconstruction method for Vector4.
x | |
y | |
z | |
w |
|
inlinestatic |
Returns the distance between two vectors.
value1 | The first vector. |
value2 | The second vector. |
result | The distance between two vectors as an output parameter. |
Returns the distance between two vectors.
value1 | The first vector. |
value2 | The second vector. |
|
inlinestatic |
Returns the squared distance between two vectors.
value1 | The first vector. |
value2 | The second vector. |
result | The squared distance between two vectors as an output parameter. |
Returns the squared distance between two vectors.
value1 | The first vector. |
value2 | The second vector. |
|
inlinestatic |
Returns a dot product of two vectors.
value1 | The first vector. |
value2 | The second vector. |
result | The dot product of two vectors as an output parameter. |
Returns a dot product of two vectors.
value1 | The first vector. |
value2 | The second vector. |
|
inline |
Compares whether current instance is equal to specified Object.
obj | The Object to compare. |
true
if the instances are equal; false
otherwise.
|
inline |
|
inline |
|
inlinestatic |
Creates a new Vector4 that contains hermite spline interpolation.
value1 | The first position vector. |
tangent1 | The first tangent vector. |
value2 | The second position vector. |
tangent2 | The second tangent vector. |
amount | Weighting factor. |
result | The hermite spline interpolation vector as an output parameter. |
|
inlinestatic |
Creates a new Vector4 that contains hermite spline interpolation.
value1 | The first position vector. |
tangent1 | The first tangent vector. |
value2 | The second position vector. |
tangent2 | The second tangent vector. |
amount | Weighting factor. |
|
inline |
|
inline |
|
inlinestatic |
Creates a new Vector4 that contains linear interpolation of the specified vectors.
value1 | The first vector. |
value2 | The second vector. |
amount | Weighting value(between 0.0 and 1.0). |
result | The result of linear interpolation of the specified vectors as an output parameter. |
Creates a new Vector4 that contains linear interpolation of the specified vectors.
value1 | The first vector. |
value2 | The second vector. |
amount | Weighting value(between 0.0 and 1.0). |
|
inlinestatic |
Creates a new Vector4 that contains linear interpolation of the specified vectors.
Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector4.Lerp(ref Vector4, ref Vector4, float, out Vector4). See remarks section of MathHelper.LerpPrecise on MathHelper for more info.
value1 | The first vector. |
value2 | The second vector. |
amount | Weighting value(between 0.0 and 1.0). |
result | The result of linear interpolation of the specified vectors as an output parameter. |
|
inlinestatic |
Creates a new Vector4 that contains linear interpolation of the specified vectors.
Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector4.Lerp(Vector4, Vector4, float). See remarks section of MathHelper.LerpPrecise on MathHelper for more info.
value1 | The first vector. |
value2 | The second vector. |
amount | Weighting value(between 0.0 and 1.0). |
|
inline |
Turns this Vector4 to a unit vector with the same direction.
Multiplies the components of vector by a scalar.
scaleFactor | Scalar value on the left of the mul sign. |
value | Source Vector4 on the right of the mul sign. |
Multiplies the components of vector by a scalar.
value | Source Vector4 on the left of the mul sign. |
scaleFactor | Scalar value on the right of the mul sign. |
|
inline |
|
inlinestatic |
Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion.
value | Source Vector2. |
rotation | The Quaternion which contains rotation transformation. |
result | Transformed Vector4 as an output parameter. |
|
inlinestatic |
Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion.
value | Source Vector3. |
rotation | The Quaternion which contains rotation transformation. |
result | Transformed Vector4 as an output parameter. |
|
inlinestatic |
Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion.
value | Source Vector4. |
rotation | The Quaternion which contains rotation transformation. |
result | Transformed Vector4 as an output parameter. |
|
inlinestatic |
Creates a new Vector4 that contains a transformation of 2d-vector by the specified Quaternion.
value | Source Vector2. |
rotation | The Quaternion which contains rotation transformation. |
|
inlinestatic |
Creates a new Vector4 that contains a transformation of 3d-vector by the specified Quaternion.
value | Source Vector3. |
rotation | The Quaternion which contains rotation transformation. |
|
inlinestatic |
Creates a new Vector4 that contains a transformation of 4d-vector by the specified Quaternion.
value | Source Vector4. |
rotation | The Quaternion which contains rotation transformation. |
|
inlinestatic |
Apply transformation on vectors within array of Vector4 by the specified Matrix and places the results in an another array.
sourceArray | Source array. |
sourceIndex | The starting index of transformation in the source array. |
matrix | The transformation Matrix. |
destinationArray | Destination array. |
destinationIndex | The starting index in the destination array, where the first Vector4 should be written. |
length | The number of vectors to be transformed. |
|
inlinestatic |
Apply transformation on vectors within array of Vector4 by the specified Quaternion and places the results in an another array.
sourceArray | Source array. |
sourceIndex | The starting index of transformation in the source array. |
rotation | The Quaternion which contains rotation transformation. |
destinationArray | Destination array. |
destinationIndex | The starting index in the destination array, where the first Vector4 should be written. |
length | The number of vectors to be transformed. |
|
inlinestatic |
Apply transformation on all vectors within array of Vector4 by the specified Quaternion and places the results in an another array.
sourceArray | Source array. |
rotation | The Quaternion which contains rotation transformation. |
destinationArray | Destination array. |
float Mathf.Vector4.W |
The w coordinate of this Vector4.
float Mathf.Vector4.X |
The x coordinate of this Vector4.
float Mathf.Vector4.Y |
The y coordinate of this Vector4.
float Mathf.Vector4.Z |
The z coordinate of this Vector4.
|
getpackage |