Create a Vec3 with the given components. Defaults to (0, 0, 0).
The x component.
The y component.
The z component.
Magnitude of the 3D vector.
The Euclidean length sqrt(x² + y² + z²).
The x component.
The x component.
The y component.
The y component.
The z component.
The z component.
Check whether this Vec3 is component-wise equal to another, within an optional epsilon tolerance.
The Vec3 to compare against.
Maximum allowed difference per component (default 0).
true if all three components differ by at most epsilon.
Squared magnitude. Faster than length as it avoids a square root.
x² + y² + z².
Copy another Vec3's components into this one in-place.
The source Vec3 to copy from.
this for chaining.
Set all three components at once in-place.
The new x component.
The new y component.
The new z component.
this for chaining.
String representation { x: … y: … z: … }.
A human-readable string of the three components.
Return the x and y components as a new Vec2.
If true, the returned Vec2 is a weak (pooled) reference.
A new Vec2 containing this vector's x and y components.
StaticgetAllocate a Vec3 from the public object pool, or create a new one if the pool is empty.
Initial x component (default 0).
Initial y component (default 0).
Initial z component (default 0).
A Vec3 initialised with the given components.
3D vector used for constraint impulses and other 3-component values.
Supports object pooling via
Vec3.get()/dispose().Converted from nape-compiled.js lines 24120–25040.