import {SceneModelTransform} from '@xeokit/xeokit-sdk/src/viewer/scene/model/SceneModelTransform.js'
SceneModelTransform
A dynamically-updatable transform within a SceneModel.
- Can be composed into hierarchies
- Shared by multiple SceneModelMeshes
- Created with SceneModel#createTransform
- Stored by ID in SceneModel#transforms
- Referenced by SceneModelMesh#transform
Member Summary
Public Members | ||
public |
id: * Unique ID of this SceneModelTransform. |
|
public set |
Sets the SceneModelTransform's transform matrix. Default value is |
|
public get |
Gets the SceneModelTransform's transform matrix. Default value is |
|
public get |
meshes: []: * The SceneModelMeshes transformed by this SceneModelTransform. |
|
public get |
The optional parent SceneModelTransform. |
|
public set |
Sets the SceneModelTransform's local translation. Default value is |
|
public get |
Gets the SceneModelTransform's translation. Default value is |
|
public set |
quaternion: Number[] Sets the SceneModelTransform's rotation quaternion. Default value is |
|
public get |
quaternion: Number[] Gets the SceneModelTransform's rotation quaternion. Default value is |
|
public set |
Sets the SceneModelTransform's rotation, as Euler angles given in degrees, for each of the X, Y and Z axis. Default value is |
|
public get |
Gets the SceneModelTransform's rotation, as Euler angles given in degrees, for each of the X, Y and Z axis. Default value is |
|
public set |
Sets the SceneModelTransform's scale. Default value is |
|
public get |
Gets the SceneModelTransform's scale. Default value is |
|
public get |
Gets the SceneModelTransform's World matrix. |
Method Summary
Public Methods | ||
public |
Rotates the SceneModelTransform about the given axis by the given increment. |
|
public |
rotateOnWorldAxis(axis: Number[], angle: Number): * Rotates the SceneModelTransform about the given World-space axis by the given increment. |
|
public |
Rotates the SceneModelTransform about the local X-axis by the given increment. |
|
public |
Rotates the SceneModelTransform about the local Y-axis by the given increment. |
|
public |
Rotates the SceneModelTransform about the local Z-axis by the given increment. |
|
public |
Translates the SceneModelTransform along the local axis by the given increment. |
|
public |
translateX(distance: Number): * Translates the SceneModelTransform along the local X-axis by the given increment. |
|
public |
translateY(distance: Number): * Translates the SceneModelTransform along the local Y-axis by the given increment. |
|
public |
translateZ(distance: Number): * Translates the SceneModelTransform along the local Z-axis by the given increment. |
Public Members
public id: * source
Unique ID of this SceneModelTransform.
The SceneModelTransform is registered against this ID in SceneModel#transforms.
public set matrix: Number[] source
Sets the SceneModelTransform's transform matrix.
Default value is [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
.
public get matrix: Number[] source
Gets the SceneModelTransform's transform matrix.
Default value is [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
.
public get meshes: []: * source
The SceneModelMeshes transformed by this SceneModelTransform.
Return:
[] |
public set position: Number[] source
Sets the SceneModelTransform's local translation.
Default value is [0,0,0]
.
public get position: Number[] source
Gets the SceneModelTransform's translation.
Default value is [0,0,0]
.
public set quaternion: Number[] source
Sets the SceneModelTransform's rotation quaternion.
Default value is [0,0,0,1]
.
public get quaternion: Number[] source
Gets the SceneModelTransform's rotation quaternion.
Default value is [0,0,0,1]
.
public set rotation: Number[] source
Sets the SceneModelTransform's rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
Default value is [0,0,0]
.
Public Methods
public rotate(axis: Number[], angle: Number): * source
Rotates the SceneModelTransform about the given axis by the given increment.
Return:
* |
public rotateOnWorldAxis(axis: Number[], angle: Number): * source
Rotates the SceneModelTransform about the given World-space axis by the given increment.
Return:
* |
public rotateX(angle: Number): * source
Rotates the SceneModelTransform about the local X-axis by the given increment.
Params:
Name | Type | Attribute | Description |
angle | Number | Angle increment in degrees. |
Return:
* |
public rotateY(angle: Number): * source
Rotates the SceneModelTransform about the local Y-axis by the given increment.
Params:
Name | Type | Attribute | Description |
angle | Number | Angle increment in degrees. |
Return:
* |
public rotateZ(angle: Number): * source
Rotates the SceneModelTransform about the local Z-axis by the given increment.
Params:
Name | Type | Attribute | Description |
angle | Number | Angle increment in degrees. |
Return:
* |
public translate(axis: Number[], distance: Number): * source
Translates the SceneModelTransform along the local axis by the given increment.
Return:
* |
public translateX(distance: Number): * source
Translates the SceneModelTransform along the local X-axis by the given increment.
Params:
Name | Type | Attribute | Description |
distance | Number | Distance to translate along the X-axis. |
Return:
* |