Vector4
Represents a vector or a point in four-dimensional space, commonly used for RGBA values, 4D transforms, or 3D transformations with homogeneous coordinates. Unity's Vector4 Documentation
Properties
Provides the length of the Vector4, useful for distance calculations or scaling vectors. Unity's Vector4.magnitude Documentation
Represents a Vector4 with all components set to negative infinity, useful for setting minimum limits. Unity's Vector4.negativeInfinity Documentation
Provides a normalized version of the Vector4, with a length of 1, useful for direction-only applications. Unity's Vector4.normalized Documentation
Represents a Vector4 with all components set to one, useful for certain mathematical operations. Unity's Vector4.one Documentation
Represents a Vector4 with all components set to positive infinity, useful for setting maximum limits. Unity's Vector4.positiveInfinity Documentation
Returns the square of the magnitude of the Vector4, a performance-friendly alternative for length comparisons. Unity's Vector4.sqrMagnitude Documentation
Accesses the 'w' component of the Vector4, representing different dimensions or the 'Alpha' component in RGBA. Unity's Vector4.w Documentation
Accesses the 'x' component of the Vector4, representing different dimensions or the 'Red' component in RGBA. Unity's Vector4.x Documentation
Accesses the 'y' component of the Vector4, representing different dimensions or the 'Green' component in RGBA. Unity's Vector4.y Documentation
Accesses the 'z' component of the Vector4, representing different dimensions or the 'Blue' component in RGBA. Unity's Vector4.z Documentation
Represents a Vector4 with all components set to zero. Unity's Vector4.zero Documentation
Methods
Computes the distance between two Vector4's, useful for object spacing or collision detection. Unity's Vector4.Distance Documentation
Computes the dot product of two Vector4's, reflecting their angular relationship. Unity's Vector4.Dot Documentation
Parameters
other
Returns
Performs Linear Interpolation between two Vector4's based on a parameter 't', useful for smooth transitions. Unity's Vector4.Lerp Documentation
Similar to 'Lerp' but without clamping the 't' parameter, offering more freedom in interpolation. Unity's Vector4.LerpUnclamped Documentation
Calculates the length of the Vector4, useful for finding the distance it spans in 4D space. Unity's Vector4.Magnitude Documentation
Parameters
The Vector4 to compute the magnitude for.
Returns
Returns the magnitude of the Vector4.
Returns a Vector4 with the largest components of two Vector4's, useful for limiting operations. Unity's Vector4.Max Documentation
Returns a Vector4 with the smallest components of two Vector4's, useful for bounding box operations. Unity's Vector4.Min Documentation
Moves a Vector4 'current' towards 'target', limited by 'maxDistanceDelta', useful for smooth object movement. Unity's Vector4.MoveTowards Documentation
Transforms the Vector4 into a vector of same direction but with length 1, ideal for direction-only uses. Unity's Vector4.Normalize Documentation
Transforms the Vector4 into a vector of same direction but with length 1, ideal for direction-only uses. Unity's Vector4.Normalize Documentation
Returns
Projects a Vector4 onto another Vector4, useful for finding the nearest point on a defined line. Unity's Vector4.Project Documentation
Multiplies two Vector4's component-wise, useful for component-wise data manipulation. Unity's Vector4.Scale Documentation
Multiplies two Vector4's component-wise, useful for component-wise data manipulation. Unity's Vector4.Scale Documentation
Parameters
scale
Returns
Sets the 'x', 'y', 'z', and 'w' components of the Vector4, enhancing code readability and efficiency. Unity's Vector4.Set Documentation
Parameters
newX
The new 'x' component.
newY
The new 'y' component.
newZ
The new 'z' component.
newW
The new 'w' component.
Returns
Provides the square of the magnitude of the Vector4, an efficient method for length comparisons. Unity's Vector4.SqrMagnitude Documentation
Parameters
The Vector4 to compute the square of the magnitude for.
Returns
Returns the square of the magnitude.
Provides the square of the magnitude of the Vector4, an efficient method for length comparisons. Unity's Vector4.SqrMagnitude Documentation
Returns
Returns the square of the magnitude.
Updated 7 days ago