Constructs a vec3 with the given x, y, z components.
Blue channel component, equivalent to z.
Green channel component, equivalent to y.
The Euclidean length of this vector.
The squared Euclidean length of this vector.
Red channel component, equivalent to x.
X component of this vector.
Y component of this vector.
Z component of this vector.
Returns the angle in radians between this vector and the given vector.
StaticbackStatic vec3 pointing in the negative Z direction (0, 0, -1).
Returns a new vec3 with its length clamped to the given maximum length.
Clamps the length of this vector to the given maximum length in place.
Returns a new vec3 with the same component values as this vector.
Computes the cross product of this vector and the given vector, storing the result in this vector.
Returns the Euclidean distance between this vector and the given vector.
Returns the squared Euclidean distance between this vector and the given vector.
StaticdownStatic vec3 pointing in the negative Y direction (0, -1, 0).
Returns true if this vector's components are equal to the given vector's components.
Sets all components of this vector to the given value.
StaticforwardStatic vec3 pointing in the positive Z direction (0, 0, 1).
StaticleftStatic vec3 pointing in the negative X direction (-1, 0, 0).
StaticlerpLinearly interpolates this vector toward the given target vector by factor t, in place.
StaticmaxStaticminMoves this vector toward the target by at most maxDelta distance, in place.
Returns a new vec3 with the same direction as this vector but with length 1.
Normalizes this vector to unit length in place.
StaticoneStatic vec3 with all components set to 1.
StaticorthonormalizeProjects this vector onto the plane defined by the given normal, in place.
StaticrandomReturns a new vec3 with a random unit direction.
Reflects this vector off a surface with the given normal, in place.
StaticrightStatic vec3 pointing in the positive X direction (1, 0, 0).
Rotates this vector toward the target by at most maxAngle radians, in place.
Sets this vector to a random unit vector in place.
Sets the r, g, b components of this vector.
Optionalr: numberOptionalg: numberOptionalb: numberSets the x, y, z components of this vector.
Optionalx: numberOptionaly: numberOptionalz: numberStaticslerpSpherically interpolates this vector toward the given target vector by factor t, in place.
Returns a string representation of this vector's components.
Returns a new vec3 with all components multiplied by the given scalar.
Multiplies all components of this vector by the given scalar in place.
StaticupStatic vec3 pointing in the positive Y direction (0, 1, 0).
StaticzeroStatic vec3 with all components set to 0.
3-component floating-point vector used for 3D positions, directions, and RGB color values.