Class Float4
Represents a four dimensional mathematical vector with 32-bit precision (per-component).
Inheritance
Implements
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class Float4 : ValueType, IEquatable<Float4>, IFormattable
Constructors
Float4(Float2, Single, Single)
Initializes a new instance of the Float4 struct.
Declaration
public Float4(Float2 value, float z, float w)
Parameters
|
Float2
value
A vector containing the values with which to initialize the X and Y components. |
|
System.Single
z
Initial value for the Z component of the vector. |
|
System.Single
w
Initial value for the W component of the vector. |
Float4(Float3, Single)
Initializes a new instance of the Float4 struct.
Declaration
public Float4(Float3 value, float w)
Parameters
|
Float3
value
A vector containing the values with which to initialize the X, Y, and Z components. |
|
System.Single
w
Initial value for the W component of the vector. |
Float4(Float4, Float4)
Initializes a new instance of the Float4 struct.
Declaration
public Float4(Float4 xy, Float4 zw)
Parameters
|
Float4
xy
A vector containing the values with which to initialize the X and Y components. |
|
Float4
zw
A vector containing the values with which to initialize the Z and W components. |
Float4(Single)
Initializes a new instance of the Float4 struct.
Declaration
public Float4(float value)
Parameters
|
System.Single
value
The value that will be assigned to all components. |
Float4(Single, Single, Single, Single)
Initializes a new instance of the Float4 struct.
Declaration
public Float4(float x, float y, float z, float w)
Parameters
|
System.Single
x
Initial value for the X component of the vector. |
|
System.Single
y
Initial value for the Y component of the vector. |
|
System.Single
z
Initial value for the Z component of the vector. |
|
System.Single
w
Initial value for the W component of the vector. |
Float4(Single[])
Initializes a new instance of the Float4 struct.
Declaration
public Float4(float[] values)
Parameters
|
System.Single[]
values
The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements. |
Exceptions
|
System.ArgumentNullException
Thrown when |
|
System.ArgumentOutOfRangeException
Thrown when |
Fields
Half
A Float4 with all of its components set to half.
Declaration
public static readonly Float4 Half
Field Value
|
Float4
|
Maximum
A Float4 with all components equal to System.Single.MaxValue.
Declaration
public static readonly Float4 Maximum
Field Value
|
Float4
|
Minimum
A Float4 with all components equal to System.Single.MinValue.
Declaration
public static readonly Float4 Minimum
Field Value
|
Float4
|
One
A Float4 with all of its components set to one.
Declaration
public static readonly Float4 One
Field Value
|
Float4
|
SizeInBytes
The size of the Float4 type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
|
System.Int32
|
UnitW
UnitX
UnitY
UnitZ
W
The W component.
Declaration
public float W
Field Value
|
System.Single
|
X
The X component.
Declaration
public float X
Field Value
|
System.Single
|
Y
The Y component.
Declaration
public float Y
Field Value
|
System.Single
|
Z
The Z component.
Declaration
public float Z
Field Value
|
System.Single
|
Zero
A Float4 with all of its components set to zero.
Declaration
public static readonly Float4 Zero
Field Value
|
Float4
|
Properties
Absolute
Gets a vector with values being absolute values of that vector.
Declaration
public Float4 Absolute { get; }
Property Value
|
Float4
|
AvgValue
Gets an arithmetic average value of all vector components.
Declaration
public float AvgValue { get; }
Property Value
|
System.Single
|
Default
IsNormalized
Gets a value indicting whether this instance is normalized.
Declaration
public bool IsNormalized { get; }
Property Value
|
System.Boolean
|
IsOne
Gets a value indicting whether this vector is one
Declaration
public bool IsOne { get; }
Property Value
|
System.Boolean
|
IsZero
Gets a value indicting whether this vector is zero
Declaration
public bool IsZero { get; }
Property Value
|
System.Boolean
|
Item[Int32]
Gets or sets the component at the specified index.
Declaration
public float this[int index] { get; set; }
Parameters
|
System.Int32
index
The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component. |
Property Value
|
System.Single
The value of the X, Y, Z, or W component, depending on the index. |
Exceptions
|
System.ArgumentOutOfRangeException
Thrown when the |
Length
Calculates the length of the vector.
Declaration
public float Length { get; }
Property Value
|
System.Single
The length of the vector. |
Remarks
LengthSquared may be preferred when only the relative length is needed and speed is of the essence.
LengthSquared
Calculates the squared length of the vector.
Declaration
public float LengthSquared { get; }
Property Value
|
System.Single
The squared length of the vector. |
Remarks
This method may be preferred to Length when only a relative length is needed and speed is of the essence.
MaxValue
Gets a maximum component value
Declaration
public float MaxValue { get; }
Property Value
|
System.Single
|
MinValue
Gets a minimum component value
Declaration
public float MinValue { get; }
Property Value
|
System.Single
|
Negative
Gets a vector with values being opposite to values of that vector.
Declaration
public Float4 Negative { get; }
Property Value
|
Float4
|
ValuesSum
Gets a sum of the component values.
Declaration
public float ValuesSum { get; }
Property Value
|
System.Single
|
Methods
Abs(Float4)
Returns the absolute value of a vector.
Declaration
public static Float4 Abs(Float4 v)
Parameters
|
Float4
v
The value. |
Returns
|
Float4
A vector which components are less or equal to 0. |
Add(Float4, Float4)
Adds two vectors.
Declaration
public static Float4 Add(Float4 left, Float4 right)
Parameters
|
Float4
left
The first vector to add. |
|
Float4
right
The second vector to add. |
Returns
|
Float4
The sum of the two vectors. |
Add(Float4, Single)
Performs a component-wise addition.
Declaration
public static Float4 Add(Float4 left, float right)
Parameters
|
Float4
left
The input vector |
|
System.Single
right
The scalar value to be added to elements |
Returns
|
Float4
The vector with added scalar for each element. |
Add(ref Float4, ref Float4, out Float4)
Adds two vectors.
Declaration
public static void Add(ref Float4 left, ref Float4 right, out Float4 result)
Parameters
|
Float4
left
The first vector to add. |
|
Float4
right
The second vector to add. |
|
Float4
result
When the method completes, contains the sum of the two vectors. |
Add(ref Float4, ref Single, out Float4)
Performs a component-wise addition.
Declaration
public static void Add(ref Float4 left, ref float right, out Float4 result)
Parameters
|
Float4
left
The input vector |
|
System.Single
right
The scalar value to be added to elements |
|
Float4
result
The vector with added scalar for each element. |
Barycentric(Float4, Float4, Float4, Single, Single)
Returns a Float4 containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 4D triangle.
Declaration
public static Float4 Barycentric(Float4 value1, Float4 value2, Float4 value3, float amount1, float amount2)
Parameters
|
Float4
value1
A Float4 containing the 4D Cartesian coordinates of vertex 1 of the triangle. |
|
Float4
value2
A Float4 containing the 4D Cartesian coordinates of vertex 2 of the triangle. |
|
Float4
value3
A Float4 containing the 4D Cartesian coordinates of vertex 3 of the triangle. |
|
System.Single
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in |
|
System.Single
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in |
Returns
|
Float4
A new Float4 containing the 4D Cartesian coordinates of the specified point. |
Barycentric(ref Float4, ref Float4, ref Float4, Single, Single, out Float4)
Returns a Float4 containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 4D triangle.
Declaration
public static void Barycentric(ref Float4 value1, ref Float4 value2, ref Float4 value3, float amount1, float amount2, out Float4 result)
Parameters
|
Float4
value1
A Float4 containing the 4D Cartesian coordinates of vertex 1 of the triangle. |
|
Float4
value2
A Float4 containing the 4D Cartesian coordinates of vertex 2 of the triangle. |
|
Float4
value3
A Float4 containing the 4D Cartesian coordinates of vertex 3 of the triangle. |
|
System.Single
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in |
|
System.Single
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in |
|
Float4
result
When the method completes, contains the 4D Cartesian coordinates of the specified point. |
CatmullRom(Float4, Float4, Float4, Float4, Single)
Performs a Catmull-Rom interpolation using the specified positions.
Declaration
public static Float4 CatmullRom(Float4 value1, Float4 value2, Float4 value3, Float4 value4, float amount)
Parameters
|
Float4
value1
The first position in the interpolation. |
|
Float4
value2
The second position in the interpolation. |
|
Float4
value3
The third position in the interpolation. |
|
Float4
value4
The fourth position in the interpolation. |
|
System.Single
amount
Weighting factor. |
Returns
|
Float4
A vector that is the result of the Catmull-Rom interpolation. |
CatmullRom(ref Float4, ref Float4, ref Float4, ref Float4, Single, out Float4)
Performs a Catmull-Rom interpolation using the specified positions.
Declaration
public static void CatmullRom(ref Float4 value1, ref Float4 value2, ref Float4 value3, ref Float4 value4, float amount, out Float4 result)
Parameters
|
Float4
value1
The first position in the interpolation. |
|
Float4
value2
The second position in the interpolation. |
|
Float4
value3
The third position in the interpolation. |
|
Float4
value4
The fourth position in the interpolation. |
|
System.Single
amount
Weighting factor. |
|
Float4
result
When the method completes, contains the result of the Catmull-Rom interpolation. |
Clamp(Float4, Float4, Float4)
Restricts a value to be within a specified range.
Declaration
public static Float4 Clamp(Float4 value, Float4 min, Float4 max)
Parameters
|
Float4
value
The value to clamp. |
|
Float4
min
The minimum value. |
|
Float4
max
The maximum value. |
Returns
|
Float4
The clamped value. |
Clamp(ref Float4, ref Float4, ref Float4, out Float4)
Restricts a value to be within a specified range.
Declaration
public static void Clamp(ref Float4 value, ref Float4 min, ref Float4 max, out Float4 result)
Parameters
|
Float4
value
The value to clamp. |
|
Float4
min
The minimum value. |
|
Float4
max
The maximum value. |
|
Float4
result
When the method completes, contains the clamped value. |
ClampLength(Float4, Single)
Makes sure that Length of the output vector is always below max and above 0.
Declaration
public static Float4 ClampLength(Float4 vector, float max)
Parameters
|
Float4
vector
Input vector. |
|
System.Single
max
Max Length |
Returns
|
Float4
|
ClampLength(Float4, Single, Single)
Makes sure that Length of the output vector is always below max and above min.
Declaration
public static Float4 ClampLength(Float4 vector, float min, float max)
Parameters
|
Float4
vector
Input vector. |
|
System.Single
min
Min Length |
|
System.Single
max
Max Length |
Returns
|
Float4
|
ClampLength(Float4, Single, Single, out Float4)
Makes sure that Length of the output vector is always below max and above min.
Declaration
public static void ClampLength(Float4 vector, float min, float max, out Float4 result)
Parameters
|
Float4
vector
Input vector. |
|
System.Single
min
Min Length |
|
System.Single
max
Max Length |
|
Float4
result
The result vector. |
Distance(Float4, Float4)
Calculates the distance between two vectors.
Declaration
public static float Distance(Float4 value1, Float4 value2)
Parameters
|
Float4
value1
The first vector. |
|
Float4
value2
The second vector. |
Returns
|
System.Single
The distance between the two vectors. |
Remarks
DistanceSquared(Float4, Float4) may be preferred when only the relative distance is needed and speed is of the essence.
Distance(ref Float4, ref Float4, out Single)
Calculates the distance between two vectors.
Declaration
public static void Distance(ref Float4 value1, ref Float4 value2, out float result)
Parameters
|
Float4
value1
The first vector. |
|
Float4
value2
The second vector. |
|
System.Single
result
When the method completes, contains the distance between the two vectors. |
Remarks
DistanceSquared(ref Float4, ref Float4, out Single) may be preferred when only the relative distance is needed and speed is of the essence.
DistanceSquared(Float4, Float4)
Calculates the squared distance between two vectors.
Declaration
public static float DistanceSquared(Float4 value1, Float4 value2)
Parameters
|
Float4
value1
The first vector. |
|
Float4
value2
The second vector. |
Returns
|
System.Single
The squared distance between the two vectors. |
DistanceSquared(ref Float4, ref Float4, out Single)
Calculates the squared distance between two vectors.
Declaration
public static void DistanceSquared(ref Float4 value1, ref Float4 value2, out float result)
Parameters
|
Float4
value1
The first vector. |
|
Float4
value2
The second vector. |
|
System.Single
result
When the method completes, contains the squared distance between the two vectors. |
Divide(Float4, Single)
Scales a vector by the given value.
Declaration
public static Float4 Divide(Float4 value, float scale)
Parameters
|
Float4
value
The vector to scale. |
|
System.Single
scale
The amount by which to scale the vector. |
Returns
|
Float4
The scaled vector. |
Divide(ref Float4, Single, out Float4)
Scales a vector by the given value.
Declaration
public static void Divide(ref Float4 value, float scale, out Float4 result)
Parameters
|
Float4
value
The vector to scale. |
|
System.Single
scale
The amount by which to scale the vector. |
|
Float4
result
When the method completes, contains the scaled vector. |
Divide(Single, Float4)
Scales a vector by the given value.
Declaration
public static Float4 Divide(float scale, Float4 value)
Parameters
|
System.Single
scale
The amount by which to scale the vector. |
|
Float4
value
The vector to scale. |
Returns
|
Float4
The scaled vector. |
Divide(Single, ref Float4, out Float4)
Scales a vector by the given value.
Declaration
public static void Divide(float scale, ref Float4 value, out Float4 result)
Parameters
|
System.Single
scale
The amount by which to scale the vector. |
|
Float4
value
The vector to scale. |
|
Float4
result
When the method completes, contains the scaled vector. |
Dot(Float4, Float4)
Calculates the dot product of two vectors.
Declaration
public static float Dot(Float4 left, Float4 right)
Parameters
|
Float4
left
First source vector. |
|
Float4
right
Second source vector. |
Returns
|
System.Single
The dot product of the two vectors. |
Dot(ref Float4, ref Float4, out Single)
Calculates the dot product of two vectors.
Declaration
public static void Dot(ref Float4 left, ref Float4 right, out float result)
Parameters
|
Float4
left
First source vector |
|
Float4
right
Second source vector. |
|
System.Single
result
When the method completes, contains the dot product of the two vectors. |
Equals(Float4)
Determines whether the specified Float4 is equal to this instance.
Declaration
public bool Equals(Float4 other)
Parameters
|
Float4
other
The Float4 to compare with this instance. |
Returns
|
System.Boolean
|
Equals(ref Float4)
Determines whether the specified Float4 is equal to this instance.
Declaration
public bool Equals(ref Float4 other)
Parameters
|
Float4
other
The Float4 to compare with this instance. |
Returns
|
System.Boolean
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object value)
Parameters
|
System.Object
value
The System.Object to compare with this instance. |
Returns
|
System.Boolean
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
|
System.Int32
|
Hermite(Float4, Float4, Float4, Float4, Single)
Performs a Hermite spline interpolation.
Declaration
public static Float4 Hermite(Float4 value1, Float4 tangent1, Float4 value2, Float4 tangent2, float amount)
Parameters
|
Float4
value1
First source position vector. |
|
Float4
tangent1
First source tangent vector. |
|
Float4
value2
Second source position vector. |
|
Float4
tangent2
Second source tangent vector. |
|
System.Single
amount
Weighting factor. |
Returns
|
Float4
The result of the Hermite spline interpolation. |
Hermite(ref Float4, ref Float4, ref Float4, ref Float4, Single, out Float4)
Performs a Hermite spline interpolation.
Declaration
public static void Hermite(ref Float4 value1, ref Float4 tangent1, ref Float4 value2, ref Float4 tangent2, float amount, out Float4 result)
Parameters
|
Float4
value1
First source position vector. |
|
Float4
tangent1
First source tangent vector. |
|
Float4
value2
Second source position vector. |
|
Float4
tangent2
Second source tangent vector. |
|
System.Single
amount
Weighting factor. |
|
Float4
result
When the method completes, contains the result of the Hermite spline interpolation. |
Lerp(Float4, Float4, Single)
Performs a linear interpolation between two vectors.
Declaration
public static Float4 Lerp(Float4 start, Float4 end, float amount)
Parameters
|
Float4
start
Start vector. |
|
Float4
end
End vector. |
|
System.Single
amount
Value between 0 and 1 indicating the weight of |
Returns
|
Float4
The linear interpolation of the two vectors. |
Remarks
Passing amount a value of 0 will cause start to be returned; a value of 1 will cause end to be returned.
Lerp(ref Float4, ref Float4, Single, out Float4)
Performs a linear interpolation between two vectors.
Declaration
public static void Lerp(ref Float4 start, ref Float4 end, float amount, out Float4 result)
Parameters
|
Float4
start
Start vector. |
|
Float4
end
End vector. |
|
System.Single
amount
Value between 0 and 1 indicating the weight of |
|
Float4
result
When the method completes, contains the linear interpolation of the two vectors. |
Remarks
Passing amount a value of 0 will cause start to be returned; a value of 1 will cause end to be returned.
Max(Float4, Float4)
Returns a vector containing the largest components of the specified vectors.
Declaration
public static Float4 Max(Float4 left, Float4 right)
Parameters
|
Float4
left
The first source vector. |
|
Float4
right
The second source vector. |
Returns
|
Float4
A vector containing the largest components of the source vectors. |
Max(ref Float4, ref Float4, out Float4)
Returns a vector containing the largest components of the specified vectors.
Declaration
public static void Max(ref Float4 left, ref Float4 right, out Float4 result)
Parameters
|
Float4
left
The first source vector. |
|
Float4
right
The second source vector. |
|
Float4
result
When the method completes, contains an new vector composed of the largest components of the source vectors. |
Min(Float4, Float4)
Returns a vector containing the smallest components of the specified vectors.
Declaration
public static Float4 Min(Float4 left, Float4 right)
Parameters
|
Float4
left
The first source vector. |
|
Float4
right
The second source vector. |
Returns
|
Float4
A vector containing the smallest components of the source vectors. |
Min(ref Float4, ref Float4, out Float4)
Returns a vector containing the smallest components of the specified vectors.
Declaration
public static void Min(ref Float4 left, ref Float4 right, out Float4 result)
Parameters
|
Float4
left
The first source vector. |
|
Float4
right
The second source vector. |
|
Float4
result
When the method completes, contains an new vector composed of the smallest components of the source vectors. |
Multiply(Float4, Float4)
Multiplies a vector with another by performing component-wise multiplication.
Declaration
public static Float4 Multiply(Float4 left, Float4 right)
Parameters
|
Float4
left
The first vector to multiply. |
|
Float4
right
The second vector to multiply. |
Returns
|
Float4
The multiplied vector. |
Multiply(Float4, Single)
Scales a vector by the given value.
Declaration
public static Float4 Multiply(Float4 value, float scale)
Parameters
|
Float4
value
The vector to scale. |
|
System.Single
scale
The amount by which to scale the vector. |
Returns
|
Float4
The scaled vector. |
Multiply(ref Float4, ref Float4, out Float4)
Multiplies a vector with another by performing component-wise multiplication.
Declaration
public static void Multiply(ref Float4 left, ref Float4 right, out Float4 result)
Parameters
|
Float4
left
The first vector to multiply. |
|
Float4
right
The second vector to multiply. |
|
Float4
result
When the method completes, contains the multiplied vector. |
Multiply(ref Float4, Single, out Float4)
Scales a vector by the given value.
Declaration
public static void Multiply(ref Float4 value, float scale, out Float4 result)
Parameters
|
Float4
value
The vector to scale. |
|
System.Single
scale
The amount by which to scale the vector. |
|
Float4
result
When the method completes, contains the scaled vector. |
NearEqual(Float4, Float4, Single)
Tests whether one vector is near another vector.
Declaration
public static bool NearEqual(Float4 left, Float4 right, float epsilon = 1E-06F)
Parameters
|
Float4
left
The left vector. |
|
Float4
right
The right vector. |
|
System.Single
epsilon
The epsilon. |
Returns
|
System.Boolean
|
NearEqual(ref Float4, ref Float4, Single)
Tests whether one vector is near another vector.
Declaration
public static bool NearEqual(ref Float4 left, ref Float4 right, float epsilon = 1E-06F)
Parameters
|
Float4
left
The left vector. |
|
Float4
right
The right vector. |
|
System.Single
epsilon
The epsilon. |
Returns
|
System.Boolean
|
Negate(Float4)
Reverses the direction of a given vector.
Declaration
public static Float4 Negate(Float4 value)
Parameters
|
Float4
value
The vector to negate. |
Returns
|
Float4
A vector facing in the opposite direction. |
Negate(ref Float4, out Float4)
Reverses the direction of a given vector.
Declaration
public static void Negate(ref Float4 value, out Float4 result)
Parameters
|
Float4
value
The vector to negate. |
|
Float4
result
When the method completes, contains a vector facing in the opposite direction. |
Normalize()
Converts the vector into a unit vector.
Declaration
public void Normalize()
Normalize(Float4)
Converts the vector into a unit vector.
Declaration
public static Float4 Normalize(Float4 value)
Parameters
|
Float4
value
The vector to normalize. |
Returns
|
Float4
The normalized vector. |
Normalize(ref Float4, out Float4)
Converts the vector into a unit vector.
Declaration
public static void Normalize(ref Float4 value, out Float4 result)
Parameters
|
Float4
value
The vector to normalize. |
|
Float4
result
When the method completes, contains the normalized vector. |
SmoothStep(Float4, Float4, Single)
Performs a cubic interpolation between two vectors.
Declaration
public static Float4 SmoothStep(Float4 start, Float4 end, float amount)
Parameters
|
Float4
start
Start vector. |
|
Float4
end
End vector. |
|
System.Single
amount
Value between 0 and 1 indicating the weight of |
Returns
|
Float4
The cubic interpolation of the two vectors. |
SmoothStep(ref Float4, ref Float4, Single, out Float4)
Performs a cubic interpolation between two vectors.
Declaration
public static void SmoothStep(ref Float4 start, ref Float4 end, float amount, out Float4 result)
Parameters
|
Float4
start
Start vector. |
|
Float4
end
End vector. |
|
System.Single
amount
Value between 0 and 1 indicating the weight of |
|
Float4
result
When the method completes, contains the cubic interpolation of the two vectors. |
Subtract(Float4, Float4)
Subtracts two vectors.
Declaration
public static Float4 Subtract(Float4 left, Float4 right)
Parameters
|
Float4
left
The first vector to subtract. |
|
Float4
right
The second vector to subtract. |
Returns
|
Float4
The difference of the two vectors. |
Subtract(Float4, Single)
Performs a component-wise subtraction.
Declaration
public static Float4 Subtract(Float4 left, float right)
Parameters
|
Float4
left
The input vector |
|
System.Single
right
The scalar value to be subtracted from elements |
Returns
|
Float4
The vector with subtracted scalar for each element. |
Subtract(ref Float4, ref Float4, out Float4)
Subtracts two vectors.
Declaration
public static void Subtract(ref Float4 left, ref Float4 right, out Float4 result)
Parameters
|
Float4
left
The first vector to subtract. |
|
Float4
right
The second vector to subtract. |
|
Float4
result
When the method completes, contains the difference of the two vectors. |
Subtract(ref Float4, ref Single, out Float4)
Performs a component-wise subtraction.
Declaration
public static void Subtract(ref Float4 left, ref float right, out Float4 result)
Parameters
|
Float4
left
The input vector |
|
System.Single
right
The scalar value to be subtracted from elements |
|
Float4
result
The vector with subtracted scalar for each element. |
Subtract(Single, Float4)
Performs a component-wise subtraction.
Declaration
public static Float4 Subtract(float left, Float4 right)
Parameters
|
System.Single
left
The scalar value to be subtracted from elements |
|
Float4
right
The input vector. |
Returns
|
Float4
The vector with subtracted scalar for each element. |
Subtract(ref Single, ref Float4, out Float4)
Performs a component-wise subtraction.
Declaration
public static void Subtract(ref float left, ref Float4 right, out Float4 result)
Parameters
|
System.Single
left
The scalar value to be subtracted from elements |
|
Float4
right
The input vector. |
|
Float4
result
The vector with subtracted scalar for each element. |
ToArray()
Creates an array containing the elements of the vector.
Declaration
public float[] ToArray()
Returns
|
System.Single[]
A four-element array containing the components of the vector. |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
|
System.String
A System.String that represents this instance. |
ToString(IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
|
System.IFormatProvider
formatProvider
The format provider. |
Returns
|
System.String
A System.String that represents this instance. |
ToString(String)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format)
Parameters
|
System.String
format
The format. |
Returns
|
System.String
A System.String that represents this instance. |
ToString(String, IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
|
System.String
format
The format. |
|
System.IFormatProvider
formatProvider
The format provider. |
Returns
|
System.String
A System.String that represents this instance. |
Transform(Float4, Matrix)
Transforms a 4D vector by the given Matrix.
Declaration
public static Float4 Transform(Float4 vector, Matrix transform)
Parameters
|
Float4
vector
The source vector. |
|
Matrix
transform
The transformation Matrix. |
Returns
|
Float4
The transformed Float4. |
Transform(Float4, Quaternion)
Transforms a 4D vector by the given Quaternion rotation.
Declaration
public static Float4 Transform(Float4 vector, Quaternion rotation)
Parameters
|
Float4
vector
The vector to rotate. |
|
Quaternion
rotation
The Quaternion rotation to apply. |
Returns
|
Float4
The transformed Float4. |
Transform(ref Float4, ref Matrix, out Float4)
Transforms a 4D vector by the given Matrix.
Declaration
public static void Transform(ref Float4 vector, ref Matrix transform, out Float4 result)
Parameters
|
Float4
vector
The source vector. |
|
Matrix
transform
The transformation Matrix. |
|
Float4
result
When the method completes, contains the transformed Float4. |
Transform(ref Float4, ref Quaternion, out Float4)
Transforms a 4D vector by the given Quaternion rotation.
Declaration
public static void Transform(ref Float4 vector, ref Quaternion rotation, out Float4 result)
Parameters
|
Float4
vector
The vector to rotate. |
|
Quaternion
rotation
The Quaternion rotation to apply. |
|
Float4
result
When the method completes, contains the transformed Float4. |
Operators
Addition(Float4, Float4)
Adds two vectors.
Declaration
public static Float4 operator +(Float4 left, Float4 right)
Parameters
|
Float4
left
The first vector to add. |
|
Float4
right
The second vector to add. |
Returns
|
Float4
The sum of the two vectors. |
Addition(Float4, Single)
Performs a component-wise addition.
Declaration
public static Float4 operator +(Float4 value, float scalar)
Parameters
|
Float4
value
The input vector. |
|
System.Single
scalar
The scalar value to be added on elements |
Returns
|
Float4
The vector with added scalar for each element. |
Addition(Single, Float4)
Performs a component-wise addition.
Declaration
public static Float4 operator +(float scalar, Float4 value)
Parameters
|
System.Single
scalar
The scalar value to be added on elements |
|
Float4
value
The input vector. |
Returns
|
Float4
The vector with added scalar for each element. |
Division(Float4, Float4)
Scales a vector by the given value.
Declaration
public static Float4 operator /(Float4 value, Float4 scale)
Parameters
|
Float4
value
The vector to scale. |
|
Float4
scale
The amount by which to scale the vector. |
Returns
|
Float4
The scaled vector. |
Division(Float4, Double)
Scales a vector by the given value.
Declaration
public static Float4 operator /(Float4 value, double scale)
Parameters
|
Float4
value
The vector to scale. |
|
System.Double
scale
The amount by which to scale the vector. |
Returns
|
Float4
The scaled vector. |
Division(Float4, Single)
Scales a vector by the given value.
Declaration
public static Float4 operator /(Float4 value, float scale)
Parameters
|
Float4
value
The vector to scale. |
|
System.Single
scale
The amount by which to scale the vector. |
Returns
|
Float4
The scaled vector. |
Division(Double, Float4)
Scales a vector by the given value.
Declaration
public static Float4 operator /(double scale, Float4 value)
Parameters
|
System.Double
scale
The amount by which to scale the vector. |
|
Float4
value
The vector to scale. |
Returns
|
Float4
The scaled vector. |
Division(Single, Float4)
Scales a vector by the given value.
Declaration
public static Float4 operator /(float scale, Float4 value)
Parameters
|
System.Single
scale
The amount by which to scale the vector. |
|
Float4
value
The vector to scale. |
Returns
|
Float4
The scaled vector. |
Equality(Float4, Float4)
Tests for equality between two objects.
Declaration
public static bool operator ==(Float4 left, Float4 right)
Parameters
|
Float4
left
The first value to compare. |
|
Float4
right
The second value to compare. |
Returns
|
System.Boolean
|
Explicit(Float4 to Float2)
Declaration
public static explicit operator Float2(Float4 value)
Parameters
|
Float4
value
The value. |
Returns
|
Float2
The result of the conversion. |
Explicit(Float4 to Float3)
Declaration
public static explicit operator Float3(Float4 value)
Parameters
|
Float4
value
The value. |
Returns
|
Float3
The result of the conversion. |
Implicit(Float4 to Double4)
Declaration
public static implicit operator Double4(Float4 value)
Parameters
|
Float4
value
The value. |
Returns
|
Double4
The result of the conversion. |
Implicit(Float4 to Int4)
Declaration
public static implicit operator Int4(Float4 value)
Parameters
|
Float4
value
The value. |
Returns
|
Int4
The result of the conversion. |
Implicit(Float4 to Vector4)
Declaration
public static implicit operator Vector4(Float4 value)
Parameters
|
Float4
value
The value. |
Returns
|
Vector4
The result of the conversion. |
Inequality(Float4, Float4)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Float4 left, Float4 right)
Parameters
|
Float4
left
The first value to compare. |
|
Float4
right
The second value to compare. |
Returns
|
System.Boolean
|
Modulus(Float4, Float4)
Remainder of value divided by scale.
Declaration
public static Float4 operator %(Float4 value, Float4 scale)
Parameters
|
Float4
value
The vector to scale. |
|
Float4
scale
The amount by which to scale the vector. |
Returns
|
Float4
The remained vector. |
Modulus(Float4, Single)
Remainder of value divided by scale.
Declaration
public static Float4 operator %(Float4 value, float scale)
Parameters
|
Float4
value
The vector to scale. |
|
System.Single
scale
The amount by which to scale the vector. |
Returns
|
Float4
The remained vector. |
Modulus(Single, Float4)
Remainder of value divided by scale.
Declaration
public static Float4 operator %(float value, Float4 scale)
Parameters
|
System.Single
value
The amount by which to scale the vector. |
|
Float4
scale
The vector to scale. |
Returns
|
Float4
The remained vector. |
Multiply(Float4, Float4)
Multiplies a vector with another by performing component-wise multiplication equivalent to Multiply(ref Float4, ref Float4, out Float4).
Declaration
public static Float4 operator *(Float4 left, Float4 right)
Parameters
|
Float4
left
The first vector to multiply. |
|
Float4
right
The second vector to multiply. |
Returns
|
Float4
The multiplication of the two vectors. |
Multiply(Float4, Double)
Scales a vector by the given value.
Declaration
public static Float4 operator *(Float4 value, double scale)
Parameters
|
Float4
value
The vector to scale. |
|
System.Double
scale
The amount by which to scale the vector. |
Returns
|
Float4
The scaled vector. |
Multiply(Float4, Single)
Scales a vector by the given value.
Declaration
public static Float4 operator *(Float4 value, float scale)
Parameters
|
Float4
value
The vector to scale. |
|
System.Single
scale
The amount by which to scale the vector. |
Returns
|
Float4
The scaled vector. |
Multiply(Double, Float4)
Scales a vector by the given value.
Declaration
public static Float4 operator *(double scale, Float4 value)
Parameters
|
System.Double
scale
The amount by which to scale the vector. |
|
Float4
value
The vector to scale. |
Returns
|
Float4
The scaled vector. |
Multiply(Single, Float4)
Scales a vector by the given value.
Declaration
public static Float4 operator *(float scale, Float4 value)
Parameters
|
System.Single
scale
The amount by which to scale the vector. |
|
Float4
value
The vector to scale. |
Returns
|
Float4
The scaled vector. |
Subtraction(Float4, Float4)
Subtracts two vectors.
Declaration
public static Float4 operator -(Float4 left, Float4 right)
Parameters
|
Float4
left
The first vector to subtract. |
|
Float4
right
The second vector to subtract. |
Returns
|
Float4
The difference of the two vectors. |
Subtraction(Float4, Single)
Performs a component-wise subtraction.
Declaration
public static Float4 operator -(Float4 value, float scalar)
Parameters
|
Float4
value
The input vector. |
|
System.Single
scalar
The scalar value to be subtracted from elements |
Returns
|
Float4
The vector with subtracted scalar from each element. |
Subtraction(Single, Float4)
Performs a component-wise subtraction.
Declaration
public static Float4 operator -(float scalar, Float4 value)
Parameters
|
System.Single
scalar
The scalar value to be subtracted from elements |
|
Float4
value
The input vector. |
Returns
|
Float4
The vector with subtracted scalar from each element. |
UnaryNegation(Float4)
Reverses the direction of a given vector.
Declaration
public static Float4 operator -(Float4 value)
Parameters
|
Float4
value
The vector to negate. |
Returns
|
Float4
A vector facing in the opposite direction. |
UnaryPlus(Float4)
Assert a vector (return it unchanged).
Declaration
public static Float4 operator +(Float4 value)
Parameters
|
Float4
value
The vector to assert (unchanged). |
Returns
|
Float4
The asserted (unchanged) vector. |