Class TextureDome<T> Abstract
Type Parameters
T extends Texture
Hierarchy
Index
Constructors
Properties
- _physics
Shape - animations
- id
- ignore
Non Uniform Scaling - inspectable
Custom Properties - metadata
- name
- on
Accessibility Tag Changed Observable - on
After World Matrix Update Observable - on
Dispose Observable - on
Load Error Observable - on
Load Observable - on
Ready - physics
Body - physics
Shape - re
Integrate Rotation Into Rotation Quaternion - reserved
Data Store - scaling
Determinant - state
- unique
Id - BILLBOARDMODE_
ALL - BILLBOARDMODE_
NONE - BILLBOARDMODE_
USE_ POSITION - BILLBOARDMODE_
X - BILLBOARDMODE_
Y - BILLBOARDMODE_
Z - Billboard
Use Parent Orientation - MODE_
MONOSCOPIC - MODE_
SIDEBYSIDE - MODE_
TOPBOTTOM
Accessors
- absolute
Position - absolute
Rotation Quaternion - absolute
Scaling - accessibility
Tag - animation
Properties Override - behaviors
- billboard
Mode - cross
Eye - do
Not Serialize - forward
- fov
Multiplier - half
Dome - infinite
Distance - is
World Matrix Frozen - material
- mesh
- non
Uniform Scaling - on
Cloned Observable - on
Dispose - on
Enabled State Changed Observable - parent
- position
- preserve
Parent Rotation For Billboard - right
- rotation
- rotation
Quaternion - scaling
- texture
- texture
Mode - up
- world
Matrix From Cache
Methods
- add
Behavior - add
Rotation - apply
Impulse - attach
To Bone - begin
Animation - clone
- compute
World Matrix - create
Animation Range - delete
Animation Range - detach
From Bone - dispose
- freeze
World Matrix - get
Absolute Pivot Point - get
Absolute Pivot Point To Ref - get
Absolute Position - get
Animation By Name - get
Animation Range - get
Animation Ranges - get
Behavior By Name - get
Child Meshes - get
Child Transform Nodes - get
Children - get
Class Name - get
Descendants - get
Direction - get
Direction To Ref - get
Distance To Camera - get
Engine - get
Hierarchy Bounding Vectors - get
Physics Body - get
Physics Shape - get
Pivot Matrix - get
Pivot Point - get
Pivot Point To Ref - get
Pose Matrix - get
Position Expressed In Local Space - get
Position In Camera Space - get
Scene - get
World Matrix - instantiate
Hierarchy - is
Descendant Of - is
Disposed - is
Enabled - is
Ready - is
Using Pivot Matrix - is
World Matrix Camera Dependent - locally
Translate - look
At - mark
As Dirty - normalize
To Unit Cube - register
After World Matrix Update - remove
Behavior - reset
Local Matrix - rotate
- rotate
Around - serialize
- serialize
Animation Ranges - set
Absolute Position - set
Direction - set
Enabled - set
Parent - set
Pivot Matrix - set
Pivot Point - set
Position With Local Vector - set
Pre Transform Matrix - translate
- unfreeze
World Matrix - unregister
After World Matrix Update - update
Pose Matrix - Add
Node Constructor - Construct
- Parse
- Parse
Animation Ranges
Constructors
constructor
Create an instance of this class and pass through the parameters to the relevant classes- Texture, StandardMaterial, and Mesh.
Type Parameters
T extends Texture<T>
Parameters
name: string
Element's name, child elements will append suffixes for their own names.
textureUrlOrElement: string | string[] | HTMLVideoElement
defines the url(s) or the (video) HTML element to use
options: { autoPlay?: boolean; clickToPlay?: boolean; crossEyeMode?: boolean; faceForward?: boolean; generateMipMaps?: boolean; halfDomeMode?: boolean; loop?: boolean; mesh?: Mesh; poster?: string; resolution?: number; size?: number; useDirectMapping?: boolean }
An object containing optional or exposed sub element properties
Optional auto
Play?: boolean Optional click
To Play?: boolean Optional cross
Eye Mode?: boolean Optional face
Forward?: boolean Optional generate
Mip Maps?: boolean Optional half
Dome Mode?: boolean Optional loop?: boolean
Optional mesh?: Mesh
Optional poster?: string
Optional resolution?: number
Optional size?: number
Optional use
Direct Mapping?: boolean
scene: Scene
Optional onError: Nullable<((message?: string, exception?: any) => void)>
Returns TextureDome<T>
Properties
_physics ShapeSearch playground for _physicsShape
animationsSearch playground for animations
Gets a list of Animations associated with the node
idSearch playground for id
Gets or sets the id of the node
ignore Non Uniform ScalingSearch playground for ignoreNonUniformScaling
Gets or sets a boolean indicating that non uniform scaling (when at least one component is different from others) should be ignored. By default the system will update normals to compensate
inspectable Custom PropertiesSearch playground for inspectableCustomProperties
List of inspectable custom properties (used by the Inspector)
metadataSearch playground for metadata
Gets or sets an object used to store user defined information for the node
nameSearch playground for name
Gets or sets the name of the node
on Accessibility Tag Changed ObservableSearch playground for onAccessibilityTagChangedObservable
on After World Matrix Update ObservableSearch playground for onAfterWorldMatrixUpdateObservable
An event triggered after the world matrix is updated
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the mesh is disposed
on Load Error ObservableSearch playground for onLoadErrorObservable
Observable raised when an error occurred while loading the texture
on Load ObservableSearch playground for onLoadObservable
Observable raised when the texture finished loading
on ReadySearch playground for onReady
Callback raised when the node is ready to be used
physics BodySearch playground for physicsBody
physics ShapeSearch playground for physicsShape
re Integrate Rotation Into Rotation QuaternionSearch playground for reIntegrateRotationIntoRotationQuaternion
Gets or sets a boolean indicating that even if rotationQuaternion is defined, you can keep updating rotation property and Babylon.js will just mix both
reserved Data StoreSearch playground for reservedDataStore
For internal use only. Please do not use.
scaling DeterminantSearch playground for scalingDeterminant
Multiplication factor on scale x/y/z when computing the world matrix. Eg. for a 1x1x1 cube setting this to 2 will make it a 2x2x2 cube
stateSearch playground for state
Gets or sets a string used to store user defined state for the node
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
Static BILLBOARDMODE_ ALLSearch playground for BILLBOARDMODE_ALL
Object will rotate to face the camera
Static BILLBOARDMODE_ NONESearch playground for BILLBOARDMODE_NONE
Object will not rotate to face the camera
Static BILLBOARDMODE_ USE_ POSITIONSearch playground for BILLBOARDMODE_USE_POSITION
Object will rotate to face the camera's position instead of orientation
Static BILLBOARDMODE_ XSearch playground for BILLBOARDMODE_X
Object will rotate to face the camera but only on the x axis
Static BILLBOARDMODE_ YSearch playground for BILLBOARDMODE_Y
Object will rotate to face the camera but only on the y axis
Static BILLBOARDMODE_ ZSearch playground for BILLBOARDMODE_Z
Object will rotate to face the camera but only on the z axis
Static Billboard Use Parent OrientationSearch playground for BillboardUseParentOrientation
Child transform with Billboard flags should or should not apply parent rotation (default if off)
Static Readonly MODE_ MONOSCOPICSearch playground for MODE_MONOSCOPIC
Define the source as a Monoscopic panoramic 360/180.
Static Readonly MODE_ SIDEBYSIDESearch playground for MODE_SIDEBYSIDE
Define the source as a Stereoscopic Side by Side panoramic 360/180.
Static Readonly MODE_ TOPBOTTOMSearch playground for MODE_TOPBOTTOM
Define the source as a Stereoscopic TopBottom/OverUnder panoramic 360/180.
Accessors
absolute Position
Returns the current mesh absolute position. Returns a Vector3.
Returns Vector3
absolute Rotation Quaternion
Returns the current mesh absolute rotation. Returns a Quaternion.
Returns Quaternion
absolute Scaling
Returns the current mesh absolute scaling. Returns a Vector3.
Returns Vector3
accessibility Tag
Gets or sets the accessibility tag to describe the node for accessibility purpose.
Returns Nullable<IAccessibilityTag>
Gets or sets the accessibility tag to describe the node for accessibility purpose.
Parameters
value: Nullable<IAccessibilityTag>
Returns void
animation Properties Override
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
Gets or sets the animation properties override
Parameters
value: Nullable<AnimationPropertiesOverride>
Returns void
behaviors
billboard Mode
Gets or sets the billboard mode. Default is 0.
Value Type Description 0 BILLBOARDMODE_NONE 1 BILLBOARDMODE_X 2 BILLBOARDMODE_Y 4 BILLBOARDMODE_Z 7 BILLBOARDMODE_ALL Returns number
Gets or sets the billboard mode. Default is 0.
Value Type Description 0 BILLBOARDMODE_NONE 1 BILLBOARDMODE_X 2 BILLBOARDMODE_Y 4 BILLBOARDMODE_Z 7 BILLBOARDMODE_ALL Parameters
value: number
Returns void
cross Eye
Is it a cross-eye texture?
Returns boolean
Set the cross-eye mode. If set, images that can be seen when crossing eyes will render correctly
Parameters
enabled: boolean
Returns void
do Not Serialize
Gets or sets a boolean used to define if the node must be serialized
Returns boolean
Gets or sets a boolean used to define if the node must be serialized
Parameters
value: boolean
Returns void
forward
The forward direction of that transform in world space.
Returns Vector3
fov Multiplier
The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out". Also see the options.resolution property.
Returns number
The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out". Also see the options.resolution property.
Parameters
value: number
Returns void
half Dome
Is it a 180 degrees dome (half dome) or 360 texture (full dome)
Returns boolean
Set the halfDome mode. If set, only the front (180 degrees) will be displayed and the back will be blacked out.
Parameters
enabled: boolean
Returns void
infinite Distance
Gets or sets the distance of the object to max, often used by skybox
Returns boolean
Gets or sets the distance of the object to max, often used by skybox
Parameters
value: boolean
Returns void
is World Matrix Frozen
True if the World matrix has been frozen.
Returns boolean
material
The background material of this dome.
Returns BackgroundMaterial
mesh
Gets the mesh used for the dome.
Returns Mesh
non Uniform Scaling
True if the scaling property of this object is non uniform eg. (1,2,1)
Returns boolean
on Cloned Observable
An event triggered when the node is cloned
Returns Observable<Node>
on Dispose
Sets a callback that will be raised when the node will be disposed
Parameters
callback: (() => void)
Returns void
Returns void
on Enabled State Changed Observable
An event triggered when the enabled state of the node changes
Returns Observable<boolean>
parent
position
preserve Parent Rotation For Billboard
Gets or sets a boolean indicating that parent rotation should be preserved when using billboards. This could be useful for glTF objects where parent rotation helps converting from right handed to left handed
Returns boolean
Gets or sets a boolean indicating that parent rotation should be preserved when using billboards. This could be useful for glTF objects where parent rotation helps converting from right handed to left handed
Parameters
value: boolean
Returns void
right
The right direction of that transform in world space.
Returns Vector3
rotation
Gets or sets the rotation property : a Vector3 defining the rotation value in radians around each local axis X, Y, Z (default is (0.0, 0.0, 0.0)). If rotation quaternion is set, this Vector3 will be ignored and copy from the quaternion
Returns Vector3
Gets or sets the rotation property : a Vector3 defining the rotation value in radians around each local axis X, Y, Z (default is (0.0, 0.0, 0.0)). If rotation quaternion is set, this Vector3 will be ignored and copy from the quaternion
Parameters
newRotation: Vector3
Returns void
rotation Quaternion
Gets or sets the rotation Quaternion property : this a Quaternion object defining the node rotation by using a unit quaternion (undefined by default, but can be null). If set, only the rotationQuaternion is then used to compute the node rotation (ie. node.rotation will be ignored)
Returns Nullable<Quaternion>
Gets or sets the rotation Quaternion property : this a Quaternion object defining the node rotation by using a unit quaternion (undefined by default, but can be null). If set, only the rotationQuaternion is then used to compute the node rotation (ie. node.rotation will be ignored)
Parameters
quaternion: Nullable<Quaternion>
Returns void
scaling
Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).
Returns Vector3
Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).
Parameters
newScaling: Vector3
Returns void
texture
Gets the texture being displayed on the sphere
Returns T
Sets the texture being displayed on the sphere
Parameters
newTexture: T
Returns void
texture Mode
Gets or set the current texture mode for the texture. It can be:
- TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
- TextureDome.MODE_TOPBOTTOM : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
- TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
Returns number
Sets the current texture mode for the texture. It can be:
- TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
- TextureDome.MODE_TOPBOTTOM : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
- TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
Parameters
value: number
Returns void
up
The up direction of that transform in world space.
Returns Vector3
world Matrix From Cache
Returns directly the latest state of the mesh World matrix. A Matrix is returned.
Returns Matrix
Methods
add BehaviorSearch playground for addBehavior
add RotationSearch playground for addRotation
Adds a rotation step to the mesh current rotation. x, y, z are Euler angles expressed in radians. This methods updates the current mesh rotation, either mesh.rotation, either mesh.rotationQuaternion if it's set. This means this rotation is made in the mesh local space only. It's useful to set a custom rotation order different from the BJS standard one YXZ. Example : this rotates the mesh first around its local X axis, then around its local Z axis, finally around its local Y axis.
mesh.addRotation(x1, 0, 0).addRotation(0, 0, z2).addRotation(0, 0, y3);
Note that
addRotation()
accumulates the passed rotation values to the current ones and computes the .rotation or .rotationQuaternion updated values. Under the hood, only quaternions are used. So it's a little faster is you use .rotationQuaternion because it doesn't need to translate them back to Euler angles.Parameters
x: number
Rotation to add
y: number
Rotation to add
z: number
Rotation to add
Returns TransformNode
the TransformNode.
apply ImpulseSearch playground for applyImpulse
Apply a physic impulse to the mesh
Parameters
Returns TransformNode
the current mesh
attach To BoneSearch playground for attachToBone
Attach the current TransformNode to another TransformNode associated with a bone
Parameters
bone: Bone
Bone affecting the TransformNode
affectedTransformNode: TransformNode
TransformNode associated with the bone
Returns TransformNode
this object
begin AnimationSearch playground for beginAnimation
Will start the animation sequence
Parameters
name: string
defines the range frames for animation sequence
Optional loop: boolean
defines if the animation should loop (false by default)
Optional speedRatio: number
defines the speed factor in which to run the animation (1 by default)
Optional onAnimationEnd: (() => void)
defines a function to be executed when the animation ended (undefined by default)
Returns void
Returns Nullable<Animatable>
the object created for this animation. If range does not exist, it will return null
cloneSearch playground for clone
Clone the current transform node
Parameters
name: string
Name of the new clone
newParent: Nullable<Node>
New parent for the clone
Optional doNotCloneChildren: boolean
Do not clone children hierarchy
Returns Nullable<TransformNode>
the new transform node
compute World MatrixSearch playground for computeWorldMatrix
Computes the world matrix of the node
Parameters
Optional force: boolean
defines if the cache version should be invalidated forcing the world matrix to be created from scratch
Optional camera: Nullable<Camera>
defines the camera used if different from the scene active camera (This is used with modes like Billboard or infinite distance)
Returns Matrix
the world matrix
create Animation RangeSearch playground for createAnimationRange
Creates an animation range for this node
Parameters
name: string
defines the name of the range
from: number
defines the starting key
to: number
defines the end key
Returns void
delete Animation RangeSearch playground for deleteAnimationRange
Delete a specific animation range
Parameters
name: string
defines the name of the range to delete
Optional deleteFrames: boolean
defines if animation frames from the range must be deleted as well
Returns void
detach From BoneSearch playground for detachFromBone
Detach the transform node if its associated with a bone
Parameters
Optional resetToPreviousParent: boolean
Indicates if the parent that was in effect when attachToBone was called should be set back or if we should set parent to null instead (defaults to the latter)
Returns TransformNode
this object
disposeSearch playground for dispose
Releases resources associated with this node.
Parameters
Optional doNotRecurse: boolean
Set to true to not recurse into each children (recurse into each children by default)
Optional disposeMaterialAndTextures: boolean
Set to true to also dispose referenced materials and textures (false by default)
Returns void
freeze World MatrixSearch playground for freezeWorldMatrix
Prevents the World matrix to be computed any longer
Parameters
Optional newWorldMatrix: Nullable<Matrix>
defines an optional matrix to use as world matrix
Optional decompose: boolean
defines whether to decompose the given newWorldMatrix or directly assign
Returns TransformNode
the TransformNode.
get Absolute Pivot PointSearch playground for getAbsolutePivotPoint
Returns a new Vector3 set with the mesh pivot point World coordinates.
Returns Vector3
a new Vector3 set with the mesh pivot point World coordinates.
get Absolute Pivot Point To RefSearch playground for getAbsolutePivotPointToRef
Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.
Parameters
result: Vector3
vector3 to store the result
Returns TransformNode
this TransformNode.
get Absolute PositionSearch playground for getAbsolutePosition
Returns the mesh absolute position in the World.
Returns Vector3
a Vector3.
get Animation By NameSearch playground for getAnimationByName
get Animation RangeSearch playground for getAnimationRange
Get an animation range by name
Parameters
name: string
defines the name of the animation range to look for
Returns Nullable<AnimationRange>
null if not found else the requested animation range
get Animation RangesSearch playground for getAnimationRanges
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Behavior By NameSearch playground for getBehaviorByName
get Child MeshesSearch playground for getChildMeshes
Get all child-meshes of this node
Type Parameters
T extends AbstractMesh<T>
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optional predicate: ((node: Node) => node is T)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns node is T
Returns T[]
an array of AbstractMesh
Get all child-meshes of this node
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optional predicate: ((node: Node) => boolean)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns boolean
Returns AbstractMesh[]
an array of AbstractMesh
get Child Transform NodesSearch playground for getChildTransformNodes
Get all child-transformNodes of this node
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional predicate: ((node: Node) => boolean)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns boolean
Returns TransformNode[]
an array of TransformNode
get ChildrenSearch playground for getChildren
Get all direct children of this node
Type Parameters
T extends Node<T>
Parameters
Optional predicate: ((node: Node) => node is T)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns node is T
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
Returns T[]
an array of Node
Get all direct children of this node
Parameters
Optional predicate: ((node: Node) => boolean)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns boolean
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
Returns Node[]
an array of Node
get Class NameSearch playground for getClassName
Gets a string identifying the name of the class
Returns string
"TransformNode" string
get DescendantsSearch playground for getDescendants
Will return all nodes that have this node as ascendant
Type Parameters
T extends Node<T>
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional predicate: ((node: Node) => node is T)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns node is T
Returns T[]
all children nodes of all types
Will return all nodes that have this node as ascendant
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional predicate: ((node: Node) => boolean)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns boolean
Returns Node[]
all children nodes of all types
get DirectionSearch playground for getDirection
Returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh. This Vector3 is expressed in the World space.
Parameters
localAxis: Vector3
axis to rotate
Returns Vector3
a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
get Direction To RefSearch playground for getDirectionToRef
Sets the Vector3 "result" as the rotated Vector3 "localAxis" in the same rotation than the mesh. localAxis is expressed in the mesh local space. result is computed in the World space from the mesh World matrix.
Parameters
Returns TransformNode
this TransformNode.
get Distance To CameraSearch playground for getDistanceToCamera
get EngineSearch playground for getEngine
Gets the engine of the node
Returns Engine
a Engine
get Hierarchy Bounding VectorsSearch playground for getHierarchyBoundingVectors
Return the minimum and maximum world vectors of the entire hierarchy under current node
Parameters
Optional includeDescendants: boolean
Include bounding info from descendants as well (true by default)
Optional predicate: Nullable<((abstractMesh: AbstractMesh) => boolean)>
defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
Returns { max: Vector3; min: Vector3 }
the new bounding vectors
get Physics BodySearch playground for getPhysicsBody
Returns Nullable<PhysicsBody>
get Physics ShapeSearch playground for getPhysicsShape
Returns Nullable<PhysicsShape>
get Pivot MatrixSearch playground for getPivotMatrix
Returns the mesh pivot matrix. Default : Identity.
Returns Matrix
the matrix
get Pivot PointSearch playground for getPivotPoint
Returns a new Vector3 set with the mesh pivot point coordinates in the local space.
Returns Vector3
the pivot point
get Pivot Point To RefSearch playground for getPivotPointToRef
Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space.
Parameters
result: Vector3
the vector3 to store the result
Returns TransformNode
this TransformNode.
get Pose MatrixSearch playground for getPoseMatrix
Returns the mesh Pose matrix.
Returns Matrix
the pose matrix
get Position Expressed In Local SpaceSearch playground for getPositionExpressedInLocalSpace
Returns the mesh position in the local space from the current World matrix values.
Returns Vector3
a new Vector3.
get Position In Camera SpaceSearch playground for getPositionInCameraSpace
get SceneSearch playground for getScene
Gets the scene of the node
Returns Scene
a scene
get World MatrixSearch playground for getWorldMatrix
Returns the latest update of the World matrix
Returns Matrix
a Matrix
instantiate HierarchySearch playground for instantiateHierarchy
Instantiate (when possible) or clone that node with its hierarchy
Parameters
Optional newParent: Nullable<TransformNode>
defines the new parent to use for the instance (or clone)
Optional options: { doNotInstantiate: boolean | ((node: TransformNode) => boolean) }
defines options to configure how copy is done
do
Not Instantiate: boolean | ((node: TransformNode) => boolean) defines if the model must be instantiated or just cloned
Optional onNewNodeCreated: ((source: TransformNode, clone: TransformNode) => void)
defines an option callback to call when a clone or an instance is created
Parameters
source: TransformNode
clone: TransformNode
Returns void
Returns Nullable<TransformNode>
an instance (or a clone) of the current node with its hierarchy
is Descendant OfSearch playground for isDescendantOf
Is this node a descendant of the given node? The function will iterate up the hierarchy until the ancestor was found or no more parents defined
Parameters
ancestor: Node
defines the parent node to inspect
Returns boolean
a boolean indicating if this node is a descendant of the given node
is DisposedSearch playground for isDisposed
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is EnabledSearch playground for isEnabled
Is this node enabled? If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
Parameters
Optional checkAncestors: boolean
indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
Returns boolean
whether this node (and its parent) is enabled
is ReadySearch playground for isReady
Is this node ready to be used/rendered
Parameters
Optional _completeCheck: boolean
defines if a complete check (including materials and lights) has to be done (false by default)
Returns boolean
true if the node is ready
is Using Pivot MatrixSearch playground for isUsingPivotMatrix
return true if a pivot has been set
Returns boolean
true if a pivot matrix is used
is World Matrix Camera DependentSearch playground for isWorldMatrixCameraDependent
Returns whether the transform node world matrix computation needs the camera information to be computed. This is the case when the node is a billboard or has an infinite distance for instance.
Returns boolean
true if the world matrix computation needs the camera information to be computed
locally TranslateSearch playground for locallyTranslate
Translates the mesh along the passed Vector3 in its local space.
Parameters
vector3: Vector3
the distance to translate in localspace
Returns TransformNode
the TransformNode.
look AtSearch playground for lookAt
Orients a mesh towards a target point. Mesh must be drawn facing user.
Parameters
targetPoint: Vector3
the position (must be in same space as current mesh) to look at
Optional yawCor: number
optional yaw (y-axis) correction in radians
Optional pitchCor: number
optional pitch (x-axis) correction in radians
Optional rollCor: number
optional roll (z-axis) correction in radians
Optional space: Space
the chosen space of the target
Returns TransformNode
the TransformNode.
mark As DirtySearch playground for markAsDirty
Flag the transform node as dirty (Forcing it to update everything)
Parameters
Optional property: string
if set to "rotation" the objects rotationQuaternion will be set to null
Returns Node
this node
normalize To Unit CubeSearch playground for normalizeToUnitCube
Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
Parameters
Optional includeDescendants: boolean
Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
Optional ignoreRotation: boolean
ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
Optional predicate: Nullable<((node: AbstractMesh) => boolean)>
predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling
Returns TransformNode
the current mesh
register After World Matrix UpdateSearch playground for registerAfterWorldMatrixUpdate
If you'd like to be called back after the mesh position, rotation or scaling has been updated.
Parameters
func: ((mesh: TransformNode) => void)
callback function to add
Parameters
mesh: TransformNode
Returns void
Returns TransformNode
the TransformNode.
remove BehaviorSearch playground for removeBehavior
reset Local MatrixSearch playground for resetLocalMatrix
Resets this nodeTransform's local matrix to Matrix.Identity().
Parameters
Optional independentOfChildren: boolean
indicates if all child nodeTransform's world-space transform should be preserved.
Returns void
rotateSearch playground for rotate
Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in the given space. space (default LOCAL) can be either Space.LOCAL, either Space.WORLD. Note that the property
rotationQuaternion
is then automatically updated and the propertyrotation
is set to (0,0,0) and no longer used. The passed axis is also normalized.Parameters
axis: Vector3
the axis to rotate around
amount: number
the amount to rotate in radians
Optional space: Space
Space to rotate in (Default: local)
Returns TransformNode
the TransformNode.
rotate AroundSearch playground for rotateAround
Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space. Note that the property
rotationQuaternion
is then automatically updated and the propertyrotation
is set to (0,0,0) and no longer used. The passed axis is also normalized. . Method is based on http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htmParameters
point: Vector3
the point to rotate around
axis: Vector3
the axis to rotate around
amount: number
the amount to rotate in radians
Returns TransformNode
the TransformNode
serializeSearch playground for serialize
Serializes the objects information.
Parameters
Optional currentSerializationObject: any
defines the object to serialize in
Returns any
the serialized object
serialize Animation RangesSearch playground for serializeAnimationRanges
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set Absolute PositionSearch playground for setAbsolutePosition
Sets the mesh absolute position in the World from a Vector3 or an Array(3).
Parameters
absolutePosition: Vector3
the absolute position to set
Returns TransformNode
the TransformNode.
set DirectionSearch playground for setDirection
Sets this transform node rotation to the given local axis.
Parameters
localAxis: Vector3
the axis in local space
Optional yawCor: number
optional yaw (y-axis) correction in radians
Optional pitchCor: number
optional pitch (x-axis) correction in radians
Optional rollCor: number
optional roll (z-axis) correction in radians
Returns TransformNode
this TransformNode
set EnabledSearch playground for setEnabled
Set the enabled state of this node
Parameters
value: boolean
defines the new enabled state
Returns void
set ParentSearch playground for setParent
Defines the passed node as the parent of the current node. The node will remain exactly where it is and its position / rotation will be updated accordingly. Note that if the mesh has a pivot matrix / point defined it will be applied after the parent was updated. In that case the node will not remain in the same space as it is, as the pivot will be applied. To avoid this, you can set updatePivot to true and the pivot will be updated to identity
Parameters
node: Nullable<Node>
the node ot set as the parent
Optional preserveScalingSign: boolean
if true, keep scaling sign of child. Otherwise, scaling sign might change.
Optional updatePivot: boolean
if true, update the pivot matrix to keep the node in the same space as before
Returns TransformNode
this TransformNode.
set Pivot MatrixSearch playground for setPivotMatrix
Sets a new pivot matrix to the current node
Parameters
matrix: DeepImmutableObject<Matrix>
defines the new pivot matrix to use
Optional postMultiplyPivotMatrix: boolean
defines if the pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect
Returns TransformNode
the current TransformNode
set Pivot PointSearch playground for setPivotPoint
Sets a new pivot point to the current node
Parameters
point: Vector3
defines the new pivot point to use
Optional space: Space
defines if the point is in world or local space (local by default)
Returns TransformNode
the current TransformNode
set Position With Local VectorSearch playground for setPositionWithLocalVector
Sets the mesh position in its local space.
Parameters
vector3: Vector3
the position to set in localspace
Returns TransformNode
the TransformNode.
set Pre Transform MatrixSearch playground for setPreTransformMatrix
Sets a new matrix to apply before all other transformation
Parameters
matrix: Matrix
defines the transform matrix
Returns TransformNode
the current TransformNode
translateSearch playground for translate
Translates the mesh along the axis vector for the passed distance in the given space. space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
Parameters
axis: Vector3
the axis to translate in
distance: number
the distance to translate
Optional space: Space
Space to rotate in (Default: local)
Returns TransformNode
the TransformNode.
unfreeze World MatrixSearch playground for unfreezeWorldMatrix
Allows back the World matrix computation.
Returns TextureDome<T>
the TransformNode.
unregister After World Matrix UpdateSearch playground for unregisterAfterWorldMatrixUpdate
Removes a registered callback function.
Parameters
func: ((mesh: TransformNode) => void)
callback function to remove
Parameters
mesh: TransformNode
Returns void
Returns TransformNode
the TransformNode.
update Pose MatrixSearch playground for updatePoseMatrix
Copies the parameter passed Matrix into the mesh Pose matrix.
Parameters
matrix: Matrix
the matrix to copy the pose from
Returns TransformNode
this TransformNode.
Static Add Node ConstructorSearch playground for AddNodeConstructor
Add a new node constructor
Parameters
type: string
defines the type name of the node to construct
constructorFunc: NodeConstructor
defines the constructor function
Returns void
Static ConstructSearch playground for Construct
Returns a node constructor based on type name
Parameters
type: string
defines the type name
name: string
defines the new node name
scene: Scene
defines the hosting scene
Optional options: any
defines optional options to transmit to constructors
Returns Nullable<(() => Node)>
the new constructor or null
Static ParseSearch playground for Parse
Returns a new TransformNode object parsed from the source provided.
Parameters
parsedTransformNode: any
is the source.
scene: Scene
the scene the object belongs to
rootUrl: string
is a string, it's the root URL to prefix the
delayLoadingFile
property with
Returns TransformNode
a new TransformNode object parsed from the source provided.
Display a 360/180 degree texture on an approximately spherical surface, useful for VR applications or skyboxes. As a subclass of TransformNode, this allow parenting to the camera or multiple textures with different locations in the scene. This class achieves its effect with a Texture and a correctly configured BackgroundMaterial on an inverted sphere. Potential additions to this helper include zoom and and non-infinite distance rendering effects.