Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

VRageMath.Vector4

Morten Aune Lyrstad edited this page Feb 17, 2020 · 52 revisions

IndexNamespace Index

Vector4 Struct

public struct Vector4: IEquatable<VRageMath.Vector4>

Defines a vector with four components.

Namespace: VRageMath
Assembly: VRage.Math.dll

Implements:

Fields

Member Description
X Gets or sets the x-component of the vector.
Y Gets or sets the y-component of the vector.
Z Gets or sets the z-component of the vector.
W Gets or sets the w-component of the vector.
Zero
One
UnitX
UnitY
UnitZ
UnitW

Properties

Member Description
Item { get; set; }

Constructors

Member Description
Vector4(float, float, float, float)
Vector4(Vector2, float, float)
Vector4(Vector3, float)
Vector4(float)

Methods

Member Description
PackOrthoMatrix(Vector3, Vector3, Vector3)
PackOrthoMatrix(ref Matrix)
UnpackOrthoMatrix(ref Vector4)
UnpackOrthoMatrix(ref Vector4, out Matrix)
ToString() Retrieves a string representation of the current object.
Equals(Vector4) Determines whether the specified Object is equal to the Vector4.
Equals(object) Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode() Gets the hash code of this object.
Length() Calculates the length of the vector.
LengthSquared() Calculates the length of the vector squared.
Distance(Vector4, Vector4) Calculates the distance between two vectors.
Distance(ref Vector4, ref Vector4, out float) Calculates the distance between two vectors.
DistanceSquared(Vector4, Vector4) Calculates the distance between two vectors squared.
DistanceSquared(ref Vector4, ref Vector4, out float) Calculates the distance between two vectors squared.
Dot(Vector4, Vector4) Calculates the dot product of two vectors.
Dot(ref Vector4, ref Vector4, out float) Calculates the dot product of two vectors.
Normalize() Turns the current vector into a unit vector.
Normalize(Vector4) Creates a unit vector from the specified vector.
Normalize(ref Vector4, out Vector4) Returns a normalized version of the specified vector.
Min(Vector4, Vector4) Returns a vector that contains the lowest value from each matching pair of components.
Min(ref Vector4, ref Vector4, out Vector4) Returns a vector that contains the lowest value from each matching pair of components.
Max(Vector4, Vector4) Returns a vector that contains the highest value from each matching pair of components.
Max(ref Vector4, ref Vector4, out Vector4) Returns a vector that contains the highest value from each matching pair of components.
Clamp(Vector4, Vector4, Vector4) Restricts a value to be within a specified range.
Clamp(ref Vector4, ref Vector4, ref Vector4, out Vector4) Restricts a value to be within a specified range.
Lerp(Vector4, Vector4, float) Performs a linear interpolation between two vectors.
Lerp(ref Vector4, ref Vector4, float, out Vector4) Performs a linear interpolation between two vectors.
Barycentric(Vector4, Vector4, Vector4, float, float) Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.
Barycentric(ref Vector4, ref Vector4, ref Vector4, float, float, out Vector4) Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in Barycentric (areal) coordinates relative to a 4D triangle.
SmoothStep(Vector4, Vector4, float) Interpolates between two values using a cubic equation.
SmoothStep(ref Vector4, ref Vector4, float, out Vector4) Interpolates between two values using a cubic equation.
CatmullRom(Vector4, Vector4, Vector4, Vector4, float) Performs a Catmull-Rom interpolation using the specified positions.
CatmullRom(ref Vector4, ref Vector4, ref Vector4, ref Vector4, float, out Vector4) Performs a Catmull-Rom interpolation using the specified positions.
Hermite(Vector4, Vector4, Vector4, Vector4, float) Performs a Hermite spline interpolation.
Hermite(ref Vector4, ref Vector4, ref Vector4, ref Vector4, float, out Vector4) Performs a Hermite spline interpolation.
Transform(Vector2, Matrix) Transforms a Vector2 by the given Matrix.
Transform(ref Vector2, ref Matrix, out Vector4) Transforms a Vector2 by the given Matrix.
Transform(Vector3, Matrix) Transforms a Vector3 by the given Matrix.
Transform(ref Vector3, ref Matrix, out Vector4) Transforms a Vector3 by the given Matrix.
Transform(Vector4, Matrix) Transforms a Vector4 by the specified Matrix.
Transform(ref Vector4, ref Matrix, out Vector4) Transforms a Vector4 by the given Matrix.
Transform(Vector2, Quaternion) Transforms a Vector2 by a specified Quaternion into a Vector4.
Transform(ref Vector2, ref Quaternion, out Vector4) Transforms a Vector2 by a specified Quaternion into a Vector4.
Transform(Vector3, Quaternion) Transforms a Vector3 by a specified Quaternion into a Vector4.
Transform(ref Vector3, ref Quaternion, out Vector4) Transforms a Vector3 by a specified Quaternion into a Vector4.
Transform(Vector4, Quaternion) Transforms a Vector4 by a specified Quaternion.
Transform(ref Vector4, ref Quaternion, out Vector4) Transforms a Vector4 by a specified Quaternion.
Transform(Vector4[], ref Matrix, Vector4[]) Transforms an array of Vector4s by a specified Matrix.
Transform(Vector4[], int, ref Matrix, Vector4[], int, int) Transforms a specified range in an array of Vector4s by a specified Matrix into a specified range in a destination array.
Transform(Vector4[], ref Quaternion, Vector4[]) Transforms an array of Vector4s by a specified Quaternion.
Transform(Vector4[], int, ref Quaternion, Vector4[], int, int) Transforms a specified range in an array of Vector4s by a specified Quaternion into a specified range in a destination array.
Negate(Vector4) Returns a vector pointing in the opposite direction.
Negate(ref Vector4, out Vector4) Returns a vector pointing in the opposite direction.
Add(Vector4, Vector4) Adds two vectors.
Add(ref Vector4, ref Vector4, out Vector4) Adds two vectors.
Subtract(Vector4, Vector4) Subtracts a vector from a vector.
Subtract(ref Vector4, ref Vector4, out Vector4) Subtracts a vector from a vector.
Multiply(Vector4, Vector4) Multiplies the components of two vectors by each other.
Multiply(ref Vector4, ref Vector4, out Vector4) Multiplies the components of two vectors by each other.
Multiply(Vector4, float) Multiplies a vector by a scalar.
Multiply(ref Vector4, float, out Vector4) Multiplies a vector by a scalar value.
Divide(Vector4, Vector4) Divides the components of a vector by the components of another vector.
Divide(ref Vector4, ref Vector4, out Vector4) Divides the components of a vector by the components of another vector.
Divide(Vector4, float) Divides a vector by a scalar value.
Divide(ref Vector4, float, out Vector4) Divides a vector by a scalar value.

Clone this wiki locally