Creates a new ObservableVector3
Observer notified when any component changes
The x component
The y component
The z component
Sets the x component
The new x
Sets the y component
The new y
Sets the z component
The new z
Adds v to this point
The point to add
The target to write the result into, defaults to this point
The point the result was written into
Adds v * s to this point, such as a velocity times the frame time
The point to scale and add
The scalar to multiply v by
The target to write the result into, defaults to this point
The point the result was written into
Computes the angle between this point and v, both seen from the origin
Returns π/2 when either has zero length.
The other point
The angle in radians, from 0 to π
Transforms this point by m, translation included, without the divide
ObservableVector3#applyMatrix4 does
Cheaper, and correct for any transform that doesn't project, such as a node's world transform.
The matrix to apply
The target to write the result into, defaults to this point
The point the result was written into
Multiplies this point by the 3x3 matrix m
The matrix to apply
The target to write the result into, defaults to this point
The point the result was written into
Transforms this point by m, translation included, then divides by the resulting w
Vector3#applyMatrix4 explains when the divide matters.
The matrix to apply
The target to write the result into, defaults to this point
The point the result was written into
Rotates this point around the origin by the unit Quaternion q
The unit quaternion to rotate by
The target to write the result into, defaults to this point
The point the result was written into
Clamps each component of this point between the matching components of min and max
Assumes min <= max componentwise.
The lower bound per component
The upper bound per component
The target to write the result into, defaults to this point
The point the result was written into
Creates a copy of this point that notifies observer, or this point's own observer when left out
A clone of a node's position that keeps the node as its observer marks the node's transform for
an update whenever the clone changes, though the node hasn't moved. For a plain copy, use
new Vector3().copyFrom(node.position).
Optionalobserver: Observer<ObservableVector3>
Optional observer for the clone
Copies x, y, z from the given point into this point
The point to copy from
Copies this point's x, y, z into the given point
The point to copy into
The given point with values updated
Computes the cross product this × v, a vector at right angles to both
The other point
The target to write the result into, defaults to this point
The point the result was written into
Computes the distance from this point to v
The point to measure to
Computes the squared distance from this point to v
Cheaper than ObservableVector3#distanceTo and enough to compare distances.
The point to measure to
Divides each component of this point by the matching component of v
The point to divide by
The target to write the result into, defaults to this point
The point the result was written into
Divides each component of this point by the scalar s
The scalar to divide by
The target to write the result into, defaults to this point
The point the result was written into
Computes the dot product of this point and v
The other point
Checks whether x, y and z all match p exactly, with no tolerance
The point to compare against
Reads x, y, z from array starting at offset
The array to read from
The index of the first component
Computes the squared length of this point
Cheaper than ObservableVector3#magnitude, since it skips the square root, and enough to compare lengths.
Sets each component to the larger of this point's and v's
The point to compare with
The target to write the result into, defaults to this point
The point the result was written into
Sets each component to the smaller of this point's and v's
The point to compare with
The target to write the result into, defaults to this point
The point the result was written into
Multiplies each component of this point by the matching component of v
The point to multiply by
The target to write the result into, defaults to this point
The point the result was written into
Multiplies each component of this point by the scalar s
The scalar to multiply by
The target to write the result into, defaults to this point
The point the result was written into
Negates each component of this point, mirroring it through the origin
The target to write the result into, defaults to this point
The point the result was written into
Scales this point to unit length, keeping its direction from the origin
A zero point stays zero.
The target to write the result into, defaults to this point
The point the result was written into
Sets this point to the position the Cylindrical coordinate c describes
Vector3#setFromCylindrical describes the angle and height.
The cylindrical coordinate to convert
Reads the first three values of column index of m into this point
In a transform, column 3 is the translation and columns 0 to 2 are the X, Y and Z axes, scaled.
The matrix to read from
The column index, 0 to 3
Sets this point to the position the Spherical coordinate s describes
Vector3#setFromSpherical describes the angles.
The spherical coordinate to convert
Scales this point so its distance from the origin equals length, keeping its direction
A zero point stays zero.
The target length
The target to write the result into, defaults to this point
The point the result was written into
Subtracts v from this point
The point to subtract
The target to write the result into, defaults to this point
The point the result was written into
Writes this point's values into array starting at offset
Allocates a new array when one is not supplied.
The array to write into
The index to write the first component at
The array the values were written into
Turns this point, read as a direction, by the rotation and scale in m, ignoring its translation,
then normalizes it
The matrix whose rotation to apply
The target to write the result into, defaults to this point
The point the result was written into
A Vector3 that tells an observer when it changes
A node's position, scale, rotation and origin use this class, so a change to one updates the node. It has the same methods as Vector3. Each in-place method notifies the observer at most once, and not at all when no component changed. Given an
outtarget, a method writes there and leaves this point and its observer alone.Example