Constructs a Vector3 object from x, y, and z values
The x value for the Vector3
The y value for the Vector3
The z value for the Vector3
Static ReadonlyBACKA Vector3 object that points backward. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyDOWNA Vector3 object that points down. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyFORWARDA Vector3 object that points forward. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyLEFTA Vector3 object that points left. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyONEA Vector3 object with all one values. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyRIGHTA Vector3 object that points right. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyUPA Vector3 object that points up. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyX_A Vector3 object that points along the x-axis. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyY_A Vector3 object that points along the y-axis. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyZ_A Vector3 object that points along the z-axis. (See note in the Vector3.ZERO docs for important usage info.)
Static ReadonlyZEROA static property to provide quick access to a Vector3 with all of its x,y,z components equal to zero.
Computes the angle between this Vector3 and another Vector3
The second Vector3
The angle between the two Vectors
Creates a new Vector3 object with the same x, y, and z values as this Vector3
The cloned Vector3 object
Computes the cross product of two Vector3s and stores the result in the original Vector3.
The Vector3 to compute the cross product with.
Computes the distance between this Vector3 and another Vector3
The second Vector3
The distance between the two Vectors
Divides each component of the vector with that of another vector
Vector to divide with
Divides each component of the vector with a scalar value
Scalar value to divide with
Compute the dot product of two Vector3 objects
The other Vector3 object
The dot product of the two Vector3 objects
Checks if the x,y,z components of this Vector3 are exactly equal to those of the given Vector3
The Vector3 object to compare to
A boolean value indicating if the Vector3 objects are equal
Checks if the x,y,z components of this Vector3 are equal (within a small value of epsilon) to those of the given Vector3.
The Vector3 object to compare to
A small value of acceptable variance to account for numerical instability
A boolean value indicating if the Vector3 objects are equal
Inverts a Vector3 object and returns the result as a new Vector3 object
Inverts a Vector3 object
Calculates the length of a Vector3 object
The length of the Vector3 object
Multiplies this Vector3 by the given Vector3
The Vector3 object to multiply
Multiplies each component of the vector with a scalar value
Scalar value to multiply with
Normalizes a Vector3 object
Rotates this Vector3 instance by a given Quaternion
The Quaternion to rotate this Vector3
Sets the x, y, and z values of a Vector3 object
The x value to set
The y value to set
The z value to set
Sets this Vector3's position to the provided Matrix4's position
The Matrix4 to get the position from
Sets this Vector3's scale to the provided Matrix4's scale
The Matrix4 to get the scale from
Subtracts the given Vector3 from this Vector3
The Vector3 object to subtract
Transforms this Vector3 instance as a point with a given Matrix4
The Matrix4 to transform this Vector3
Transforms this Vector3 instance as a direction with a given Matrix4, ignoring the translation component
The Matrix4 to transform this Vector3
StaticaddStaticangleStaticcloneStaticcrossStaticdistanceStaticdivideStaticdivideStaticdotStaticequalsStaticfuzzyChecks if the x,y,z components of two Vector3 objects are equal within a small value of epsilon.
A boolean value indicating if the Vector3 objects are equal
StaticinverseStaticlerpStaticmultiplyStaticmultiplyStaticnormalizeStaticreflectStaticrotateRotates a Vector3 object by a Quaternion
The Vector3 object to rotate
The Quaternion object to rotate the Vector3 by
A new Vector3 object that represents the result of rotating v by q
StaticsubtractStatictransformStatictransformTransforms a Vector3 object representing a direction by a Matrix4, ignoring the translation component
A new Vector3 object that represents the result of transforming direction v by m
This class holds the x,y,z components of a 3D point or vector. It includes linear algebra routines for working with vectors (e.g., dot product, cross product).
Most of the functions in the class are defined both as member functions that can be called on a specific instance of Vector3 and as static functions. The static functions return a new result, leaving the original inputs unchanged, whereas, in general, member functions save the result in this vector itself and return void: