-
Notifications
You must be signed in to change notification settings - Fork 124
VRageMath.Vector3D
← Index ← Namespace Index
public struct Vector3D: IEquatable<Vector3D>
Defines a vector with three components. Vector3 with double floating point precision
Namespace: VRageMath
Assembly: VRage.Math.dll
Implements:
static Vector3D NegativeInfinity
static Vector3D PositiveInfinity
Gets or sets the x-component of the vector.
Gets or sets the y-component of the vector.
Gets or sets the z-component of the vector.
Vector3D(double x, double y, double z)
Vector3D(Vector2 value, double z)
Vector3D(Vector2D value, double z)
static void Abs(ref Vector3D vector3D, out Vector3D abs)
static Vector3D Abs(Vector3D value)
static Vector3D Add(Vector3D value1, Vector3D value2)
Adds two vectors.
static void Add(ref Vector3D value1, ref Vector3D value2, out Vector3D result)
Adds two vectors.
static double Angle(Vector3D a, Vector3D b)
Gets angle between 2 vectors in radians
static bool ArePerpendicular(ref Vector3D a, ref Vector3D b)
Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 3D triangle.
Compute barycentric coordinates (u, v, w) for point p with respect to triangle (a, b, c) From : Real-Time Collision Detection, Christer Ericson, CRC Press 3.4 Barycentric Coordinates
static Vector3D CalculatePerpendicularVector(Vector3D v)
Performs a Catmull-Rom interpolation using the specified positions.
Performs a Catmull-Rom interpolation using the specified positions.
static Vector3D Clamp(Vector3D value1, Vector3D min, Vector3D max)
Restricts a value to be within a specified range.
static void Clamp(ref Vector3D value1, ref Vector3D min, ref Vector3D max, out Vector3D result)
Restricts a value to be within a specified range.
static Vector3D ClampToSphere(Vector3D vector, double radius, bool force = default)
static void ClampToSphere(ref Vector3D vector, double radius)
static void CreateFromAzimuthAndElevation(double azimuth, double elevation, out Vector3D direction)
static Vector3D Cross(Vector3D vector1, Vector3D vector2)
Calculates the cross product of two vectors.
static void Cross(ref Vector3D vector1, ref Vector3D vector2, out Vector3D result)
Calculates the cross product of two vectors.
static double Distance(Vector3D value1, Vector3D value2)
Calculates the distance between two vectors.
static double Distance(Vector3D value1, Vector3 value2)
static double Distance(Vector3 value1, Vector3D value2)
static void Distance(ref Vector3D value1, ref Vector3D value2, out double result)
Calculates the distance between two vectors.
static double DistanceSquared(Vector3D value1, Vector3D value2)
Calculates the distance between two vectors squared.
static void DistanceSquared(ref Vector3D value1, ref Vector3D value2, out double result)
Calculates the distance between two vectors squared.
static Vector3D Divide(Vector3D value1, Vector3D value2)
Divides the components of a vector by the components of another vector.
static void Divide(ref Vector3D value1, ref Vector3D value2, out Vector3D result)
Divides the components of a vector by the components of another vector.
static Vector3D Divide(Vector3D value1, double value2)
Divides a vector by a scalar value.
static void Divide(ref Vector3D value1, double value2, out Vector3D result)
Divides a vector by a scalar value.
static Vector3D DominantAxisProjection(Vector3D value1)
Returns a vector that is equal to the projection of the input vector to the coordinate axis that corresponds to the original vector's largest value.
static void DominantAxisProjection(ref Vector3D value1, out Vector3D result)
Calculates a vector that is equal to the projection of the input vector to the coordinate axis that corresponds to the original vector's largest value. The result is saved into a user-specified variable.
static double Dot(Vector3D vector1, Vector3D vector2)
Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a doubleing point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
static double Dot(Vector3D vector1, Vector3 vector2)
static void Dot(ref Vector3D vector1, ref Vector3D vector2, out double result)
Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a doubleing point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
static void Dot(ref Vector3D vector1, ref Vector3 vector2, out double result)
static void Dot(ref Vector3 vector1, ref Vector3D vector2, out double result)
static Vector3I Floor(Vector3D vect3d)
static void Fract(ref Vector3D o, out Vector3D r)
static void GetAzimuthAndElevation(Vector3D v, out double azimuth, out double elevation)
Performs a Hermite spline interpolation.
Performs a Hermite spline interpolation.
static bool IsUnit(ref Vector3D value)
static bool IsZero(Vector3D value)
static bool IsZero(Vector3D value, double epsilon)
static Vector3D IsZeroVector(Vector3D value)
static Vector3D IsZeroVector(Vector3D value, double epsilon)
static Vector3D Lerp(Vector3D value1, Vector3D value2, double amount)
Performs a linear interpolation between two vectors.
static void Lerp(ref Vector3D value1, ref Vector3D value2, double amount, out Vector3D result)
Performs a linear interpolation between two vectors.
static Vector3D Max(Vector3D value1, Vector3D value2)
Returns a vector that contains the highest value from each matching pair of components.
static void Max(ref Vector3D value1, ref Vector3D value2, out Vector3D result)
Returns a vector that contains the highest value from each matching pair of components.
static Vector3D Min(Vector3D value1, Vector3D value2)
Returns a vector that contains the lowest value from each matching pair of components.
static void Min(ref Vector3D value1, ref Vector3D value2, out Vector3D result)
Returns a vector that contains the lowest value from each matching pair of components.
static void MinMax(ref Vector3D min, ref Vector3D max)
Separates minimal and maximal values of any two input vectors
static Vector3D Multiply(Vector3D value1, Vector3D value2)
Multiplies the components of two vectors by each other.
static void Multiply(ref Vector3D value1, ref Vector3D value2, out Vector3D result)
Multiplies the components of two vectors by each other.
static Vector3D Multiply(Vector3D value1, double scaleFactor)
Multiplies a vector by a scalar value.
static void Multiply(ref Vector3D value1, double scaleFactor, out Vector3D result)
Multiplies a vector by a scalar value.
static Vector3D Negate(Vector3D value)
Returns a vector pointing in the opposite direction.
static void Negate(ref Vector3D value, out Vector3D result)
Returns a vector pointing in the opposite direction.
static Vector3D Normalize(Vector3D value)
Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
static void Normalize(ref Vector3D value, out Vector3D result)
Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.
static Vector3D ProjectOnPlane(ref Vector3D vec, ref Vector3D planeNormal)
Projects given vector on plane specified by it's normal.
static Vector3D ProjectOnVector(ref Vector3D vec, ref Vector3D guideVector)
Projects vector on another vector resulting in new vector in guided vector's direction with different length.
static double RectangularDistance(Vector3D value1, Vector3D value2)
Calculates rectangular distance (a.k.a. Manhattan distance or Chessboard distace) between two vectors.
static double RectangularDistance(ref Vector3D value1, ref Vector3D value2)
Calculates rectangular distance (a.k.a. Manhattan distance or Chessboard distace) between two vectors.
static Vector3D Reflect(Vector3D vector, Vector3D normal)
Returns the reflection of a vector off a surface that has the specified normal. Reference page contains code sample.
static void Reflect(ref Vector3D vector, ref Vector3D normal, out Vector3D result)
Returns the reflection of a vector off a surface that has the specified normal. Reference page contains code sample.
static Vector3D Reject(Vector3D vector, Vector3D direction)
Returns the rejection of vector from direction, i.e. projection of vector onto the plane defined by origin and direction
static void Reject(ref Vector3D vector, ref Vector3D direction, out Vector3D result)
Returns the rejection of vector from direction, i.e. projection of vector onto the plane defined by origin and direction
static void Rotate(ref Vector3D vector, ref MatrixD rotationMatrix, out Vector3D result)
static Vector3D Rotate(Vector3D vector, MatrixD rotationMatrix)
static void RotateAndScale(ref Vector3D vector, ref MatrixD matrix, out Vector3D result)
static Vector3I Round(Vector3D vect3d)
static Vector3D Round(Vector3D v, int numDecimals)
static Vector3D Sign(Vector3D value)
static Vector3D SignNonZero(Vector3D value)
Returns per component sign, never returns zero. For zero component returns sign 1. Faster than Sign.
static Vector3D SmoothStep(Vector3D value1, Vector3D value2, double amount)
Interpolates between two values using a cubic equation.
static void SmoothStep(ref Vector3D value1, ref Vector3D value2, double amount, out Vector3D result)
Interpolates between two values using a cubic equation.
static Vector3D Step(Vector3D value)
static Vector3D Subtract(Vector3D value1, Vector3D value2)
Subtracts a vector from a vector.
static void Subtract(ref Vector3D value1, ref Vector3D value2, out Vector3D result)
Subtracts a vector from a vector.
static Vector3D SwapYZCoordinates(Vector3D v)
static Vector3D Transform(Vector3D value, Quaternion rotation)
Transforms a Vector3 by a specified Quaternion rotation.
static Vector3D Transform(Vector3D value, QuaternionD rotation)
Transforms a Vector3 by a specified Quaternion rotation.
static void Transform(ref Vector3D value, ref Quaternion rotation, out Vector3D result)
Transforms a Vector3 by a specified Quaternion rotation.
static void Transform(Vector3D[] sourceArray, ref MatrixD matrix, Vector3D[] destinationArray)
Transforms a source array of Vector3s by a specified Matrix and writes the results to an existing destination array.
static void Transform(Vector3D[] sourceArray, ref MatrixD matrix, *Vector3D destinationArray)
Applies a specified transform Matrix to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.
Transforms a source array of Vector3s by a specified Quaternion rotation and writes the results to an existing destination array.
Applies a specified Quaternion rotation to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.
static Vector3D Transform(Vector3D position, MatrixD matrix)
Transforms a 3D vector by the given matrix.
static Vector3D Transform(Vector3 position, MatrixD matrix)
static Vector3D Transform(Vector3D position, Matrix matrix)
Transforms a 3D vector by the given matrix.
static Vector3D Transform(Vector3D position, ref MatrixD matrix)
static void Transform(ref Vector3D position, ref MatrixD matrix, out Vector3D result)
Transforms a Vector3 by the given Matrix.
static void Transform(ref Vector3 position, ref MatrixD matrix, out Vector3D result)
static void Transform(ref Vector3D position, ref MatrixI matrix, out Vector3D result)
static void TransformNoProjection(ref Vector3D vector, ref MatrixD matrix, out Vector3D result)
static Vector3D TransformNormal(Vector3D normal, MatrixD matrix)
Transforms a 3D vector normal by a matrix.
static void TransformNormal(ref Vector3D normal, ref MatrixD matrix, out Vector3D result)
Transforms a vector normal by a matrix.
static void TransformNormal(ref Vector3 normal, ref MatrixD matrix, out Vector3D result)
static void TransformNormal(ref Vector3D normal, ref MatrixI matrix, out Vector3D result)
static Vector3D TransformNormal(Vector3D normal, MyBlockOrientation orientation)
static Vector3D TransformNormal(Vector3D normal, ref MatrixD matrix)
Transforms an array of 3D vector normals by a specified Matrix.
Transforms a specified range in an array of 3D vector normals by a specified Matrix and writes the results to a specified range in a destination array.
static Vector3D TransformNormal(Vector3D normal, Matrix matrix)
Transforms a 3D vector normal by a matrix.
static Vector3D TransformNormal(Vector3 normal, MatrixD matrix)
Transforms a 3D vector normal by a matrix.
static bool TryParse(string str, out Vector3D retval)
Returns the component of the vector, whose absolute value is largest of all the three components.
Returns the component of the vector, whose absolute value is smallest of all the three components.
void CalculatePerpendicularVector(out Vector3D result)
Determines whether the specified Object is equal to the Vector3.
bool Equals(Vector3D other, double epsilon)
Returns a value that indicates whether the current instance is equal to a specified object.
Gets the hash code of the vector object.
void Interpolate3(Vector3D v0, Vector3D v1, double rt)
bool IsInsideInclusive(ref Vector3D min, ref Vector3D max)
Calculates the length of the vector.
Calculates the length of the vector squared.
Returns the component of the vector that is largest of all the three components.
Returns the component of the vector that is smallest of all the three components.
Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Vector3D Rotate(Vector3D axis, double rotationInRadians)
void SetDim(int i, double value)
Retrieves a string representation of the current object.
string ToString(string format)
long VolumeInt(double multiplier)
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!