Click or drag to resize

Vector3 Methods

The Vector3 type exposes the following members.

Methods
  NameDescription
Public methodAbs
Returns a new vector with all components in absolute values (i.e. positive).
Public methodAngleTo
Returns the minimum angle to the given vector, in radians.
Public methodBounce
Returns this vector "bounced off" from a plane defined by the given normal.
Public methodCeil
Returns a new vector with all components rounded up (towards positive infinity).
Public methodCross
Returns the cross product of this vector and `b`.
Public methodCubicInterpolate
Performs a cubic interpolation between vectors `preA`, this vector, `b`, and `postB`, by the given amount `t`.
Public methodDirectionTo
Returns the normalized vector pointing from this vector to `b`.
Public methodDistanceSquaredTo
Returns the squared distance between this vector and `b`. This method runs faster than DistanceTo(Vector3), so prefer it if you need to compare vectors or need the squared distance for some formula.
Public methodDistanceTo
Returns the distance between this vector and `b`.
Public methodDot
Returns the dot product of this vector and `b`.
Public methodEquals(Object) (Overrides ValueTypeEquals(Object).)
Public methodEquals(Vector3)
Public methodFloor
Returns a new vector with all components rounded down (towards negative infinity).
Public methodGetHashCode (Overrides ValueTypeGetHashCode.)
Public methodGetType (Inherited from Object.)
Public methodInverse
Returns the inverse of this vector. This is the same as `new Vector3(1 / v.x, 1 / v.y, 1 / v.z)`.
Public methodIsEqualApprox
Returns true if this vector and `other` are approximately equal, by running IsEqualApprox(Single, Single) on each component.
Public methodIsNormalized
Returns true if the vector is normalized, and false otherwise.
Public methodLength
Returns the length (magnitude) of this vector.
Public methodLengthSquared
Returns the squared length (squared magnitude) of this vector. This method runs faster than Length, so prefer it if you need to compare vectors or need the squared length for some formula.
Public methodLinearInterpolate(Vector3, Vector3)
Returns the result of the linear interpolation between this vector and `to` by the vector amount `weight`.
Public methodLinearInterpolate(Vector3, Single)
Returns the result of the linear interpolation between this vector and `to` by amount `weight`.
Public methodMaxAxis
Returns the axis of the vector's largest value. See Vector3Axis. If all components are equal, this method returns X.
Public methodMinAxis
Returns the axis of the vector's smallest value. See Vector3Axis. If all components are equal, this method returns Z.
Public methodMoveToward
Moves this vector toward `to` by the fixed `delta` amount.
Public methodNormalized
Returns the vector scaled to unit length. Equivalent to `v / v.Length()`.
Public methodOuter
Returns the outer product with `b`.
Public methodPosMod(Single)
Returns a vector composed of the PosMod(Single, Single) of this vector's components and `mod`.
Public methodPosMod(Vector3)
Returns a vector composed of the PosMod(Single, Single) of this vector's components and `modv`'s components.
Public methodProject
Returns this vector projected onto another vector `b`.
Public methodReflect
Returns this vector reflected from a plane defined by the given `normal`.
Public methodRotated
Rotates this vector around a given `axis` vector by `phi` radians. The `axis` vector must be a normalized vector.
Public methodRound
Returns this vector with all components rounded to the nearest integer, with halfway cases rounded towards the nearest multiple of two.
Public methodSet(Vector3) Obsolete.
Public methodSet(Single, Single, Single) Obsolete.
Public methodSign
Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling Sign(Single) on each component.
Public methodSlerp
Returns the result of the spherical linear interpolation between this vector and `to` by amount `weight`. Note: Both vectors must be normalized.
Public methodSlide
Returns this vector slid along a plane defined by the given normal.
Public methodSnapped
Returns this vector with each component snapped to the nearest multiple of `step`. This can also be used to round to an arbitrary number of decimals.
Public methodToDiagonalMatrix
Returns a diagonal matrix with the vector as main diagonal. This is equivalent to a Basis with no rotation or shearing and this vector's components set as the scale.
Public methodToString (Overrides ValueTypeToString.)
Public methodToString(String)
Top
See Also