Struct Vector3
Describes a 3D-vector.
[TypeConverter(typeof(Vector3TypeConverter))]
[DataContract]
public struct Vector3 : IEquatable<Vector3>
- Implements
- Inherited Members
Constructors
Vector3(Vector2, float)
Constructs a 3d vector with X, Y from Vector2 and Z from a scalar.
public Vector3(Vector2 value, float z)
Parameters
Vector3(float)
Constructs a 3d vector with X, Y and Z set to the same value.
public Vector3(float value)
Parameters
valuefloatThe x, y and z coordinates in 3d-space.
Vector3(float, float, float)
Constructs a 3d vector with X, Y and Z from three values.
public Vector3(float x, float y, float z)
Parameters
xfloatThe x coordinate in 3d-space.
yfloatThe y coordinate in 3d-space.
zfloatThe z coordinate in 3d-space.
Fields
X
The x coordinate of this Vector3.
[DataMember]
public float X
Field Value
Y
The y coordinate of this Vector3.
[DataMember]
public float Y
Field Value
Z
The z coordinate of this Vector3.
[DataMember]
public float Z
Field Value
Properties
Backward
Returns a Vector3 with components 0, 0, 1.
public static Vector3 Backward { get; }
Property Value
Down
Returns a Vector3 with components 0, -1, 0.
public static Vector3 Down { get; }
Property Value
Forward
Returns a Vector3 with components 0, 0, -1.
public static Vector3 Forward { get; }
Property Value
Left
Returns a Vector3 with components -1, 0, 0.
public static Vector3 Left { get; }
Property Value
One
Returns a Vector3 with components 1, 1, 1.
public static Vector3 One { get; }
Property Value
Right
Returns a Vector3 with components 1, 0, 0.
public static Vector3 Right { get; }
Property Value
UnitX
Returns a Vector3 with components 1, 0, 0.
public static Vector3 UnitX { get; }
Property Value
UnitY
Returns a Vector3 with components 0, 1, 0.
public static Vector3 UnitY { get; }
Property Value
UnitZ
Returns a Vector3 with components 0, 0, 1.
public static Vector3 UnitZ { get; }
Property Value
Up
Returns a Vector3 with components 0, 1, 0.
public static Vector3 Up { get; }
Property Value
Zero
Returns a Vector3 with components 0, 0, 0.
public static Vector3 Zero { get; }
Property Value
Methods
Add(Vector3, Vector3)
Performs vector addition on value1 and value2.
public static Vector3 Add(Vector3 value1, Vector3 value2)
Parameters
Returns
- Vector3
The result of the vector addition.
Add(ref Vector3, ref Vector3, out Vector3)
Performs vector addition on value1 and
value2, storing the result of the
addition in result.
public static void Add(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
Parameters
value1Vector3The first vector to add.
value2Vector3The second vector to add.
resultVector3The result of the vector addition.
Barycentric(Vector3, Vector3, Vector3, float, float)
Creates a new Vector3 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 3d-triangle.
public static Vector3 Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2)
Parameters
value1Vector3The first vector of 3d-triangle.
value2Vector3The second vector of 3d-triangle.
value3Vector3The third vector of 3d-triangle.
amount1floatBarycentric scalar
b2which represents a weighting factor towards second vector of 3d-triangle.amount2floatBarycentric scalar
b3which represents a weighting factor towards third vector of 3d-triangle.
Returns
- Vector3
The cartesian translation of barycentric coordinates.
Barycentric(ref Vector3, ref Vector3, ref Vector3, float, float, out Vector3)
Creates a new Vector3 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 3d-triangle.
public static void Barycentric(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, float amount1, float amount2, out Vector3 result)
Parameters
value1Vector3The first vector of 3d-triangle.
value2Vector3The second vector of 3d-triangle.
value3Vector3The third vector of 3d-triangle.
amount1floatBarycentric scalar
b2which represents a weighting factor towards second vector of 3d-triangle.amount2floatBarycentric scalar
b3which represents a weighting factor towards third vector of 3d-triangle.resultVector3The cartesian translation of barycentric coordinates as an output parameter.
CatmullRom(Vector3, Vector3, Vector3, Vector3, float)
Creates a new Vector3 that contains CatmullRom interpolation of the specified vectors.
public static Vector3 CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount)
Parameters
value1Vector3The first vector in interpolation.
value2Vector3The second vector in interpolation.
value3Vector3The third vector in interpolation.
value4Vector3The fourth vector in interpolation.
amountfloatWeighting factor.
Returns
- Vector3
The result of CatmullRom interpolation.
CatmullRom(ref Vector3, ref Vector3, ref Vector3, ref Vector3, float, out Vector3)
Creates a new Vector3 that contains CatmullRom interpolation of the specified vectors.
public static void CatmullRom(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, ref Vector3 value4, float amount, out Vector3 result)
Parameters
value1Vector3The first vector in interpolation.
value2Vector3The second vector in interpolation.
value3Vector3The third vector in interpolation.
value4Vector3The fourth vector in interpolation.
amountfloatWeighting factor.
resultVector3The result of CatmullRom interpolation as an output parameter.
Ceiling()
Round the members of this Vector3 towards positive infinity.
public void Ceiling()
Ceiling(Vector3)
Creates a new Vector3 that contains members from another vector rounded towards positive infinity.
public static Vector3 Ceiling(Vector3 value)
Parameters
Returns
Ceiling(ref Vector3, out Vector3)
Creates a new Vector3 that contains members from another vector rounded towards positive infinity.
public static void Ceiling(ref Vector3 value, out Vector3 result)
Parameters
Clamp(Vector3, Vector3, Vector3)
Clamps the specified value within a range.
public static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max)
Parameters
Returns
- Vector3
The clamped value.
Clamp(ref Vector3, ref Vector3, ref Vector3, out Vector3)
Clamps the specified value within a range.
public static void Clamp(ref Vector3 value1, ref Vector3 min, ref Vector3 max, out Vector3 result)
Parameters
value1Vector3The value to clamp.
minVector3The min value.
maxVector3The max value.
resultVector3The clamped value as an output parameter.
Cross(Vector3, Vector3)
Computes the cross product of two vectors.
public static Vector3 Cross(Vector3 vector1, Vector3 vector2)
Parameters
Returns
- Vector3
The cross product of two vectors.
Cross(ref Vector3, ref Vector3, out Vector3)
Computes the cross product of two vectors.
public static void Cross(ref Vector3 vector1, ref Vector3 vector2, out Vector3 result)
Parameters
vector1Vector3The first vector.
vector2Vector3The second vector.
resultVector3The cross product of two vectors as an output parameter.
Deconstruct(out float, out float, out float)
Deconstruction method for Vector3.
public void Deconstruct(out float x, out float y, out float z)
Parameters
Distance(Vector3, Vector3)
Returns the distance between two vectors.
public static float Distance(Vector3 value1, Vector3 value2)
Parameters
Returns
- float
The distance between two vectors.
Distance(ref Vector3, ref Vector3, out float)
Returns the distance between two vectors.
public static void Distance(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
resultfloatThe distance between two vectors as an output parameter.
DistanceSquared(Vector3, Vector3)
Returns the squared distance between two vectors.
public static float DistanceSquared(Vector3 value1, Vector3 value2)
Parameters
Returns
- float
The squared distance between two vectors.
DistanceSquared(ref Vector3, ref Vector3, out float)
Returns the squared distance between two vectors.
public static void DistanceSquared(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
resultfloatThe squared distance between two vectors as an output parameter.
Divide(Vector3, Vector3)
public static Vector3 Divide(Vector3 value1, Vector3 value2)
Parameters
Returns
- Vector3
The result of dividing the vectors.
Divide(Vector3, float)
Divides the components of a Vector3 by a scalar.
public static Vector3 Divide(Vector3 value1, float divider)
Parameters
Returns
- Vector3
The result of dividing a vector by a scalar.
Divide(ref Vector3, ref Vector3, out Vector3)
public static void Divide(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
Parameters
value1Vector3Source Vector3.
value2Vector3Divisor Vector3.
resultVector3The result of dividing the vectors as an output parameter.
Divide(ref Vector3, float, out Vector3)
Divides the components of a Vector3 by a scalar.
public static void Divide(ref Vector3 value1, float divider, out Vector3 result)
Parameters
value1Vector3Source Vector3.
dividerfloatDivisor scalar.
resultVector3The result of dividing a vector by a scalar as an output parameter.
Dot(Vector3, Vector3)
Returns a dot product of two vectors.
public static float Dot(Vector3 value1, Vector3 value2)
Parameters
Returns
- float
The dot product of two vectors.
Dot(ref Vector3, ref Vector3, out float)
Returns a dot product of two vectors.
public static void Dot(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
resultfloatThe dot product of two vectors as an output parameter.
Equals(Vector3)
Compares whether current instance is equal to specified Vector3.
public bool Equals(Vector3 other)
Parameters
Returns
- bool
trueif the instances are equal;falseotherwise.
Equals(object)
Compares whether current instance is equal to specified object.
public override bool Equals(object obj)
Parameters
Returns
- bool
trueif the instances are equal;falseotherwise.
Floor()
Round the members of this Vector3 towards negative infinity.
public void Floor()
Floor(Vector3)
Creates a new Vector3 that contains members from another vector rounded towards negative infinity.
public static Vector3 Floor(Vector3 value)
Parameters
Returns
Floor(ref Vector3, out Vector3)
Creates a new Vector3 that contains members from another vector rounded towards negative infinity.
public static void Floor(ref Vector3 value, out Vector3 result)
Parameters
GetHashCode()
Gets the hash code of this Vector3.
public override int GetHashCode()
Returns
Hermite(Vector3, Vector3, Vector3, Vector3, float)
Creates a new Vector3 that contains hermite spline interpolation.
public static Vector3 Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount)
Parameters
value1Vector3The first position vector.
tangent1Vector3The first tangent vector.
value2Vector3The second position vector.
tangent2Vector3The second tangent vector.
amountfloatWeighting factor.
Returns
- Vector3
The hermite spline interpolation vector.
Hermite(ref Vector3, ref Vector3, ref Vector3, ref Vector3, float, out Vector3)
Creates a new Vector3 that contains hermite spline interpolation.
public static void Hermite(ref Vector3 value1, ref Vector3 tangent1, ref Vector3 value2, ref Vector3 tangent2, float amount, out Vector3 result)
Parameters
value1Vector3The first position vector.
tangent1Vector3The first tangent vector.
value2Vector3The second position vector.
tangent2Vector3The second tangent vector.
amountfloatWeighting factor.
resultVector3The hermite spline interpolation vector as an output parameter.
Length()
Returns the length of this Vector3.
public float Length()
Returns
LengthSquared()
Returns the squared length of this Vector3.
public float LengthSquared()
Returns
Lerp(Vector3, Vector3, float)
Creates a new Vector3 that contains linear interpolation of the specified vectors.
public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
amountfloatWeighting value(between 0.0 and 1.0).
Returns
- Vector3
The result of linear interpolation of the specified vectors.
Lerp(ref Vector3, ref Vector3, float, out Vector3)
Creates a new Vector3 that contains linear interpolation of the specified vectors.
public static void Lerp(ref Vector3 value1, ref Vector3 value2, float amount, out Vector3 result)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
amountfloatWeighting value(between 0.0 and 1.0).
resultVector3The result of linear interpolation of the specified vectors as an output parameter.
LerpPrecise(Vector3, Vector3, float)
Creates a new Vector3 that contains linear interpolation of the specified vectors. Uses LerpPrecise(float, float, float) on MathHelper for the interpolation. Less efficient but more precise compared to Lerp(Vector3, Vector3, float). See remarks section of LerpPrecise(float, float, float) on MathHelper for more info.
public static Vector3 LerpPrecise(Vector3 value1, Vector3 value2, float amount)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
amountfloatWeighting value(between 0.0 and 1.0).
Returns
- Vector3
The result of linear interpolation of the specified vectors.
LerpPrecise(ref Vector3, ref Vector3, float, out Vector3)
Creates a new Vector3 that contains linear interpolation of the specified vectors. Uses LerpPrecise(float, float, float) on MathHelper for the interpolation. Less efficient but more precise compared to Lerp(ref Vector3, ref Vector3, float, out Vector3). See remarks section of LerpPrecise(float, float, float) on MathHelper for more info.
public static void LerpPrecise(ref Vector3 value1, ref Vector3 value2, float amount, out Vector3 result)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
amountfloatWeighting value(between 0.0 and 1.0).
resultVector3The result of linear interpolation of the specified vectors as an output parameter.
Max(Vector3, Vector3)
Creates a new Vector3 that contains a maximal values from the two vectors.
public static Vector3 Max(Vector3 value1, Vector3 value2)
Parameters
Returns
Max(ref Vector3, ref Vector3, out Vector3)
Creates a new Vector3 that contains a maximal values from the two vectors.
public static void Max(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
resultVector3The Vector3 with maximal values from the two vectors as an output parameter.
Min(Vector3, Vector3)
Creates a new Vector3 that contains a minimal values from the two vectors.
public static Vector3 Min(Vector3 value1, Vector3 value2)
Parameters
Returns
Min(ref Vector3, ref Vector3, out Vector3)
Creates a new Vector3 that contains a minimal values from the two vectors.
public static void Min(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
Parameters
value1Vector3The first vector.
value2Vector3The second vector.
resultVector3The Vector3 with minimal values from the two vectors as an output parameter.
Multiply(Vector3, Vector3)
Creates a new Vector3 that contains a multiplication of two vectors.
public static Vector3 Multiply(Vector3 value1, Vector3 value2)
Parameters
Returns
- Vector3
The result of the vector multiplication.
Multiply(Vector3, float)
public static Vector3 Multiply(Vector3 value1, float scaleFactor)
Parameters
Returns
- Vector3
The result of the vector multiplication with a scalar.
Multiply(ref Vector3, ref Vector3, out Vector3)
Creates a new Vector3 that contains a multiplication of two vectors.
public static void Multiply(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
Parameters
value1Vector3Source Vector3.
value2Vector3Source Vector3.
resultVector3The result of the vector multiplication as an output parameter.
Multiply(ref Vector3, float, out Vector3)
public static void Multiply(ref Vector3 value1, float scaleFactor, out Vector3 result)
Parameters
value1Vector3Source Vector3.
scaleFactorfloatScalar value.
resultVector3The result of the multiplication with a scalar as an output parameter.
Negate(Vector3)
Creates a new Vector3 that contains the specified vector inversion.
public static Vector3 Negate(Vector3 value)
Parameters
Returns
- Vector3
The result of the vector inversion.
Negate(ref Vector3, out Vector3)
Creates a new Vector3 that contains the specified vector inversion.
public static void Negate(ref Vector3 value, out Vector3 result)
Parameters
valueVector3Source Vector3.
resultVector3The result of the vector inversion as an output parameter.
Normalize()
Turns this Vector3 to a unit vector with the same direction.
public void Normalize()
Normalize(Vector3)
Creates a new Vector3 that contains a normalized values from another vector.
public static Vector3 Normalize(Vector3 value)
Parameters
Returns
- Vector3
Unit vector.
Normalize(ref Vector3, out Vector3)
Creates a new Vector3 that contains a normalized values from another vector.
public static void Normalize(ref Vector3 value, out Vector3 result)
Parameters
Reflect(Vector3, Vector3)
Creates a new Vector3 that contains reflect vector of the given vector and normal.
public static Vector3 Reflect(Vector3 vector, Vector3 normal)
Parameters
Returns
- Vector3
Reflected vector.
Reflect(ref Vector3, ref Vector3, out Vector3)
Creates a new Vector3 that contains reflect vector of the given vector and normal.
public static void Reflect(ref Vector3 vector, ref Vector3 normal, out Vector3 result)
Parameters
vectorVector3Source Vector3.
normalVector3Reflection normal.
resultVector3Reflected vector as an output parameter.
Round()
Round the members of this Vector3 towards the nearest integer value.
public void Round()
Round(Vector3)
Creates a new Vector3 that contains members from another vector rounded to the nearest integer value.
public static Vector3 Round(Vector3 value)
Parameters
Returns
Round(ref Vector3, out Vector3)
Creates a new Vector3 that contains members from another vector rounded to the nearest integer value.
public static void Round(ref Vector3 value, out Vector3 result)
Parameters
SmoothStep(Vector3, Vector3, float)
Creates a new Vector3 that contains cubic interpolation of the specified vectors.
public static Vector3 SmoothStep(Vector3 value1, Vector3 value2, float amount)
Parameters
Returns
- Vector3
Cubic interpolation of the specified vectors.
SmoothStep(ref Vector3, ref Vector3, float, out Vector3)
Creates a new Vector3 that contains cubic interpolation of the specified vectors.
public static void SmoothStep(ref Vector3 value1, ref Vector3 value2, float amount, out Vector3 result)
Parameters
value1Vector3Source Vector3.
value2Vector3Source Vector3.
amountfloatWeighting value.
resultVector3Cubic interpolation of the specified vectors as an output parameter.
Subtract(Vector3, Vector3)
public static Vector3 Subtract(Vector3 value1, Vector3 value2)
Parameters
Returns
- Vector3
The result of the vector subtraction.
Subtract(ref Vector3, ref Vector3, out Vector3)
public static void Subtract(ref Vector3 value1, ref Vector3 value2, out Vector3 result)
Parameters
value1Vector3Source Vector3.
value2Vector3Source Vector3.
resultVector3The result of the vector subtraction as an output parameter.
ToNumerics()
Returns a Vector3.
public Vector3 ToNumerics()
Returns
ToString()
public override string ToString()
Returns
Transform(Vector3, Matrix)
public static Vector3 Transform(Vector3 position, Matrix matrix)
Parameters
Returns
Transform(Vector3, Quaternion)
Creates a new Vector3 that contains a transformation of 3d-vector by the specified Quaternion, representing the rotation.
public static Vector3 Transform(Vector3 value, Quaternion rotation)
Parameters
valueVector3Source Vector3.
rotationQuaternionThe Quaternion which contains rotation transformation.
Returns
Transform(ref Vector3, ref Matrix, out Vector3)
public static void Transform(ref Vector3 position, ref Matrix matrix, out Vector3 result)
Parameters
positionVector3Source Vector3.
matrixMatrixThe transformation Matrix.
resultVector3Transformed Vector3 as an output parameter.
Transform(ref Vector3, ref Quaternion, out Vector3)
Creates a new Vector3 that contains a transformation of 3d-vector by the specified Quaternion, representing the rotation.
public static void Transform(ref Vector3 value, ref Quaternion rotation, out Vector3 result)
Parameters
valueVector3Source Vector3.
rotationQuaternionThe Quaternion which contains rotation transformation.
resultVector3Transformed Vector3 as an output parameter.
Transform(Vector3[], ref Matrix, Vector3[])
Apply transformation on all vectors within array of Vector3 by the specified Matrix and places the results in an another array.
public static void Transform(Vector3[] sourceArray, ref Matrix matrix, Vector3[] destinationArray)
Parameters
sourceArrayVector3[]Source array.
matrixMatrixThe transformation Matrix.
destinationArrayVector3[]Destination array.
Transform(Vector3[], ref Quaternion, Vector3[])
Apply transformation on all vectors within array of Vector3 by the specified Quaternion and places the results in an another array.
public static void Transform(Vector3[] sourceArray, ref Quaternion rotation, Vector3[] destinationArray)
Parameters
sourceArrayVector3[]Source array.
rotationQuaternionThe Quaternion which contains rotation transformation.
destinationArrayVector3[]Destination array.
Transform(Vector3[], int, ref Matrix, Vector3[], int, int)
Apply transformation on vectors within array of Vector3 by the specified Matrix and places the results in an another array.
public static void Transform(Vector3[] sourceArray, int sourceIndex, ref Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
Parameters
sourceArrayVector3[]Source array.
sourceIndexintThe starting index of transformation in the source array.
matrixMatrixThe transformation Matrix.
destinationArrayVector3[]Destination array.
destinationIndexintThe starting index in the destination array, where the first Vector3 should be written.
lengthintThe number of vectors to be transformed.
Transform(Vector3[], int, ref Quaternion, Vector3[], int, int)
Apply transformation on vectors within array of Vector3 by the specified Quaternion and places the results in an another array.
public static void Transform(Vector3[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector3[] destinationArray, int destinationIndex, int length)
Parameters
sourceArrayVector3[]Source array.
sourceIndexintThe starting index of transformation in the source array.
rotationQuaternionThe Quaternion which contains rotation transformation.
destinationArrayVector3[]Destination array.
destinationIndexintThe starting index in the destination array, where the first Vector3 should be written.
lengthintThe number of vectors to be transformed.
TransformNormal(Vector3, Matrix)
Creates a new Vector3 that contains a transformation of the specified normal by the specified Matrix.
public static Vector3 TransformNormal(Vector3 normal, Matrix matrix)
Parameters
normalVector3Source Vector3 which represents a normal vector.
matrixMatrixThe transformation Matrix.
Returns
- Vector3
Transformed normal.
TransformNormal(ref Vector3, ref Matrix, out Vector3)
Creates a new Vector3 that contains a transformation of the specified normal by the specified Matrix.
public static void TransformNormal(ref Vector3 normal, ref Matrix matrix, out Vector3 result)
Parameters
normalVector3Source Vector3 which represents a normal vector.
matrixMatrixThe transformation Matrix.
resultVector3Transformed normal as an output parameter.
TransformNormal(Vector3[], ref Matrix, Vector3[])
Apply transformation on all normals within array of Vector3 by the specified Matrix and places the results in an another array.
public static void TransformNormal(Vector3[] sourceArray, ref Matrix matrix, Vector3[] destinationArray)
Parameters
sourceArrayVector3[]Source array.
matrixMatrixThe transformation Matrix.
destinationArrayVector3[]Destination array.
TransformNormal(Vector3[], int, ref Matrix, Vector3[], int, int)
Apply transformation on normals within array of Vector3 by the specified Matrix and places the results in an another array.
public static void TransformNormal(Vector3[] sourceArray, int sourceIndex, ref Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
Parameters
sourceArrayVector3[]Source array.
sourceIndexintThe starting index of transformation in the source array.
matrixMatrixThe transformation Matrix.
destinationArrayVector3[]Destination array.
destinationIndexintThe starting index in the destination array, where the first Vector3 should be written.
lengthintThe number of normals to be transformed.
Operators
operator +(Vector3, Vector3)
Adds two vectors.
public static Vector3 operator +(Vector3 value1, Vector3 value2)
Parameters
value1Vector3Source Vector3 on the left of the add sign.
value2Vector3Source Vector3 on the right of the add sign.
Returns
- Vector3
Sum of the vectors.
operator /(Vector3, Vector3)
public static Vector3 operator /(Vector3 value1, Vector3 value2)
Parameters
value1Vector3Source Vector3 on the left of the div sign.
value2Vector3Divisor Vector3 on the right of the div sign.
Returns
- Vector3
The result of dividing the vectors.
operator /(Vector3, float)
Divides the components of a Vector3 by a scalar.
public static Vector3 operator /(Vector3 value1, float divider)
Parameters
value1Vector3Source Vector3 on the left of the div sign.
dividerfloatDivisor scalar on the right of the div sign.
Returns
- Vector3
The result of dividing a vector by a scalar.
operator ==(Vector3, Vector3)
Compares whether two Vector3 instances are equal.
public static bool operator ==(Vector3 value1, Vector3 value2)
Parameters
value1Vector3Vector3 instance on the left of the equal sign.
value2Vector3Vector3 instance on the right of the equal sign.
Returns
- bool
trueif the instances are equal;falseotherwise.
implicit operator Vector3(Vector3)
public static implicit operator Vector3(Vector3 value)
Parameters
valueVector3The converted value.
Returns
operator !=(Vector3, Vector3)
Compares whether two Vector3 instances are not equal.
public static bool operator !=(Vector3 value1, Vector3 value2)
Parameters
value1Vector3Vector3 instance on the left of the not equal sign.
value2Vector3Vector3 instance on the right of the not equal sign.
Returns
- bool
trueif the instances are not equal;falseotherwise.
operator *(Vector3, Vector3)
Multiplies the components of two vectors by each other.
public static Vector3 operator *(Vector3 value1, Vector3 value2)
Parameters
value1Vector3Source Vector3 on the left of the mul sign.
value2Vector3Source Vector3 on the right of the mul sign.
Returns
- Vector3
Result of the vector multiplication.
operator *(Vector3, float)
Multiplies the components of vector by a scalar.
public static Vector3 operator *(Vector3 value, float scaleFactor)
Parameters
valueVector3Source Vector3 on the left of the mul sign.
scaleFactorfloatScalar value on the right of the mul sign.
Returns
- Vector3
Result of the vector multiplication with a scalar.
operator *(float, Vector3)
Multiplies the components of vector by a scalar.
public static Vector3 operator *(float scaleFactor, Vector3 value)
Parameters
scaleFactorfloatScalar value on the left of the mul sign.
valueVector3Source Vector3 on the right of the mul sign.
Returns
- Vector3
Result of the vector multiplication with a scalar.
operator -(Vector3, Vector3)
public static Vector3 operator -(Vector3 value1, Vector3 value2)
Parameters
value1Vector3Source Vector3 on the left of the sub sign.
value2Vector3Source Vector3 on the right of the sub sign.
Returns
- Vector3
Result of the vector subtraction.
operator -(Vector3)
Inverts values in the specified Vector3.
public static Vector3 operator -(Vector3 value)
Parameters
Returns
- Vector3
Result of the inversion.