Skip to content

VRageMath.Vector4D

Morten Aune Lyrstad edited this page Apr 16, 2022 · 51 revisions

IndexNamespace Index

Vector4D Struct

public struct Vector4D: IEquatable<Vector4>

Defines a vector with four components.

Namespace: VRageMath
Assembly: VRage.Math.dll

Implements:

Fields

static Vector4D One

static Vector4D UnitW

static Vector4D UnitX

static Vector4D UnitY

static Vector4D UnitZ

static Vector4D Zero

double W

Gets or sets the w-component of the vector.

double X

Gets or sets the x-component of the vector.

double Y

Gets or sets the y-component of the vector.

double Z

Gets or sets the z-component of the vector.

Constructors

Vector4D(double x, double y, double z, double w)

Vector4D(Vector2 value, double z, double w)

Vector4D(Vector3D value, double w)

Vector4D(double value)

Methods

static Vector4D Add(Vector4D value1, Vector4D value2)

Adds two vectors.

static void Add(ref Vector4D value1, ref Vector4D value2, out Vector4D result)

Adds two vectors.

static Vector4D Barycentric(Vector4D value1, Vector4D value2, Vector4D value3, double amount1, double amount2)

Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.

static void Barycentric(ref Vector4D value1, ref Vector4D value2, ref Vector4D value3, double amount1, double amount2, out Vector4D result)

Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in Barycentric (areal) coordinates relative to a 4D triangle.

static Vector4D CatmullRom(Vector4D value1, Vector4D value2, Vector4D value3, Vector4D value4, double amount)

Performs a Catmull-Rom interpolation using the specified positions.

static void CatmullRom(ref Vector4D value1, ref Vector4D value2, ref Vector4D value3, ref Vector4D value4, double amount, out Vector4D result)

Performs a Catmull-Rom interpolation using the specified positions.

static Vector4D Clamp(Vector4D value1, Vector4D min, Vector4D max)

Restricts a value to be within a specified range.

static void Clamp(ref Vector4D value1, ref Vector4D min, ref Vector4D max, out Vector4D result)

Restricts a value to be within a specified range.

static double Distance(Vector4 value1, Vector4 value2)

Calculates the distance between two vectors.

static void Distance(ref Vector4 value1, ref Vector4 value2, out double result)

Calculates the distance between two vectors.

static double DistanceSquared(Vector4 value1, Vector4 value2)

Calculates the distance between two vectors squared.

static void DistanceSquared(ref Vector4 value1, ref Vector4 value2, out double result)

Calculates the distance between two vectors squared.

static Vector4D Divide(Vector4D value1, Vector4D value2)

Divides the components of a vector by the components of another vector.

static void Divide(ref Vector4D value1, ref Vector4D value2, out Vector4D result)

Divides the components of a vector by the components of another vector.

static Vector4D Divide(Vector4D value1, double divider)

Divides a vector by a scalar value.

static void Divide(ref Vector4D value1, double divider, out Vector4D result)

Divides a vector by a scalar value.

static double Dot(Vector4 vector1, Vector4 vector2)

Calculates the dot product of two vectors.

static void Dot(ref Vector4 vector1, ref Vector4 vector2, out double result)

Calculates the dot product of two vectors.

static Vector4D Hermite(Vector4D value1, Vector4D tangent1, Vector4D value2, Vector4D tangent2, double amount)

Performs a Hermite spline interpolation.

static void Hermite(ref Vector4D value1, ref Vector4D tangent1, ref Vector4D value2, ref Vector4D tangent2, double amount, out Vector4D result)

Performs a Hermite spline interpolation.

static Vector4D Lerp(Vector4D value1, Vector4D value2, double amount)

Performs a linear interpolation between two vectors.

static void Lerp(ref Vector4D value1, ref Vector4D value2, double amount, out Vector4D result)

Performs a linear interpolation between two vectors.

static Vector4 Max(Vector4 value1, Vector4 value2)

Returns a vector that contains the highest value from each matching pair of components.

