Object3D
Object3D
Scene graph object.
Node in the scene graph or “entity”. Consists of transformation and a reference to its parent object. Usually holds components and is accessible by components through object.
Objects are stored in a data oriented manner inside WebAssembly memory. This class is a JavaScript API wrapper around this memory for more convenient use in components.
Objects can be created and added to a scene through addObject on the scene.
- Object3D
- .constructor(engine, o) ⇒ Object3D
- .active⇒ void
- .changed
- .children
- .engine
- .name
- .name
- .objectId
- .parent
- .parent
.rotationLocal.rotationLocal.rotationWorld.rotationWorld.scalingLocal.scalingLocal.scalingWorld.scalingWorld.transformLocal.transformLocal.transformWorld.transformWorld- .addComponent<T>(typeClass, params) ⇒ null | T
- .destroy() ⇒ void
- .equals(otherObject) ⇒ boolean
- .getComponent<T>(typeOrClass, index) ⇒ null | T
- .getComponents<T>(typeOrClass) ⇒ T[]
.getForward<T>(out) ⇒ T- .getForwardWorld<T>(out) ⇒ T
- .getPositionLocal<T>(out) ⇒ T
- .getPositionWorld<T>(out) ⇒ T
.getRight<T>(out) ⇒ T- .getRightWorld<T>(out) ⇒ T
- .getRotationLocal<T>(out) ⇒ T
- .getRotationWorld<T>(out) ⇒ T
- .getScalingLocal<T>(out) ⇒ T
- .getScalingWorld<T>(out) ⇒ T
- .getTransformLocal<T>(out) ⇒ T
- .getTransformWorld<T>(out) ⇒ T
.getTranslationLocal<T>(out) ⇒ T.getTranslationWorld<T>(out) ⇒ T.getUp<T>(out) ⇒ T- .getUpWorld<T>(out) ⇒ T
- .lookAt(p, up) ⇒ Object3D
- .resetPosition() ⇒ Object3D
- .resetPositionRotation() ⇒ Object3D
- .resetRotation() ⇒ Object3D
- .resetScaling() ⇒ Object3D
- .resetTransform() ⇒ Object3D
.resetTranslation() ⇒ Object3D.resetTranslationRotation() ⇒ Object3D.rotate(q) ⇒ Object3D.rotateAxisAngleDeg(a, d) ⇒ Object3D- .rotateAxisAngleDegLocal(a, d) ⇒ Object3D
- .rotateAxisAngleDegObject(a, d) ⇒ Object3D
.rotateAxisAngleRad(a, d) ⇒ Object3D- .rotateAxisAngleRadLocal(a, d) ⇒ Object3D
- .rotateAxisAngleRadObject(a, d) ⇒ Object3D
- .rotateLocal(q) ⇒ Object3D
- .rotateObject(q) ⇒ Object3D
.scale(v) ⇒ Object3D- .scaleLocal(v) ⇒ Object3D
- .setDirty() ⇒ void
- .setPositionLocal(v) ⇒ Object3D
- .setPositionWorld(v) ⇒ Object3D
- .setRotationLocal(v) ⇒ Object3D
- .setRotationWorld(v) ⇒ Object3D
- .setScalingLocal(v) ⇒ Object3D
- .setScalingWorld(v) ⇒ Object3D
- .setTransformLocal(v) ⇒ Object3D
- .setTransformWorld(v) ⇒ Object3D
.setTranslationLocal(v) ⇒ Object3D.setTranslationWorld(v) ⇒ Object3D- .toLocalSpaceTransform<T>(out, q) ⇒ T
- .toObjectSpaceTransform<T>(out, q) ⇒ T
- .toWorldSpaceTransform<T>(out, q) ⇒ T
- .transformPointInverseLocal<T>(out, p) ⇒ T
- .transformPointInverseWorld<T>(out, p) ⇒ T
- .transformPointLocal<T>(out, p) ⇒ T
- .transformPointWorld<T>(out, p) ⇒ T
- .transformVectorInverseLocal<T>(out, v) ⇒ T
- .transformVectorInverseWorld<T>(out, v) ⇒ T
- .transformVectorLocal<T>(out, v) ⇒ T
- .transformVectorWorld<T>(out, v) ⇒ T
.translate(v) ⇒ Object3D- .translateLocal(v) ⇒ Object3D
- .translateObject(v) ⇒ Object3D
- .translateWorld(v) ⇒ Object3D
.constructor(engine: WonderlandEngine, o: number) ⇒ Object3D
Param | Type | Description |
---|---|---|
engine | WonderlandEngine | |
o | number | Object id to wrap For performance reasons, please use wrapObject |
.active⇒ void
0.8.5+Disable/enable all components of this object.
Param | Type | Description |
---|---|---|
b | boolean | New state for the components. |
.changed
Whether given object’s transformation has changed.
.children
Children of this object.
.engine
Hosting engine instance.
.name
Name of the object.
Useful for identifying objects during debugging.
.name
Name of the object.
Useful for identifying objects during debugging.
.objectId
Object index in the manager.
.parent
Parent of this object or null
if parented to root.
.parent
Parent of this object or null
if parented to root.
.rotationLocal
0.8.7+Local space rotation.
Deprecated: Please use getRotationLocal and setRotationLocal instead.
.rotationLocal
0.8.7+Local space rotation.
Deprecated: Please use getRotationLocal and setRotationLocal instead.
.rotationWorld
0.8.7+Global / world space rotation
Deprecated: Please use getRotationWorld and setRotationWorld instead.
.rotationWorld
0.8.7+Global / world space rotation
Deprecated: Please use getRotationWorld and setRotationWorld instead.
.scalingLocal
Local / object space scaling.
Deprecated: Please use setScalingLocal and getScalingLocal instead.
.scalingLocal
Local / object space scaling.
Deprecated: Please use setScalingLocal and getScalingLocal instead.
.scalingWorld
Global / world space scaling.
May recompute transformations of the hierarchy of this object, if they were changed by JavaScript components this frame.
Deprecated: Please use setScalingWorld and getScalingWorld instead.
.scalingWorld
Global / world space scaling.
May recompute transformations of the hierarchy of this object, if they were changed by JavaScript components this frame.
Deprecated: Please use setScalingWorld and getScalingWorld instead.
.transformLocal
Local space transformation.
Deprecated: Please use setTransformLocal and getTransformLocal instead.
.transformLocal
Local space transformation.
Deprecated: Please use setTransformLocal and getTransformLocal instead.
.transformWorld
Global / world space transformation.
May recompute transformations of the hierarchy of this object, if they were changed by JavaScript components this frame.
Deprecated: Please use setTransformWorld and getTransformWorld instead.
.transformWorld
Global / world space transformation.
May recompute transformations of the hierarchy of this object, if they were changed by JavaScript components this frame.
Deprecated: Please use setTransformWorld and getTransformWorld instead.
.addComponent(type: ‘collision’, params: Record<string, any>) ⇒ null | CollisionComponent
.addComponent(type: ’text’, params: Record<string, any>) ⇒ null | TextComponent
.addComponent(type: ‘view’, params: Record<string, any>) ⇒ null | ViewComponent
.addComponent(type: ‘mesh’, params: Record<string, any>) ⇒ null | MeshComponent
.addComponent(type: ‘input’, params: Record<string, any>) ⇒ null | InputComponent
.addComponent(type: ’light’, params: Record<string, any>) ⇒ null | LightComponent
.addComponent(type: ‘animation’, params: Record<string, any>) ⇒ null | AnimationComponent
.addComponent(type: ‘physx’, params: Record<string, any>) ⇒ null | PhysXComponent
.addComponent(type: string, params: Record<string, any>) ⇒ null | Component
.addComponent<T>(typeClass: ComponentConstructor, params: Record<string, any>) ⇒ null | T
Add component of given type to the object.
You can use this function to clone components, see the example below.
Returns: The component or null
if the type was not found
Param | Type | Description |
---|---|---|
typeClass | ComponentConstructor | |
params | Record<string, any> | Parameters to initialize properties of the new component, can be another component to copy properties from. |
Template Param | Type Definition |
---|---|
T | extends Component<1473> |
.destroy() ⇒ void
Destroy the object with all of its components and remove it from the scene
.equals(otherObject: undefined | null | Object3D) ⇒ boolean
Checks equality by comparing whether the wrapped native object ids are equal.
Returns: Whether this object equals the given object.
Param | Type | Description |
---|---|---|
otherObject | undefined | null | Object3D | Object to check equality with. |
.getComponent(type: ‘collision’, index: number) ⇒ null | CollisionComponent
.getComponent(type: ’text’, index: number) ⇒ null | TextComponent
.getComponent(type: ‘view’, index: number) ⇒ null | ViewComponent
.getComponent(type: ‘mesh’, index: number) ⇒ null | MeshComponent
.getComponent(type: ‘input’, index: number) ⇒ null | InputComponent
.getComponent(type: ’light’, index: number) ⇒ null | LightComponent
.getComponent(type: ‘animation’, index: number) ⇒ null | AnimationComponent
.getComponent(type: ‘physx’, index: number) ⇒ null | PhysXComponent
.getComponent(typeOrClass: string, index: number) ⇒ null | Component
.getComponent<T>(typeOrClass: ComponentConstructor, index: number) ⇒ null | T
Get a component attached to this object.
Returns: The component or null
if there is no such component on this object
Param | Type | Description |
---|---|---|
typeOrClass | ComponentConstructor | Type name. It’s also possible to give a class definition.
In this case, the method will use the class.TypeName field to find the component. |
index | number |
Template Param | Type Definition |
---|---|
T | extends Component<1437> |
.getComponents<T>(typeOrClass: null | string | ComponentConstructor) ⇒ T[]
Returns: All components of given type attached to this object.
Note: As this function is non-trivial, avoid using it in update()
repeatedly,
but rather store its result in init()
or start()
Warning: This method will currently return at most 341 components.
Param | Type | Description |
---|---|---|
typeOrClass | null | string | ComponentConstructor | Type name, pass a falsey value (undefined or null ) to retrieve all.
It’s also possible to give a class definition. In this case, the method will use the class.TypeName field to
find the components. |
Template Param | Type Definition |
---|---|
T | extends Component |
.getForward<T>(out: T) ⇒ T
Deprecated: Please use getForwardWorld instead.
Param | Type | Description |
---|---|---|
out | T |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getForwardWorld<T>(out: T) ⇒ T
Compute the object’s forward facing world space vector.
The forward vector in object space is along the negative z-axis, i.e.,
[0, 0, -1]
.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 3 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getPositionLocal() ⇒ Float32Array
.getPositionLocal<T>(out: T) ⇒ T
Compute local / object space position from transformation.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 3 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getPositionWorld() ⇒ Float32Array
.getPositionWorld<T>(out: T) ⇒ T
Compute world space position from transformation.
May recompute transformations of the hierarchy of this object, if they were changed by JavaScript components this frame.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 3 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getRight<T>(out: T) ⇒ T
Deprecated: Please use getRightWorld instead.
Param | Type | Description |
---|---|---|
out | T |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getRightWorld<T>(out: T) ⇒ T
Compute the object’s right facing world space vector.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 3 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getRotationLocal() ⇒ Float32Array
.getRotationLocal<T>(out: T) ⇒ T
1.0.0+Local space rotation.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 4 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getRotationWorld() ⇒ Float32Array
.getRotationWorld<T>(out: T) ⇒ T
1.0.0+World space rotation.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 4 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getScalingLocal() ⇒ Float32Array
.getScalingLocal<T>(out: T) ⇒ T
1.0.0+Local / object space scaling.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 3 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getScalingWorld() ⇒ Float32Array
.getScalingWorld<T>(out: T) ⇒ T
1.0.0+World space scaling.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 3 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getTransformLocal() ⇒ Float32Array
.getTransformLocal<T>(out: T) ⇒ T
Local space transformation.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 8 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getTransformWorld() ⇒ Float32Array
.getTransformWorld<T>(out: T) ⇒ T
World space transformation.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array, expected to have at least 8 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getTranslationLocal() ⇒ Float32Array
.getTranslationLocal<T>(out: T) ⇒ T
Deprecated: Please use getPositionLocal instead.
Param | Type | Description |
---|---|---|
out | T |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getTranslationWorld() ⇒ Float32Array
.getTranslationWorld<T>(out: T) ⇒ T
Deprecated: Please use getPositionWorld instead.
Param | Type | Description |
---|---|---|
out | T |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getUp<T>(out: T) ⇒ T
Deprecated: Please use getUpWorld instead.
Param | Type | Description |
---|---|---|
out | T |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.getUpWorld<T>(out: T) ⇒ T
Compute the object’s up facing world space vector.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Destination array/vector, expected to have at least 3 elements. |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.lookAt(p: NumberArray, up: NumberArray) ⇒ Object3D
Turn towards / look at target.
Rotates the object so that its forward vector faces towards the target
position. The up
vector acts as a hint to uniquely orient the object’s
up direction. When orienting a view component, the projected up
vector
faces upwards on the viewing plane.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
p | NumberArray | Target position to turn towards, in world space. |
up | NumberArray | Up vector to align object with, in world space. Default is [0, 1, 0] . |
.resetPosition() ⇒ Object3D
Reset local translation, keep rotation.
Note: To reset both rotation and translation, prefer resetTranslationRotation.
Returns: Reference to self (for method chaining).
.resetPositionRotation() ⇒ Object3D
Reset local position and rotation to identity.
Returns: Reference to self (for method chaining).
.resetRotation() ⇒ Object3D
Reset local rotation, keep translation.
Note: To reset both rotation and translation, prefer resetTranslationRotation.
Returns: Reference to self (for method chaining).
.resetScaling() ⇒ Object3D
Reset local scaling to identity ([1.0, 1.0, 1.0]
).
Returns: Reference to self (for method chaining).
.resetTransform() ⇒ Object3D
Reset local transformation (translation, rotation and scaling) to identity.
Returns: Reference to self (for method chaining).
.resetTranslation() ⇒ Object3D
Deprecated: Please use resetPosition instead.
.resetTranslationRotation() ⇒ Object3D
Deprecated: Please use resetPositionRotation instead.
.rotate(q: Readonly<NumberArray>) ⇒ Object3D
Deprecated: Please use rotateLocal instead.
Param | Type | Description |
---|---|---|
q | Readonly<NumberArray> |
.rotateAxisAngleDeg(a: Readonly<NumberArray>, d: number) ⇒ Object3D
Deprecated: Please use rotateAxisAngleDegLocal instead.
Param | Type | Description |
---|---|---|
a | Readonly<NumberArray> | |
d | number |
.rotateAxisAngleDegLocal(a: Readonly<NumberArray>, d: number) ⇒ Object3D
Rotate around given axis by given angle (degrees) in local space.
Note: If the object is translated the rotation will be around the parent. To rotate around the object origin, use rotateAxisAngleDegObject
See: rotateAxisAngleRad
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
a | Readonly<NumberArray> | Vector representing the rotation axis. |
d | number | Angle in degrees. |
.rotateAxisAngleDegObject(a: Readonly<NumberArray>, d: number) ⇒ Object3D
Rotate around given axis by given angle (degrees) in object space.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
a | Readonly<NumberArray> | Vector representing the rotation axis. |
d | number | Angle in degrees. Equivalent to prepending a rotation quaternion to the object’s local transformation. |
.rotateAxisAngleRad(a: Readonly<NumberArray>, d: number) ⇒ Object3D
Deprecated: Please use rotateAxisAngleRadLocal instead.
Param | Type | Description |
---|---|---|
a | Readonly<NumberArray> | |
d | number |
.rotateAxisAngleRadLocal(a: Readonly<NumberArray>, d: number) ⇒ Object3D
Rotate around given axis by given angle (radians) in local space.
Note: If the object is translated the rotation will be around the parent. To rotate around the object origin, use rotateAxisAngleDegObject
See: rotateAxisAngleDeg
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
a | Readonly<NumberArray> | Vector representing the rotation axis. |
d | number | Angle in radians. |
.rotateAxisAngleRadObject(a: Readonly<NumberArray>, d: number) ⇒ Object3D
Rotate around given axis by given angle (radians) in object space Equivalent to prepending a rotation quaternion to the object’s local transformation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
a | Readonly<NumberArray> | Vector representing the rotation axis |
d | number | Angle in degrees |
.rotateLocal(q: Readonly<NumberArray>) ⇒ Object3D
Rotate by a quaternion.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
q | Readonly<NumberArray> | the Quaternion to rotate by. |
.rotateObject(q: Readonly<NumberArray>) ⇒ Object3D
Rotate by a quaternion in object space.
Equivalent to prepending a rotation quaternion to the object’s local transformation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
q | Readonly<NumberArray> | the Quaternion to rotate by. |
.scale(v: Readonly<NumberArray>) ⇒ Object3D
Deprecated: Please use scaleLocal instead.
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> |
.scaleLocal(v: Readonly<NumberArray>) ⇒ Object3D
Scale object by a vector in object space.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | Vector to scale by. |
.setDirty() ⇒ void
Mark transformation dirty.
Causes an eventual recalculation of transformWorld, either on next getTranslationWorld, transformWorld or scalingWorld or the beginning of next frame, whichever happens first.
.setPositionLocal(v: Readonly<NumberArray>) ⇒ Object3D
Set local / object space position.
Concatenates a new translation dual quaternion onto the existing rotation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New local position array/vector, expected to have at least 3 elements. |
.setPositionWorld(v: Readonly<NumberArray>) ⇒ Object3D
Set world space position.
Applies the inverse parent transform with a new translation dual quaternion which is concatenated onto the existing rotation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New world position array/vector, expected to have at least 3 elements. |
.setRotationLocal(v: Readonly<NumberArray>) ⇒ Object3D
Set local space rotation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New world rotation array/vector, expected to have at least 4 elements. |
.setRotationWorld(v: Readonly<NumberArray>) ⇒ Object3D
Set local space rotation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New world rotation array/vector, expected to have at least 4 elements. |
.setScalingLocal(v: Readonly<NumberArray>) ⇒ Object3D
Set local / object space scaling.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New local scaling array/vector, expected to have at least 3 elements. |
.setScalingWorld(v: Readonly<NumberArray>) ⇒ Object3D
Set World space scaling.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New world scaling array/vector, expected to have at least 3 elements. |
.setTransformLocal(v: Readonly<NumberArray>) ⇒ Object3D
Set local space rotation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New local transform array, expected to have at least 8 elements. |
.setTransformWorld(v: Readonly<NumberArray>) ⇒ Object3D
Set world space rotation.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | New world transform array, expected to have at least 8 elements. |
.setTranslationLocal(v: Readonly<NumberArray>) ⇒ Object3D
Deprecated: Please use setPositionLocal instead.
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> |
.setTranslationWorld(v: Readonly<NumberArray>) ⇒ Object3D
Deprecated: Please use setPositionWorld instead.
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> |
.toLocalSpaceTransform<T>(out: T, q: NumberArray) ⇒ T
0.8.7+Transform a world space dual quaternion into local space.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out transformation |
q | NumberArray | World space transformation, default out |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.toObjectSpaceTransform<T>(out: T, q: NumberArray) ⇒ T
0.8.7+Transform a world space dual quaternion into object space.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out transformation. |
q | NumberArray | World space transformation, default out |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.toWorldSpaceTransform<T>(out: T, q: NumberArray) ⇒ T
0.8.7+Transform an object space dual quaternion into world space.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out transformation. |
q | NumberArray | Local space transformation, default out . |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformPointInverseLocal<T>(out: T, p: NumberArray) ⇒ T
0.8.7+Transform a point by this object’s inverse local transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out point. |
p | NumberArray | Point to transform, default out . |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformPointInverseWorld<T>(out: T, p: NumberArray) ⇒ T
0.8.7+Transform a point by this object’s inverse world transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out point. |
p | NumberArray | Point to transform, default out . |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformPointLocal<T>(out: T, p: NumberArray) ⇒ T
0.8.7+Transform a point by this object’s local transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out point. |
p | NumberArray | Point to transform, default out . |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformPointWorld<T>(out: T, p: NumberArray) ⇒ T
0.8.7+Transform a point by this object’s world transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out point. |
p | NumberArray | Point to transform, default out . |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformVectorInverseLocal<T>(out: T, v: NumberArray) ⇒ T
0.8.7+Transform a vector by this object’s inverse local transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out vector |
v | NumberArray | Vector to transform, default out |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformVectorInverseWorld<T>(out: T, v: NumberArray) ⇒ T
0.8.7+Transform a vector by this object’s inverse world transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out vector. |
v | NumberArray | Vector to transform, default out . |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformVectorLocal<T>(out: T, v: NumberArray) ⇒ T
0.8.7+Transform a vector by this object’s local transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out vector |
v | NumberArray | Vector to transform, default out |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.transformVectorWorld<T>(out: T, v: NumberArray) ⇒ T
0.8.7+Transform a vector by this object’s world transform.
Returns: The out
parameter.
Param | Type | Description |
---|---|---|
out | T | Out vector |
v | NumberArray | Vector to transform, default out |
Template Param | Type Definition |
---|---|
T | extends NumberArray |
.translate(v: Readonly<NumberArray>) ⇒ Object3D
Deprecated: Please use translateLocal instead.
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> |
.translateLocal(v: Readonly<NumberArray>) ⇒ Object3D
Translate object by a vector in the parent’s space.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | Vector to translate by. |
.translateObject(v: Readonly<NumberArray>) ⇒ Object3D
Translate object by a vector in object space.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | Vector to translate by. |
.translateWorld(v: Readonly<NumberArray>) ⇒ Object3D
Translate object by a vector in world space.
Returns: Reference to self (for method chaining).
Param | Type | Description |
---|---|---|
v | Readonly<NumberArray> | Vector to translate by. |