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

VRageMath.Vector3

Malware edited this page Aug 24, 2019 · 54 revisions

IndexNamespace Index

Vector3 Struct

public struct Vector3: IEquatable<VRageMath.Vector3>

Defines a vector with three 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.
Zero
One
MinusOne
Half
PositiveInfinity
NegativeInfinity
UnitX
UnitY
UnitZ
Up
Down
Right
Left
Forward
Backward
MaxValue
MinValue
Invalid

Properties

Member Description
Sum
Volume

Constructors

Member Description
Vector3(float, float, float)
Vector3(double, double, double)
Vector3(float)
Vector3(Vector2, float)
Vector3(Vector4)
Vector3(ref Vector3I)
Vector3(Vector3I)

Methods

Member Description
Negate(Vector3) Returns a vector pointing in the opposite direction.
Negate(ref Vector3, ref Vector3) Returns a vector pointing in the opposite direction.
Add(Vector3, Vector3) Adds two vectors.
Add(ref Vector3, ref Vector3, ref Vector3) Adds two vectors.
Subtract(Vector3, Vector3) Subtracts a vector from a vector.
Subtract(ref Vector3, ref Vector3, ref Vector3) Subtracts a vector from a vector.
Multiply(Vector3, Vector3) Multiplies the components of two vectors by each other.
Multiply(ref Vector3, ref Vector3, ref Vector3) Multiplies the components of two vectors by each other.
Multiply(Vector3, float) Multiplies a vector by a scalar value.
Multiply(ref Vector3, float, ref Vector3) Multiplies a vector by a scalar value.
Divide(Vector3, Vector3) Divides the components of a vector by the components of another vector.
Divide(ref Vector3, ref Vector3, ref Vector3) Divides the components of a vector by the components of another vector.
Divide(Vector3, float) Divides a vector by a scalar value.
Divide(ref Vector3, float, ref Vector3) Divides a vector by a scalar value.
CalculatePerpendicularVector(Vector3)
CalculatePerpendicularVector(ref Vector3)
GetAzimuthAndElevation(Vector3, ref float, ref float)
CreateFromAzimuthAndElevation(float, float, ref Vector3)
VolumeInt(float)
IsInsideInclusive(ref Vector3, ref Vector3)
SwapYZCoordinates(Vector3)
GetDim(int)
SetDim(int, float)
Ceiling(Vector3)
Floor(Vector3)
Round(Vector3)
Round(Vector3, int)
ProjectOnPlane(ref Vector3, ref Vector3) Projects given vector on plane specified by it's normal.
ProjectOnVector(ref Vector3, ref Vector3) Projects vector on another vector resulting in new vector in guided vector's direction with different length.
IsZero(ref Vector3)
Divide(float)
Multiply(float)
Add(Vector3)
Abs(Vector3)
Sign(Vector3)
Sign(Vector3, float)
SignNonZero(Vector3) Returns per component sign, never returns zero. For zero component returns sign 1. Faster than Sign.
Interpolate3(Vector3, Vector3, float)
IsValid()
AssertIsValid()
IsUnit(ref Vector3)
ArePerpendicular(ref Vector3, ref Vector3)
ArePerpendicular(Vector3, Vector3)
IsZero(Vector3)
IsZero(Vector3, float)
IsZeroVector(Vector3)
IsZeroVector(Vector3, float)
Step(Vector3)
ToString() Retrieves a string representation of the current object.
ToString(string)
Equals(Vector3) Determines whether the specified Object is equal to the Vector3.
Equals(Vector3, float)
Equals(object) Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode()
GetHash() Gets the hash code of the vector object.
Length() Calculates the length of the vector.
LengthSquared() Calculates the length of the vector squared.
Distance(Vector3, Vector3) Calculates the distance between two vectors.
Distance(ref Vector3, ref Vector3, ref float) Calculates the distance between two vectors.
DistanceSquared(Vector3, Vector3) Calculates the distance between two vectors squared.
DistanceSquared(ref Vector3, ref Vector3, ref float) Calculates the distance between two vectors squared.
RectangularDistance(Vector3, Vector3) Calculates rectangular distance (a.k.a. Manhattan distance or Chessboard distace) between two vectors.
RectangularDistance(ref Vector3, ref Vector3) Calculates rectangular distance (a.k.a. Manhattan distance or Chessboard distace) between two vectors.
Dot(Vector3, Vector3) Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating 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.
Dot(ref Vector3, ref Vector3, ref float) 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 floating 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.
Dot(Vector3)
Dot(ref Vector3)
Cross(Vector3)
Normalize() 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.
Normalize(Vector3) 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.
Normalize(Vector3D)
GetNormalized(ref Vector3)
Normalize(ref Vector3, ref Vector3) 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.
Cross(Vector3, Vector3) Calculates the cross product of two vectors.
Cross(ref Vector3, ref Vector3, ref Vector3) Calculates the cross product of two vectors.
Reflect(Vector3, Vector3) Returns the reflection of a vector off a surface that has the specified normal. Reference page contains code sample.
Reflect(ref Vector3, ref Vector3, ref Vector3) Returns the reflection of a vector off a surface that has the specified normal. Reference page contains code sample.
Reject(Vector3, Vector3) Returns the rejection of vector from direction, i.e. projection of vector onto the plane defined by origin and direction
Reject(ref Vector3, ref Vector3, ref Vector3) Returns the rejection of vector from direction, i.e. projection of vector onto the plane defined by origin and direction
Min() Returns the component of the vector that is smallest of all the three components.
AbsMin() Returns the component of the vector, whose absolute value is smallest of all the three components.
Max() Returns the component of the vector that is largest of all the three components.
MaxAbsComponent() Keeps only component with maximal absolute, others are set to zero.
AbsMax() Returns the component of the vector, whose absolute value is largest of all the three components.
Min(Vector3, Vector3) Returns a vector that contains the lowest value from each matching pair of components.
Min(ref Vector3, ref Vector3, ref Vector3) Returns a vector that contains the lowest value from each matching pair of components.
Max(Vector3, Vector3) Returns a vector that contains the highest value from each matching pair of components.
Max(ref Vector3, ref Vector3, ref Vector3) Returns a vector that contains the highest value from each matching pair of components.
MinMax(ref Vector3, ref Vector3) Separates minimal and maximal values of any two input vectors
DominantAxisProjection(Vector3) 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.
DominantAxisProjection(ref Vector3, ref Vector3) 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.
Clamp(Vector3, Vector3, Vector3) Restricts a value to be within a specified range.
Clamp(ref Vector3, ref Vector3, ref Vector3, ref Vector3) Restricts a value to be within a specified range.
ClampToSphere(Vector3, float)
ClampToSphere(ref Vector3, float)
Lerp(Vector3, Vector3, float) Performs a linear interpolation between two vectors.
Lerp(ref Vector3, ref Vector3, float, ref Vector3) Performs a linear interpolation between two vectors.
Barycentric(Vector3, Vector3, Vector3, float, float) Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
Barycentric(ref Vector3, ref Vector3, ref Vector3, float, float, ref Vector3) Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 3D triangle.
Barycentric(Vector3, Vector3, Vector3, Vector3, ref float, ref float, ref float) 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
TriangleArea(Vector3, Vector3, Vector3)
TriangleArea(ref Vector3, ref Vector3, ref Vector3)
SmoothStep(Vector3, Vector3, float) Interpolates between two values using a cubic equation.
SmoothStep(ref Vector3, ref Vector3, float, ref Vector3) Interpolates between two values using a cubic equation.
CatmullRom(Vector3, Vector3, Vector3, Vector3, float) Performs a Catmull-Rom interpolation using the specified positions.
CatmullRom(ref Vector3, ref Vector3, ref Vector3, ref Vector3, float, ref Vector3) Performs a Catmull-Rom interpolation using the specified positions.
Hermite(Vector3, Vector3, Vector3, Vector3, float) Performs a Hermite spline interpolation.
Hermite(ref Vector3, ref Vector3, ref Vector3, ref Vector3, float, ref Vector3) Performs a Hermite spline interpolation.
Transform(Vector3, Matrix) Transforms a 3D vector by the given matrix.
Transform(Vector3, MatrixD) Transforms a 3D vector by the given matrix.
Transform(Vector3, ref Matrix)
Transform(ref Vector3, ref Matrix, ref Vector3) Transforms a Vector3 by the given Matrix.
Transform(ref Vector3, ref MatrixI, ref Vector3)
TransformProjection(ref Vector3, ref Matrix, ref Vector3) Transforms a Vector3 by the given projection matrix (both ortho and perspective are supported)
TransformNoProjection(ref Vector3, ref Matrix, ref Vector3)
RotateAndScale(ref Vector3, ref Matrix, ref Vector3)
RotateAndScale(Vector3, Matrix)
TransformNormal(Vector3, Matrix) Transforms a 3D vector normal by a matrix.
TransformNormal(Vector3, MatrixD) Transforms a 3D vector normal by a matrix.
TransformNormal(Vector3D, Matrix) Transforms a 3D vector normal by a matrix.
TransformNormal(ref Vector3, ref Matrix, ref Vector3) Transforms a vector normal by a matrix.
TransformNormal(ref Vector3, ref MatrixD, ref Vector3)
TransformNormal(ref Vector3, ref MatrixI, ref Vector3)
TransformNormal(Vector3, MyBlockOrientation)
TransformNormal(ref Vector3, MyBlockOrientation, ref Vector3)
TransformNormal(Vector3, ref Matrix)
Transform(Vector3, Quaternion) Transforms a Vector3 by a specified Quaternion rotation.
Transform(ref Vector3, ref Quaternion, ref Vector3) Transforms a Vector3 by a specified Quaternion rotation.
Transform(Vector3[], ref Matrix, Vector3[]) Transforms a source array of Vector3s by a specified Matrix and writes the results to an existing destination array.
Transform(Vector3[], int, ref Matrix, Vector3[], int, int) 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.
TransformNormal(Vector3[], ref Matrix, Vector3[]) Transforms an array of 3D vector normals by a specified Matrix.
TransformNormal(Vector3[], int, ref Matrix, Vector3[], int, int) 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.
Transform(Vector3[], ref Quaternion, Vector3[]) Transforms a source array of Vector3s by a specified Quaternion rotation and writes the results to an existing destination array.
Transform(Vector3[], int, ref Quaternion, Vector3[], int, int) 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.

Clone this wiki locally