Skip to content

Vector4

new Vector4(x?, y?, z?, w?)

THREE equivalent: THREE.Vector4

Four-component vector used for homogeneous coordinates and quaternion storage.

Name Type Description
x number X component.
y number Y component.
z number Z component.
w number W component.
length number Euclidean length (read-only).
lengthSq number Squared length (read-only).
Method Description
set(x: number, y: number, z: number, w: number): this Sets all four components.
normalize(): this Scales the vector to unit length.
divScalar(s: number): this Divides all components by a scalar.
clone(): Vector4 Returns a new Vector4 with the same components.
copy(v: Vector4): this Copies components from another vector.