static void Max(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Returns a vector that contains the highest value from each matching pair of components.

static Vector4 Min(Vector4 value1, Vector4 value2)

Returns a vector that contains the lowest value from each matching pair of components.

static void Min(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Returns a vector that contains the lowest value from each matching pair of components.

static Vector4D Multiply(Vector4D value1, Vector4D value2)

Multiplies the components of two vectors by each other.

static void Multiply(ref Vector4 value1, ref Vector4 value2, out Vector4 result)

Multiplies the components of two vectors by each other.

static Vector4D Multiply(Vector4D value1, double scaleFactor)

Multiplies a vector by a scalar.

static void Multiply(ref Vector4D value1, double scaleFactor, out Vector4D result)

Multiplies a vector by a scalar value.

static Vector4D Negate(Vector4D value)

Returns a vector pointing in the opposite direction.

static void Negate(ref Vector4D value, out Vector4D result)

Returns a vector pointing in the opposite direction.

static Vector4D Normalize(Vector4D vector)

Creates a unit vector from the specified vector.

static void Normalize(ref Vector4D vector, out Vector4D result)

Returns a normalized version of the specified vector.

static Vector4D PackOrthoMatrix(Vector3D position, Vector3 forward, Vector3 up)

static Vector4D PackOrthoMatrix(ref MatrixD matrix)

static Vector4D SmoothStep(Vector4D value1, Vector4D value2, double amount)

Interpolates between two values using a cubic equation.

static void SmoothStep(ref Vector4D value1, ref Vector4D value2, double amount, out Vector4D result)

Interpolates between two values using a cubic equation.

static Vector4 Subtract(Vector4 value1, Vector4 value2)

Subtracts a vector from a vector.

static void Subtract(ref Vector4D value1, ref Vector4D value2, out Vector4D result)

Subtracts a vector from a vector.

static Vector4D Transform(Vector2 position, MatrixD matrix)

Transforms a Vector2 by the given Matrix.

static void Transform(ref Vector2 position, ref MatrixD matrix, out Vector4D result)

Transforms a Vector2 by the given Matrix.

static Vector4D Transform(Vector3D position, MatrixD matrix)

Transforms a Vector3 by the given Matrix.

static void Transform(ref Vector3D position, ref MatrixD matrix, out Vector4D result)

Transforms a Vector3 by the given Matrix.

static Vector4D Transform(Vector4D vector, MatrixD matrix)

Transforms a Vector4 by the specified Matrix.

static void Transform(ref Vector4D vector, ref MatrixD matrix, out Vector4D result)

Transforms a Vector4 by the given Matrix.

static Vector4D Transform(Vector2 value, Quaternion rotation)

Transforms a Vector2 by a specified Quaternion into a Vector4.

static void Transform(ref Vector2 value, ref Quaternion rotation, out Vector4D result)

Transforms a Vector2 by a specified Quaternion into a Vector4.

static Vector4D Transform(Vector3D value, Quaternion rotation)

Transforms a Vector3 by a specified Quaternion into a Vector4.

static void Transform(ref Vector3D value, ref Quaternion rotation, out Vector4D result)

Transforms a Vector3 by a specified Quaternion into a Vector4.

static Vector4D Transform(Vector4D value, Quaternion rotation)

Transforms a Vector4 by a specified Quaternion.

static void Transform(ref Vector4D value, ref Quaternion rotation, out Vector4D result)

Transforms a Vector4 by a specified Quaternion.

static void Transform(Vector4D&#91] sourceArray, ref MatrixD matrix, Vector4D&#91] destinationArray)

Transforms an array of Vector4s by a specified Matrix.

static void Transform(Vector4D&#91] sourceArray, int sourceIndex, ref MatrixD matrix, Vector4D&#91] destinationArray, int destinationIndex, int length)

Transforms a specified range in an array of Vector4s by a specified Matrix into a specified range in a destination array.

static void Transform(Vector4D&#91] sourceArray, ref Quaternion rotation, Vector4D&#91] destinationArray)

Transforms an array of Vector4s by a specified Quaternion.

static void Transform(Vector4D&#91] sourceArray, int sourceIndex, ref Quaternion rotation, Vector4D&#91] destinationArray, int destinationIndex, int length)

Transforms a specified range in an array of Vector4s by a specified Quaternion into a specified range in a destination array.

static MatrixD UnpackOrthoMatrix(ref Vector4D packed)

bool Equals(Vector4 other)

Determines whether the specified Object is equal to the Vector4.

bool Equals(object obj)

Returns a value that indicates whether the current instance is equal to a specified object.

int GetHashCode()

Gets the hash code of this object.

double Length()

Calculates the length of the vector.

double LengthSquared()

Calculates the length of the vector squared.

void Normalize()

Turns the current vector into a unit vector.

string ToString()

Retrieves a string representation of the current object.

Clone this wiki locally