struct Vector3

robot_2Generated
code_blocksInput

Description

A point in 3D space.

Members

Static Members

Member NameSummary
OneA vector with all components set to 1.
ZeroA vector with all components set to 0.
ForwardA vector with X set to 1. This represents the forwards direction.
BackwardA vector with X set to -1. This represents the backwards direction.
UpA vector with Z set to 1. This represents the upwards direction.
DownA vector with Z set to -1. This represents the downwards direction.
RightA vector with Y set to -1. This represents the right hand direction.
LeftA vector with Y set to 1. This represents the left hand direction.
RandomUniformly samples a 3D position from all points with distance at most 1 from the origin.
AbsReturns a new vector with all values positive. -5 becomes 5, etc.
MinReturns the component-wise minimum of two vectors.
MaxReturns the component-wise maximum of two vectors.
LerpLinearly interpolates between two vectors.
SlerpSpherically interpolates between two vectors.
CrossCalculates the cross product of two vectors.
DotCalculates the dot product of two vectors.
DistanceBetweenCalculates the distance between two vectors.
DistanceBetweenSquaredCalculates the squared distance between two vectors.
InverseLerpCalculates the inverse linear interpolation of a vector.
ReflectReflects a vector off a surface defined by a normal.
VectorPlaneProjectProjects a vector onto a plane defined by a normal.
SortSorts two vectors component-wise.
CubicBezierCalculates a point on a cubic Bezier curve.
DirectionCalculates the direction from one vector to another.
CatmullRomSplineCalculates a point on a Catmull-Rom spline.
TcbSplineCalculates a point on a TCB spline.
SmoothDampSmoothly dampens a vector towards a target.
SpringDampApplies a spring damping effect to a vector.
ParseParses a string into a Vector3.
TryParseTries to parse a string into a Vector3.

Instance Members

Member NameSummary
xThe X component of this Vector.
yThe Y component of this Vector.
zThe Z component of this Vector.
NormalReturns a unit version of this vector. A unit vector has length of 1.
IsNaNReturns true if x, y or z are NaN.
IsInfinityReturns true if x, y or z are infinity.
LengthLength (or magnitude) of the vector (Distance from 0,0,0).
LengthSquaredSquared length of the vector. This is faster than Length, and can be used for things like comparing distances, as long as only squared values are used.
IsNearZeroLengthWhether length of this vector is nearly zero.
EulerAnglesThe Euler angles of this direction vector.
InverseReturns the inverse of this vector, which is useful for scaling vectors.
ItemGets or sets the component at the specified index.
WithXReturns a new vector with the X component set to the specified value.
WithYReturns a new vector with the Y component set to the specified value.
WithZReturns a new vector with the Z component set to the specified value.
IsNearlyZeroDetermines if the vector is nearly zero within a specified tolerance.
ClampLengthClamps the length of the vector to a specified maximum length.
ClampClamps the vector within the specified minimum and maximum vectors.
ComponentMinReturns the component-wise minimum of this vector and another.
ComponentMaxReturns the component-wise maximum of this vector and another.
LerpToLinearly interpolates this vector towards a target vector.
SlerpToSpherically interpolates this vector towards a target vector.
DistanceCalculates the distance from this vector to another.
DistanceSquaredCalculates the squared distance from this vector to another.
ApproachApproaches a target vector by a specified amount.
ProjectOnNormalProjects this vector onto a normal.
AlmostEqualDetermines if this vector is almost equal to another within a specified delta.
SubtractDirectionSubtracts a direction vector from this vector with a specified strength.
SnapToGridSnaps this vector to a grid of a specified size.
GetAngleCalculates the angle between this vector and another.
AngleCalculates the angle between this vector and another.
AddClampedAdds a vector to this vector, clamping the result to a maximum length.
RotateAroundRotates this vector around a specified center and rotation.
WithAccelerationApplies acceleration to this vector towards a target.
WithFrictionApplies friction to this vector.