Struct DoubleVector3
- Namespace
- OmegaEngine.Foundation.Geometry
- Assembly
- OmegaEngine.Foundation.dll
Defines a three-component vector with double accuracy.
[TypeConverter(typeof(DoubleVector3Converter))]
public struct DoubleVector3 : IEquatable<DoubleVector3>
- Implements
- Extension Methods
Constructors
DoubleVector3(double, double, double)
Creates a new vector.
public DoubleVector3(double x, double y, double z)
Parameters
Properties
UnitX
Gets the X unit DoubleVector3 (1, 0, 0).
public static DoubleVector3 UnitX { get; }
Property Value
UnitY
Gets the Y unit DoubleVector3 (0, 1, 0).
public static DoubleVector3 UnitY { get; }
Property Value
UnitZ
Gets the Z unit DoubleVector3 (0, 0, 1).
public static DoubleVector3 UnitZ { get; }
Property Value
X
Gets or sets the X component of the vector.
public double X { readonly get; set; }
Property Value
Y
Gets or sets the Y component of the vector.
public double Y { readonly get; set; }
Property Value
Z
Gets or sets the Z component of the vector.
public double Z { readonly get; set; }
Property Value
Methods
ApplyOffset(DoubleVector3)
Returns a single-precision standard Vector3 after subtracting an offset value
[Pure]
public readonly Vector3 ApplyOffset(DoubleVector3 offset)
Parameters
offsetDoubleVector3This value is subtracting from the double-precision data before it is casted to single-precision
Returns
- Vector3
The relative value
Cross(DoubleVector3, DoubleVector3)
Calculates the cross product of two vectors.
[Pure]
public static DoubleVector3 Cross(DoubleVector3 left, DoubleVector3 right)
Parameters
leftDoubleVector3The first vector to calculate the cross product with.
rightDoubleVector3The second vector to calculate the cross product with.
Returns
Dot(DoubleVector3, DoubleVector3)
Calculates the dot product of two vectors.
[Pure]
public static double Dot(DoubleVector3 left, DoubleVector3 right)
Parameters
leftDoubleVector3The first vector to calculate the dot product with.
rightDoubleVector3The second vector to calculate the dot product with.
Returns
Equals(DoubleVector3)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(DoubleVector3 other)
Parameters
otherDoubleVector3An object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Length()
Calculates the length of the vector.
[Pure]
public readonly double Length()
Returns
LengthSquared()
Calculates the squared length of the vector.
[Pure]
public readonly double LengthSquared()
Returns
Remarks
Cheaper than Length() since it avoids a square root; sufficient for comparing distances.
Lerp(DoubleVector3, DoubleVector3, double)
Linearly interpolates between two vectors.
public static DoubleVector3 Lerp(DoubleVector3 start, DoubleVector3 end, double amount)
Parameters
startDoubleVector3The start vector.
endDoubleVector3The end vector.
amountdoubleThe interpolation factor. Typically in the range 0-1. Values outside this range will extrapolate.
Returns
Normalize()
Returns a copy of the vector scaled to a length of 1.
[Pure]
public readonly DoubleVector3 Normalize()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.
Transform(DoubleVector3, Quaternion)
Rotates vector by a SlimDX.Quaternion.
[Pure]
public static DoubleVector3 Transform(DoubleVector3 vector, Quaternion rotation)
Parameters
vectorDoubleVector3The vector to rotate.
rotationQuaternionThe rotation to apply. Should be normalized.
Returns
TransformNormal(DoubleVector3, Matrix)
Applies the rotation and scaling of transformation to normal in double precision, ignoring its translation.
[Pure]
public static DoubleVector3 TransformNormal(DoubleVector3 normal, Matrix transformation)
Parameters
normalDoubleVector3The vector to transform.
transformationMatrixThe transformation matrix to apply.
Returns
Remarks
Avoids cutting large vectors down to single precision before transforming them.
Operators
operator +(DoubleVector3, DoubleVector3)
Add DoubleVector3 to DoubleVector3
public static DoubleVector3 operator +(DoubleVector3 vector1, DoubleVector3 vector2)
Parameters
vector1DoubleVector3vector2DoubleVector3
Returns
operator +(DoubleVector3, Vector3)
Add DoubleVector3 to SlimDX.Vector3
public static DoubleVector3 operator +(DoubleVector3 vector1, Vector3 vector2)
Parameters
vector1DoubleVector3vector2Vector3
Returns
operator +(Vector3, DoubleVector3)
Add SlimDX.Vector3 to DoubleVector3
public static DoubleVector3 operator +(Vector3 vector1, DoubleVector3 vector2)
Parameters
vector1Vector3vector2DoubleVector3
Returns
operator /(DoubleVector3, double)
Divide DoubleVector3 with double
public static DoubleVector3 operator /(DoubleVector3 vector, double scalar)
Parameters
vectorDoubleVector3scalardouble
Returns
operator /(DoubleVector3, float)
Divide DoubleVector3 with float
public static DoubleVector3 operator /(DoubleVector3 vector, float scalar)
Parameters
vectorDoubleVector3scalarfloat
Returns
operator ==(DoubleVector3, DoubleVector3)
public static bool operator ==(DoubleVector3 left, DoubleVector3 right)
Parameters
leftDoubleVector3rightDoubleVector3
Returns
explicit operator Vector3(DoubleVector3)
Convert DoubleVector3 into SlimDX.Vector3
public static explicit operator Vector3(DoubleVector3 vector)
Parameters
vectorDoubleVector3
Returns
- Vector3
explicit operator DoubleVector3(Vector3)
Convert SlimDX.Vector3 into DoubleVector3
public static explicit operator DoubleVector3(Vector3 vector)
Parameters
vectorVector3
Returns
operator !=(DoubleVector3, DoubleVector3)
public static bool operator !=(DoubleVector3 left, DoubleVector3 right)
Parameters
leftDoubleVector3rightDoubleVector3
Returns
operator *(DoubleVector3, double)
Multiply DoubleVector3 with double
public static DoubleVector3 operator *(DoubleVector3 vector, double scalar)
Parameters
vectorDoubleVector3scalardouble
Returns
operator *(DoubleVector3, float)
Multiply DoubleVector3 with float
public static DoubleVector3 operator *(DoubleVector3 vector, float scalar)
Parameters
vectorDoubleVector3scalarfloat
Returns
operator *(double, DoubleVector3)
Multiply DoubleVector3 with double
public static DoubleVector3 operator *(double scalar, DoubleVector3 vector)
Parameters
scalardoublevectorDoubleVector3
Returns
operator *(float, DoubleVector3)
Multiply DoubleVector3 with float
public static DoubleVector3 operator *(float scalar, DoubleVector3 vector)
Parameters
scalarfloatvectorDoubleVector3
Returns
operator -(DoubleVector3, DoubleVector3)
Subtract DoubleVector3 from DoubleVector3
public static DoubleVector3 operator -(DoubleVector3 vector1, DoubleVector3 vector2)
Parameters
vector1DoubleVector3vector2DoubleVector3
Returns
operator -(DoubleVector3, Vector3)
Subtract SlimDX.Vector3 from DoubleVector3
public static DoubleVector3 operator -(DoubleVector3 vector1, Vector3 vector2)
Parameters
vector1DoubleVector3vector2Vector3
Returns
operator -(Vector3, DoubleVector3)
Subtract DoubleVector3 from SlimDX.Vector3
public static DoubleVector3 operator -(Vector3 vector1, DoubleVector3 vector2)
Parameters
vector1Vector3vector2DoubleVector3
Returns
operator -(DoubleVector3)
Negates DoubleVector3
public static DoubleVector3 operator -(DoubleVector3 v)
Parameters
Returns
operator +(DoubleVector3)
Leaves DoubleVector3 unchanged
public static DoubleVector3 operator +(DoubleVector3 v)