Creates an instance based on a source mesh.

Hierarchy

Constructors

Properties

Accessors

Methods

_removeLightSource _resyncLightSource _resyncLightSources addBehavior addChild addRotation alignWithNormal applyImpulse attachToBone beginAnimation buildBoundingInfo calcMovePOV calcRotatePOV clone computeWorldMatrix createAnimationRange createInstance createNormals deleteAnimationRange detachFromBone disableEdgesRendering disableFacetData dispose enableEdgesRendering freezeWorldMatrix getAbsolutePivotPoint getAbsolutePivotPointToRef getAbsolutePosition getAnimationByName getAnimationRange getAnimationRanges getBehaviorByName getBoundingInfo getChildMeshes getChildTransformNodes getChildren getClassName getClosestFacetAtCoordinates getClosestFacetAtLocalCoordinates getConnectedParticleSystems getDescendants getDirection getDirectionToRef getDistanceToCamera getEngine getFacetDataParameters getFacetLocalNormals getFacetLocalPartitioning getFacetLocalPositions getFacetNormal getFacetNormalToRef getFacetPosition getFacetPositionToRef getFacetsAtLocalCoordinates getHierarchyBoundingVectors getIndices getLOD getMaterialForRenderPass getMeshUniformBuffer getNormalsData getPhysicsBody getPhysicsImpostor getPivotMatrix getPivotPoint getPivotPointToRef getPoseMatrix getPositionData getPositionExpressedInLocalSpace getPositionInCameraSpace getRawBoundingInfo getScene getTotalIndices getTotalVertices getVerticesData getWorldMatrix instantiateHierarchy intersects intersectsMesh intersectsPoint isCompletelyInFrustum isDescendantOf isDisposed isEnabled isInFrustum isReady isUsingPivotMatrix isVerticesDataPresent isWorldMatrixCameraDependent locallyTranslate lookAt markAsDirty movePOV moveWithCollisions normalizeToUnitCube refreshBoundingInfo registerAfterWorldMatrixUpdate releaseSubMeshes removeBehavior removeChild resetDrawCache resetLocalMatrix rotate rotateAround rotatePOV serialize serializeAnimationRanges setAbsolutePosition setBoundingInfo setDirection setEnabled setIndices setMaterialForRenderPass setParent setPhysicsLinkWith setPivotMatrix setPivotPoint setPositionWithLocalVector setPreTransformMatrix setVerticesData toString transferToEffect translate unfreezeWorldMatrix unregisterAfterWorldMatrixUpdate updateFacetData updateIndices updatePoseMatrix updateVerticesData AddNodeConstructor Construct Parse ParseAnimationRanges

Constructors

  • Creates a new InstancedMesh object from the mesh source.

    Parameters

    • name: string

      defines the name of the instance

    • source: Mesh

      the mesh to create the instance from

    Returns InstancedMesh

Properties

actionManager: Nullable<AbstractActionManager>

Gets or sets the current action manager

See

https://doc.babylonjs.com/features/featuresDeepDive/events/actions

alphaIndex: number
alwaysSelectAsActiveMesh: boolean

True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase)

animations: BabylonAnimation[]

Gets a list of Animations associated with the node

cullingStrategy: number

The culling strategy to use to check whether the mesh must be rendered or not. This value can be changed at any time and will be used on the next render mesh selection. The possible values are :

  • AbstractMesh.CULLINGSTRATEGY_STANDARD
  • AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
  • AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION
  • AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY Please read each static variable documentation to get details about the culling process.
decalMap: Nullable<MeshUVSpaceRenderer>

Gets or sets the decal map for this mesh

definedFacingForward: boolean

Gets or sets the orientation for POV movement & rotation

doNotSyncBoundingInfo: boolean

Gets or sets a boolean indicating that the bounding info does not need to be kept in sync (for performance reason)

edgesColor: Color4

Defines edge color used when edgesRenderer is enabled

See

https://www.babylonjs-playground.com/#10OJSG#13

edgesRenderer: Nullable<EdgesRenderer>

Gets the edgesRenderer associated with the mesh

edgesWidth: number

Defines edge width used when edgesRenderer is enabled

See

https://www.babylonjs-playground.com/#10OJSG#13

ellipsoid: Vector3

Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))

See

https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions

ellipsoidOffset: Vector3

Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))

See

https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions

enablePointerMoveEvents: boolean

Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)

id: string

Gets or sets the id of the node

ignoreNonUniformScaling: boolean

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

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

See

https://doc.babylonjs.com/toolsAndResources/inspector#extensibility

instancedBuffers: { [key: string]: any }

Object used to store instanced buffers defined by user

See

https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances#custom-buffers

Type declaration

  • [key: string]: any
isBlocker: boolean

Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)

See

https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare

isNearGrabbable: boolean

Gets or sets a boolean indicating if the mesh can be near grabbed. Default is false

isNearPickable: boolean

Gets or sets a boolean indicating if the mesh can be near picked. Default is false

isPickable: boolean

Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true

isVisible: boolean

Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true

metadata: any

Gets or sets an object used to store user defined information for the node

name: string

Gets or sets the name of the node

onAccessibilityTagChangedObservable: Observable<Nullable<IAccessibilityTag>>
onAfterWorldMatrixUpdateObservable: Observable<TransformNode>

An event triggered after the world matrix is updated

onCollideObservable: Observable<AbstractMesh>

An event triggered when this mesh collides with another one

onCollisionPositionChangeObservable: Observable<Vector3>

An event triggered when the collision's position changes

onDisposeObservable: Observable<Node>

An event triggered when the mesh is disposed

onMaterialChangedObservable: Observable<AbstractMesh>

An event triggered when material is changed

onReady: Nullable<((node: Node) => void)>

Callback raised when the node is ready to be used

onRebuildObservable: Observable<AbstractMesh>

An event triggered when the mesh is rebuilt.

outlineColor: Color3

Defines color to use when rendering outline

outlineWidth: number

Define width to use when rendering outline

overlayAlpha: number

Defines alpha to use when rendering overlay

overlayColor: Color3

Defines color to use when rendering overlay

physicsBody: Nullable<PhysicsBody>

See

physicsImpostor: Nullable<PhysicsImpostor>

Gets or sets impostor used for physic simulation

See

https://doc.babylonjs.com/features/featuresDeepDive/physics

reIntegrateRotationIntoRotationQuaternion: boolean

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

reservedDataStore: any

For internal use only. Please do not use.

scalingDeterminant: number

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

showBoundingBox: boolean

Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)

showSubMeshesBoundingBox: boolean

Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default)

state: string

Gets or sets a string used to store user defined state for the node

subMeshes: SubMesh[]
uniqueId: number

Gets or sets the unique id of the node

useOctreeForCollisions: boolean

Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default)

useOctreeForPicking: boolean

Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes picking (true by default)

useOctreeForRenderingSelection: boolean

Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default)

BillboardUseParentOrientation: boolean

Child transform with Billboard flags should or should not apply parent rotation (default if off)

CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY: 1 = 1

Culling strategy : Bounding Sphere Only. This is an exclusion test. It's faster than the standard strategy because the bounding box is not tested. It's also less accurate than the standard because some not visible objects can still be selected. Test : is the bounding sphere outside the frustum ? If not, then the cullable object is in the frustum.

CULLINGSTRATEGY_OPTIMISTIC_INCLUSION: 2 = 2

Culling strategy : Optimistic Inclusion. This in an inclusion test first, then the standard exclusion test. This can be faster when a cullable object is expected to be almost always in the camera frustum. This could also be a little slower than the standard test when the tested object center is not the frustum but one of its bounding box vertex is still inside. Anyway, it's as accurate as the standard strategy. Test : Is the cullable object bounding sphere center in the frustum ? If not, apply the default culling strategy.

CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY: 3 = 3

Culling strategy : Optimistic Inclusion then Bounding Sphere Only. This in an inclusion test first, then the bounding sphere only exclusion test. This can be the fastest test when a cullable object is expected to be almost always in the camera frustum. This could also be a little slower than the BoundingSphereOnly strategy when the tested object center is not in the frustum but its bounding sphere still intersects it. It's less accurate than the standard strategy and as accurate as the BoundingSphereOnly strategy. Test : Is the cullable object bounding sphere center in the frustum ? If not, apply the Bounding Sphere Only strategy. No Bounding Box is tested here.

CULLINGSTRATEGY_STANDARD: 0 = 0

Default culling strategy : this is an exclusion test and it's the more accurate. Test order : Is the bounding sphere outside the frustum ? If not, are the bounding box vertices outside the frustum ? It not, then the cullable object is in the frustum.

OCCLUSION_ALGORITHM_TYPE_ACCURATE: number

Use an accurate occlusion algorithm

OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE: number

Use a conservative occlusion algorithm

OCCLUSION_TYPE_NONE: number

No occlusion

OCCLUSION_TYPE_OPTIMISTIC: number

Occlusion set to optimistic

OCCLUSION_TYPE_STRICT: number

Occlusion set to strict

Accessors

  • get _positions(): Nullable<Vector3[]>
  • Returns Nullable<Vector3[]>

  • get absolutePosition(): Vector3
  • Returns the current mesh absolute position. Returns a Vector3.

    Returns Vector3

  • get absoluteRotationQuaternion(): Quaternion
  • Returns the current mesh absolute rotation. Returns a Quaternion.

    Returns Quaternion

  • get absoluteScaling(): Vector3
  • Returns the current mesh absolute scaling. Returns a Vector3.

    Returns Vector3

  • get accessibilityTag(): Nullable<IAccessibilityTag>
  • Returns Nullable<IAccessibilityTag>

  • set accessibilityTag(value: Nullable<IAccessibilityTag>): void
  • Gets or sets the accessibility tag to describe the node for accessibility purpose.

    Parameters

    • value: Nullable<IAccessibilityTag>

    Returns void

  • get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride>
  • Gets or sets the animation properties override

    Returns Nullable<AnimationPropertiesOverride>

  • set animationPropertiesOverride(value: Nullable<AnimationPropertiesOverride>): void
  • Parameters

    • value: Nullable<AnimationPropertiesOverride>

    Returns void

  • get applyFog(): boolean
  • Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default)

    Returns boolean

  • set applyFog(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get bakedVertexAnimationManager(): Nullable<IBakedVertexAnimationManager>
  • Returns Nullable<IBakedVertexAnimationManager>

  • set bakedVertexAnimationManager(value: Nullable<IBakedVertexAnimationManager>): void
  • Parameters

    • value: Nullable<IBakedVertexAnimationManager>

    Returns void

  • get billboardMode(): 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

    Returns number

  • set billboardMode(value: number): void
  • Parameters

    • value: number

    Returns void

  • get checkCollisions(): boolean
  • Gets or sets a boolean indicating that this mesh can be used in the collision engine

    See

    https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions

    Returns boolean

  • set checkCollisions(collisionEnabled: boolean): void
  • Parameters

    • collisionEnabled: boolean

    Returns void

  • get collisionGroup(): number
  • Gets or sets the current collision group mask (-1 by default). A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0

    Returns number

  • set collisionGroup(mask: number): void
  • Parameters

    • mask: number

    Returns void

  • get collisionMask(): number
  • Gets or sets a collision mask used to mask collisions (default is -1). A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0

    Returns number

  • set collisionMask(mask: number): void
  • Parameters

    • mask: number

    Returns void

  • get collisionResponse(): boolean
  • Gets or sets a collision response flag (default is true). when collisionResponse is false, events are still triggered but colliding entity has no response This helps creating trigger volume when user wants collision feedback events but not position/velocity to respond to the collision.

    Returns boolean

  • set collisionResponse(response: boolean): void
  • Parameters

    • response: boolean

    Returns void

  • get collisionRetryCount(): number
  • number of collision detection tries. Change this value if not all collisions are detected and handled properly

    Returns number

  • set collisionRetryCount(retryCount: number): void
  • Parameters

    • retryCount: number

    Returns void

  • get computeBonesUsingShaders(): boolean
  • Gets or sets a boolean indicating that bone animations must be computed by the GPU (true by default)

    Returns boolean

  • set computeBonesUsingShaders(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get doNotSerialize(): boolean
  • Gets or sets a boolean used to define if the node must be serialized

    Returns boolean

  • set doNotSerialize(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get enableDistantPicking(): boolean
  • When enabled, decompose picking matrices for better precision with large values for mesh position and scling

    Returns boolean

  • set enableDistantPicking(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get facetDepthSortFrom(): Vector3
  • The location (Vector3) where the facet depth sort must be computed from. By default, the active camera position. Used only when facet depth sort is enabled

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort

    Returns Vector3

  • set facetDepthSortFrom(location: Vector3): void
  • Parameters

    Returns void

  • get forward(): Vector3
  • The forward direction of that transform in world space.

    Returns Vector3

  • get hasBoundingInfo(): boolean
  • Returns true if there is already a bounding info

    Returns boolean

  • get hasInstances(): boolean
  • Gets a boolean indicating if this mesh has instances

    Returns boolean

  • get hasThinInstances(): boolean
  • Gets a boolean indicating if this mesh has thin instances

    Returns boolean

  • get hasVertexAlpha(): boolean
  • Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values

    Returns boolean

  • set hasVertexAlpha(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get infiniteDistance(): boolean
  • Gets or sets the distance of the object to max, often used by skybox

    Returns boolean

  • set infiniteDistance(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get isAnInstance(): boolean
  • Gets a boolean indicating if this mesh is an instance or a regular mesh

    Returns boolean

  • get isBlocked(): boolean
  • Returns true if the mesh is blocked. Implemented by child classes

    Returns boolean

  • get isWorldMatrixFrozen(): boolean
  • True if the World matrix has been frozen.

    Returns boolean

  • get layerMask(): number
  • Gets or sets the current layer mask (default is 0x0FFFFFFF)

    See

    https://doc.babylonjs.com/features/featuresDeepDive/cameras/layerMasksAndMultiCam

    Returns number

  • set layerMask(value: number): void
  • Parameters

    • value: number

    Returns void

  • get lightSources(): Light[]
  • Gets the list of lights affecting that mesh

    Returns Light[]

  • get material(): Nullable<Material>
  • The material of the source mesh

    Returns Nullable<Material>

  • set material(_value: Nullable<Material>): void
  • Parameters

    Returns void

  • get morphTargetManager(): Nullable<MorphTargetManager>
  • Returns Nullable<MorphTargetManager>

  • set morphTargetManager(value: Nullable<MorphTargetManager>): void
  • Parameters

    • value: Nullable<MorphTargetManager>

    Returns void

  • get mustDepthSortFacets(): boolean
  • Gets or sets a boolean indicating that the facets must be depth sorted on next call to updateFacetData(). Works only for updatable meshes. Doesn't work with multi-materials

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort

    Returns boolean

  • set mustDepthSortFacets(sort: boolean): void
  • Parameters

    • sort: boolean

    Returns void

  • get nonUniformScaling(): boolean
  • True if the scaling property of this object is non uniform eg. (1,2,1)

    Returns boolean

  • get numBoneInfluencers(): number
  • Gets or sets the number of allowed bone influences per vertex (4 by default)

    Returns number

  • set numBoneInfluencers(value: number): void
  • Parameters

    • value: number

    Returns void

  • get onClonedObservable(): Observable<Node>
  • An event triggered when the node is cloned

    Returns Observable<Node>

  • set onCollide(callback: ((collidedMesh?: AbstractMesh) => void)): void
  • Set a function to call when this mesh collides with another one

    Parameters

    Returns void

  • set onCollisionPositionChange(callback: (() => void)): void
  • Set a function to call when the collision's position changes

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • set onDispose(callback: (() => void)): void
  • Sets a callback that will be raised when the node will be disposed

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • get onEnabledStateChangedObservable(): Observable<boolean>
  • An event triggered when the enabled state of the node changes

    Returns Observable<boolean>

  • get partitioningBBoxRatio(): number
  • The ratio (float) to apply to the bounding box size to set to the partitioning space. Ex : 1.01 (default) the partitioning space is 1% bigger than the bounding box

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning

    Returns number

  • set partitioningBBoxRatio(ratio: number): void
  • Parameters

    • ratio: number

    Returns void

  • get partitioningSubdivisions(): number
  • Gets or set the number (integer) of subdivisions per axis in the partitioning space

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning

    Returns number

  • set partitioningSubdivisions(nb: number): void
  • Parameters

    • nb: number

    Returns void

  • get pointerOverDisableMeshTesting(): boolean
  • Gets or sets the property which disables the test that is checking that the mesh under the pointer is the same than the previous time we tested for it (default: false). Set this property to true if you want thin instances picking to be reported accurately when moving over the mesh. Note that setting this property to true will incur some performance penalties when dealing with pointer events for this mesh so use it sparingly.

    Returns boolean

  • set pointerOverDisableMeshTesting(disable: boolean): void
  • Parameters

    • disable: boolean

    Returns void

  • get position(): Vector3
  • Gets or set the node position (default is (0.0, 0.0, 0.0))

    Returns Vector3

  • set position(newPosition: Vector3): void
  • Parameters

    Returns void

  • get preserveParentRotationForBillboard(): 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

    Returns boolean

  • set preserveParentRotationForBillboard(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • set rawBoundingInfo(boundingInfo: Nullable<BoundingInfo>): void
  • Parameters

    • boundingInfo: Nullable<BoundingInfo>

    Returns void

  • get receiveShadows(): boolean
  • If the source mesh receives shadows

    Returns boolean

  • set receiveShadows(_value: boolean): void
  • Parameters

    • _value: boolean

    Returns void

  • get renderingGroupId(): number
  • Rendering ground id of the source mesh

    Returns number

  • set renderingGroupId(value: number): void
  • Parameters

    • value: number

    Returns void

  • get right(): Vector3
  • The right direction of that transform in world space.

    Returns Vector3

  • get rotation(): 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

    Returns Vector3

  • set rotation(newRotation: Vector3): void
  • Parameters

    Returns void

  • get rotationQuaternion(): 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)

    Returns Nullable<Quaternion>

  • set rotationQuaternion(quaternion: Nullable<Quaternion>): void
  • Parameters

    • quaternion: Nullable<Quaternion>

    Returns void

  • get scaling(): 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)).

    Returns Vector3

  • set scaling(newScaling: Vector3): void
  • Parameters

    Returns void

  • get skeleton(): Nullable<Skeleton>
  • Skeleton of the source mesh

    Returns Nullable<Skeleton>

  • set skeleton(_value: Nullable<Skeleton>): void
  • Gets or sets a skeleton to apply skinning transformations

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons

    Parameters

    • _value: Nullable<Skeleton>

    Returns void

  • get sourceMesh(): Mesh
  • The source mesh of the instance

    Returns Mesh

  • get surroundingMeshes(): Nullable<AbstractMesh[]>
  • Gets or sets current surrounding meshes (null by default).

    By default collision detection is tested against every mesh in the scene. It is possible to set surroundingMeshes to a defined list of meshes and then only these specified meshes will be tested for the collision.

    Note: if set to an empty array no collision will happen when this mesh is moved.

    Returns Nullable<AbstractMesh[]>

  • set surroundingMeshes(meshes: Nullable<AbstractMesh[]>): void
  • Parameters

    Returns void

  • get up(): Vector3
  • The up direction of that transform in world space.

    Returns Vector3

  • get useBones(): boolean
  • Gets a boolean indicating if this mesh has skinning data and an attached skeleton

    Returns boolean

  • get useVertexColors(): boolean
  • Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry)

    Returns boolean

  • set useVertexColors(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get visibility(): number
  • Visibility of the source mesh

    Returns number

  • set visibility(_value: number): void
  • Gets or sets mesh visibility between 0 and 1 (default is 1)

    Parameters

    • _value: number

    Returns void

  • get worldMatrixFromCache(): Matrix
  • Returns directly the latest state of the mesh World matrix. A Matrix is returned.

    Returns Matrix

  • get BILLBOARDMODE_ALL(): number
  • Billboard on all axes

    Returns number

  • get BILLBOARDMODE_NONE(): number
  • No billboard

    Returns number

  • get BILLBOARDMODE_USE_POSITION(): number
  • Billboard on using position instead of orientation

    Returns number

  • get BILLBOARDMODE_X(): number
  • Billboard on X axis

    Returns number

  • get BILLBOARDMODE_Y(): number
  • Billboard on Y axis

    Returns number

  • get BILLBOARDMODE_Z(): number
  • Billboard on Z axis

    Returns number

Methods

  • Returns void

  • Returns void

  • Returns void

  • Adds the passed mesh as a child to the current mesh

    Returns

    the current mesh

    Parameters

    • mesh: AbstractMesh

      defines the child mesh

    • Optional preserveScalingSign: boolean

      if true, keep scaling sign of child. Otherwise, scaling sign might change.

    Returns AbstractMesh

  • 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.

    Returns

    the TransformNode.

    Parameters

    • x: number

      Rotation to add

    • y: number

      Rotation to add

    • z: number

      Rotation to add

    Returns TransformNode

  • Align the mesh with a normal

    Returns

    the current mesh

    Parameters

    • normal: Vector3

      defines the normal to use

    • Optional upDirection: Vector3

      can be used to redefined the up vector to use (will use the (0, 1, 0) by default)

    Returns AbstractMesh

  • Attach the current TransformNode to another TransformNode associated with a bone

    Returns

    this object

    Parameters

    • bone: Bone

      Bone affecting the TransformNode

    • affectedTransformNode: TransformNode

      TransformNode associated with the bone

    Returns TransformNode

  • Will start the animation sequence

    Returns

    the object created for this animation. If range does not exist, it will return null

    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)

        • (): void
        • Returns void

    Returns Nullable<Animatable>

  • Creates a new bounding info for the mesh

    Returns

    the new bounding info

    Parameters

    • minimum: DeepImmutableObject<Vector3>

      min vector of the bounding box/sphere

    • maximum: DeepImmutableObject<Vector3>

      max vector of the bounding box/sphere

    • Optional worldMatrix: DeepImmutableObject<Matrix>

      defines the new world matrix

    Returns BoundingInfo

  • Calculate relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.

    Returns

    the new displacement vector

    Parameters

    • amountRight: number

      defines the distance on the right axis

    • amountUp: number

      defines the distance on the up axis

    • amountForward: number

      defines the distance on the forward axis

    Returns Vector3

  • Calculate relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.

    Returns

    the new rotation vector

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns Vector3

  • Creates a new InstancedMesh from the current mesh.

    Returns the clone.

    Returns

    the clone

    Parameters

    • name: string

      the cloned mesh name

    • Optional newParent: Nullable<Node>

      the optional Node to parent the clone to.

    • Optional doNotCloneChildren: boolean

      if true the model children aren't cloned.

    • Optional newSourceMesh: Mesh

      if set this mesh will be used as the source mesh instead of ths instance's one

    Returns InstancedMesh

  • Computes the world matrix of the node

    Returns

    the world matrix

    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

  • 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

  • Creates new normals data for the mesh

    Returns

    the current mesh

    Parameters

    • updatable: boolean

      defines if the normal vertex buffer must be flagged as updatable

    Returns AbstractMesh

  • 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 the transform node if its associated with a bone

    Returns

    this object

    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

  • Disposes the InstancedMesh. Returns nothing.

    Parameters

    • Optional doNotRecurse: boolean
    • Optional disposeMaterialAndTextures: boolean

    Returns void

  • Enables the edge rendering mode on the mesh. This mode makes the mesh edges visible

    Returns

    the currentAbstractMesh

    See

    https://www.babylonjs-playground.com/#19O9TU#0

    Parameters

    • Optional epsilon: number

      defines the maximal distance between two angles to detect a face

    • Optional checkVerticesInsteadOfIndices: boolean

      indicates that we should check vertex list directly instead of faces

    • Optional options: IEdgesRendererOptions

      options to the edge renderer

    Returns AbstractMesh

  • Prevents the World matrix to be computed any longer

    Returns

    the TransformNode.

    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

  • Returns a new Vector3 set with the mesh pivot point World coordinates.

    Returns

    a new Vector3 set with the mesh pivot point World coordinates.

    Returns Vector3

  • Returns the mesh absolute position in the World.

    Returns

    a Vector3.

    Returns Vector3

  • Get an animation by name

    Returns

    null if not found else the requested animation

    Parameters

    • name: string

      defines the name of the animation to look for

    Returns Nullable<BabylonAnimation>

  • Get an animation range by name

    Returns

    null if not found else the requested animation range

    Parameters

    • name: string

      defines the name of the animation range to look for

    Returns Nullable<AnimationRange>

  • Gets the list of all animation ranges defined on this node

    Returns

    an array

    Returns Nullable<AnimationRange>[]

  • Returns the mesh BoundingInfo object or creates a new one and returns if it was undefined. Note that it returns a shallow bounding of the mesh (i.e. it does not include children). However, if the mesh contains thin instances, it will be expanded to include them. If you want the "raw" bounding data instead, then use getRawBoundingInfo(). To get the full bounding of all children, call getHierarchyBoundingVectors instead.

    Returns

    a BoundingInfo

    Returns BoundingInfo

  • Get all child-meshes of this node

    Returns

    an array of AbstractMesh

    Type Parameters

    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

        • (node: Node): node is T
        • Parameters

          Returns node is T

    Returns T[]

  • Get all child-meshes of this node

    Returns

    an array of AbstractMesh

    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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns AbstractMesh[]

  • Get all child-transformNodes of this node

    Returns

    an array of TransformNode

    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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns TransformNode[]

  • Get all direct children of this node

    Returns

    an array of Node

    Type Parameters

    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

        • (node: Node): node is T
        • Parameters

          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[]

  • Get all direct children of this node

    Returns

    an array of 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

        • (node: Node): boolean
        • Parameters

          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[]

  • Returns the string "InstancedMesh".

    Returns string

  • Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found

    Returns

    the face index if found (or null instead)

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    • Optional projected: Vector3

      sets as the (x,y,z) world projection on the facet

    • Optional checkFace: boolean

      if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned

    • Optional facing: boolean

      if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position

    Returns Nullable<number>

  • Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found

    Returns

    the face index if found (or null instead)

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    • Optional projected: Vector3

      sets as the (x,y,z) local projection on the facet

    • Optional checkFace: boolean

      if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned

    • Optional facing: boolean

      if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position

    Returns Nullable<number>

  • This function returns all of the particle systems in the scene that use the mesh as an emitter.

    Returns

    an array of particle systems in the scene that use the mesh as an emitter

    Returns IParticleSystem[]

  • Will return all nodes that have this node as ascendant

    Returns

    all children nodes of all types

    Type Parameters

    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

        • (node: Node): node is T
        • Parameters

          Returns node is T

    Returns T[]

  • Will return all nodes that have this node as ascendant

    Returns

    all children nodes of all types

    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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns Node[]

  • 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.

    Returns

    a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.

    Parameters

    • localAxis: Vector3

      axis to rotate

    Returns Vector3

  • 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.

    Returns

    this TransformNode.

    Parameters

    • localAxis: Vector3

      axis to rotate

    • result: Vector3

      the resulting transformnode

    Returns TransformNode

  • Returns the distance from the mesh to the active camera

    Returns

    the distance

    Parameters

    • Optional camera: Nullable<Camera>

      defines the camera to use

    Returns number

  • Gets the engine of the node

    Returns

    a Engine

    Returns Engine

  • Returns the facets (in an array) in the same partitioning block than the one the passed coordinates are located (expressed in the mesh local system)

    Returns

    the array of facet indexes

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    Returns Nullable<number[]>

  • Return the minimum and maximum world vectors of the entire hierarchy under current node

    Returns

    the new bounding vectors

    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 }

  • Returns an array of indices (IndicesArray).

    Returns Nullable<IndicesArray>

  • Returns the current associated LOD AbstractMesh.

    Parameters

    • camera: Camera

    Returns AbstractMesh

  • Gets the material used to render the mesh in a specific render pass

    Returns

    material used for the render pass. If no specific material is used for this render pass, undefined is returned (meaning mesh.material is used for this pass)

    Parameters

    • renderPassId: number

      render pass id

    Returns undefined | Material

  • Gets the mesh uniform buffer.

    Returns

    the uniform buffer of the mesh.

    Returns UniformBuffer

  • Get the normals vertex data and optionally apply skeleton and morphing.

    Returns

    the normals data

    Parameters

    • Optional applySkeleton: boolean

      defines whether to apply the skeleton

    • Optional applyMorph: boolean

      defines whether to apply the morph target

    Returns Nullable<FloatArray>

  • Returns Nullable<PhysicsBody>

  • Returns the mesh pivot matrix. Default : Identity.

    Returns

    the matrix

    Returns Matrix

  • Returns a new Vector3 set with the mesh pivot point coordinates in the local space.

    Returns

    the pivot point

    Returns Vector3

  • Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space.

    Returns

    this TransformNode.

    Parameters

    • result: Vector3

      the vector3 to store the result

    Returns TransformNode

  • Returns the mesh Pose matrix.

    Returns

    the pose matrix

    Returns Matrix

  • Get the position vertex data and optionally apply skeleton and morphing.

    Returns

    the position data

    Parameters

    • Optional applySkeleton: boolean

      defines whether to apply the skeleton

    • Optional applyMorph: boolean

      defines whether to apply the morph target

    • Optional data: Nullable<FloatArray>

      defines the position data to apply the skeleton and morph to

    Returns Nullable<FloatArray>

  • Returns the mesh position in the local space from the current World matrix values.

    Returns

    a new Vector3.

    Returns Vector3

  • Gets the position of the current mesh in camera space

    Returns

    a position

    Parameters

    • Optional camera: Nullable<Camera>

      defines the camera to use

    Returns Vector3

  • Returns the bounding info unnafected by instance data.

    Returns

    the bounding info of the mesh unaffected by instance data.

    Returns BoundingInfo

  • Gets the scene of the node

    Returns

    a scene

    Returns Scene

  • Returns a positive integer : the total number of indices in this mesh geometry.

    Returns

    the number of indices or zero if the mesh has no geometry.

    Returns number

  • Returns the total number of vertices (integer).

    Returns number

  • Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.

    Returns

    a float array or a Float32Array of the requested kind of data : positions, normals, uvs, etc.

    Parameters

    • kind: string

      kind of verticies to retrieve (eg. positions, normals, uvs, etc.)

    • Optional copyWhenShared: boolean

      If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.

    • Optional forceCopy: boolean

      defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is

    Returns Nullable<FloatArray>

  • Gets the current world matrix

    Returns

    a Matrix

    Returns Matrix

  • Instantiate (when possible) or clone that node with its hierarchy

    Returns

    an instance (or a clone) of the current 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); newSourcedMesh?: Mesh }

      defines options to configure how copy is done

      • doNotInstantiate: boolean | ((node: TransformNode) => boolean)

        defines if the model must be instantiated or just cloned

      • Optional newSourcedMesh?: Mesh

        newSourcedMesh the new source mesh for the instance (or clone)

    • Optional onNewNodeCreated: ((source: TransformNode, clone: TransformNode) => void)

      defines an option callback to call when a clone or an instance is created

    Returns Nullable<TransformNode>

  • Checks if the passed Ray intersects with the mesh. A mesh triangle can be picked both from its front and back sides, irrespective of orientation.

    Returns

    the picking info

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect

    Parameters

    • ray: Ray

      defines the ray to use. It should be in the mesh's LOCAL coordinate space.

    • Optional fastCheck: boolean

      defines if fast mode (but less precise) must be used (false by default)

    • Optional trianglePredicate: TrianglePickingPredicate

      defines an optional predicate used to select faces when a mesh intersection is detected

    • Optional onlyBoundingInfo: boolean

      defines a boolean indicating if picking should only happen using bounding info (false by default)

    • Optional worldToUse: Matrix

      defines the world matrix to use to get the world coordinate of the intersection point

    • Optional skipBoundingInfo: boolean

      a boolean indicating if we should skip the bounding info check

    Returns PickingInfo

  • True if the mesh intersects another mesh or a SolidParticle object

    Returns

    true if there is an intersection

    Parameters

    • mesh: AbstractMesh | SolidParticle

      defines a target mesh or SolidParticle to test

    • Optional precise: boolean

      Unless the parameter precise is set to true the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)

    • Optional includeDescendants: boolean

      Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes

    Returns boolean

  • Returns true if the passed point (Vector3) is inside the mesh bounding box

    Returns

    true if there is an intersection

    Parameters

    • point: Vector3

      defines the point to test

    Returns boolean

  • Returns true if the mesh is completely in the frustum defined be the passed array of planes. A mesh is completely in the frustum if its bounding box it completely inside the frustum.

    Returns

    true if the mesh is completely in the frustum planes

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum to test

    Returns boolean

  • 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

    Returns

    a boolean indicating if this node is a descendant of the given node

    Parameters

    • ancestor: Node

      defines the parent node to inspect

    Returns boolean

  • Gets a boolean indicating if the node has been disposed

    Returns

    true if the node was disposed

    Returns boolean

  • 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

    Returns

    whether this node (and its parent) is enabled

    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

  • Returns true if the mesh is within the frustum defined by the passed array of planes. A mesh is in the frustum if its bounding box intersects the frustum

    Returns

    true if the mesh is in the frustum planes

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum to test

    Returns boolean

  • Is this node ready to be used/rendered

    Returns

    is it ready

    Parameters

    • Optional completeCheck: boolean

      defines if a complete check (including materials and lights) has to be done (false by default)

    Returns boolean

  • return true if a pivot has been set

    Returns

    true if a pivot matrix is used

    Returns boolean

  • Boolean : True if the mesh owns the requested kind of data.

    Parameters

    • kind: string

    Returns boolean

  • 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

    true if the world matrix computation needs the camera information to be computed

    Returns boolean

  • Translates the mesh along the passed Vector3 in its local space.

    Returns

    the TransformNode.

    Parameters

    • vector3: Vector3

      the distance to translate in localspace

    Returns TransformNode

  • Orients a mesh towards a target point. Mesh must be drawn facing user.

    Returns

    the TransformNode.

    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

  • Flag the AbstractMesh as dirty (Forcing it to update everything)

    Returns

    this AbstractMesh

    Parameters

    • Optional property: string

      if set to "rotation" the objects rotationQuaternion will be set to null

    Returns AbstractMesh

  • Perform relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.

    Returns

    the current mesh

    Parameters

    • amountRight: number

      defines the distance on the right axis

    • amountUp: number

      defines the distance on the up axis

    • amountForward: number

      defines the distance on the forward axis

    Returns AbstractMesh

  • Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)

    Returns

    the current mesh

    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 AbstractMesh

  • This method recomputes and sets a new BoundingInfo to the mesh unless it is locked. This means the mesh underlying bounding box and sphere are recomputed.

    Returns

    the current mesh

    Parameters

    • Optional applySkeleton: boolean

      defines whether to apply the skeleton before computing the bounding info

    • Optional applyMorph: boolean

      defines whether to apply the morph target before computing the bounding info

    Returns InstancedMesh

  • Removes the passed mesh from the current mesh children list

    Returns

    the current mesh

    Parameters

    • mesh: AbstractMesh

      defines the child mesh

    • Optional preserveScalingSign: boolean

      if true, keep scaling sign of child. Otherwise, scaling sign might change.

    Returns AbstractMesh

  • Resets the draw wrappers cache for all submeshes of this abstract mesh

    Parameters

    • Optional passId: number

      If provided, releases only the draw wrapper corresponding to this render pass id

    Returns void

  • 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

  • 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 property rotation is set to (0,0,0) and no longer used. The passed axis is also normalized.

    Returns

    the TransformNode.

    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

  • Perform relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.

    Returns

    the current mesh

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns AbstractMesh

  • Serializes the objects information.

    Returns

    the serialized object

    Parameters

    • Optional currentSerializationObject: any

      defines the object to serialize in

    Returns any

  • Serialize animation ranges into a JSON compatible object

    Returns

    serialization object

    Returns any

  • Sets the mesh absolute position in the World from a Vector3 or an Array(3).

    Returns

    the TransformNode.

    Parameters

    • absolutePosition: Vector3

      the absolute position to set

    Returns TransformNode

  • Overwrite the current bounding info

    Returns

    the current mesh

    Parameters

    • boundingInfo: BoundingInfo

      defines the new bounding info

    Returns AbstractMesh

  • Sets this transform node rotation to the given local axis.

    Returns

    this TransformNode

    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

  • Set the enabled state of this node

    Parameters

    • value: boolean

      defines the new enabled state

    Returns void

  • Sets the mesh indices. Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array). If the mesh has no geometry, a new Geometry object is created and set to the mesh. This method creates a new index buffer each call. Returns the Mesh.

    Parameters

    • indices: IndicesArray
    • Optional totalVertices: Nullable<number>

    Returns Mesh

  • Sets the material to be used to render the mesh in a specific render pass

    Parameters

    • renderPassId: number

      render pass id

    • Optional material: Material

      material to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)

    Returns void

  • 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

    See

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent

    Returns

    this TransformNode.

    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

  • Sets a new pivot matrix to the current node

    Returns

    the current TransformNode

    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

  • Sets a new pivot point to the current node

    Returns

    the current TransformNode

    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

  • Sets a new matrix to apply before all other transformation

    Returns

    the current TransformNode

    Parameters

    • matrix: Matrix

      defines the transform matrix

    Returns TransformNode

  • Sets the vertex data of the mesh geometry for the requested kind. If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data. The data are either a numeric array either a Float32Array. The parameter updatable is passed as is to the underlying Geometry object constructor (if initially none) or updater. The parameter stride is an optional positive integer, it is usually automatically deducted from the kind (3 for positions or normals, 2 for UV, etc). Note that a new underlying VertexBuffer object is created each call. If the kind is the PositionKind, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.

    Possible kind values :

    • VertexBuffer.PositionKind
    • VertexBuffer.UVKind
    • VertexBuffer.UV2Kind
    • VertexBuffer.UV3Kind
    • VertexBuffer.UV4Kind
    • VertexBuffer.UV5Kind
    • VertexBuffer.UV6Kind
    • VertexBuffer.ColorKind
    • VertexBuffer.MatricesIndicesKind
    • VertexBuffer.MatricesIndicesExtraKind
    • VertexBuffer.MatricesWeightsKind
    • VertexBuffer.MatricesWeightsExtraKind

    Returns the Mesh.

    Parameters

    • kind: string
    • data: FloatArray
    • Optional updatable: boolean
    • Optional stride: number

    Returns AbstractMesh

  • Gets a string representation of the current mesh

    Returns

    a string representation of the current mesh

    Parameters

    • Optional fullDetails: boolean

      defines a boolean indicating if full details must be included

    Returns string

  • Transfer the mesh values to its UBO.

    Parameters

    • world: Matrix

      The world matrix associated with the mesh

    Returns void

  • 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.

    Returns

    the TransformNode.

    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

  • Updates the AbstractMesh indices array

    Returns

    the current mesh

    Parameters

    • indices: IndicesArray

      defines the data source

    • Optional offset: number

      defines the offset in the index buffer where to store the new data (can be null)

    • Optional gpuMemoryOnly: boolean

      defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)

    Returns AbstractMesh

  • Copies the parameter passed Matrix into the mesh Pose matrix.

    Returns

    this TransformNode.

    Parameters

    • matrix: Matrix

      the matrix to copy the pose from

    Returns TransformNode

  • Updates the existing vertex data of the mesh geometry for the requested kind. If the mesh has no geometry, it is simply returned as it is. The data are either a numeric array either a Float32Array. No new underlying VertexBuffer object is created. If the kind is the PositionKind and if updateExtends is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed. If the parameter makeItUnique is true, a new global geometry is created from this positions and is set to the mesh.

    Possible kind values :

    • VertexBuffer.PositionKind
    • VertexBuffer.UVKind
    • VertexBuffer.UV2Kind
    • VertexBuffer.UV3Kind
    • VertexBuffer.UV4Kind
    • VertexBuffer.UV5Kind
    • VertexBuffer.UV6Kind
    • VertexBuffer.ColorKind
    • VertexBuffer.MatricesIndicesKind
    • VertexBuffer.MatricesIndicesExtraKind
    • VertexBuffer.MatricesWeightsKind
    • VertexBuffer.MatricesWeightsExtraKind

    Returns the Mesh.

    Parameters

    • kind: string
    • data: FloatArray
    • Optional updateExtends: boolean
    • Optional makeItUnique: boolean

    Returns Mesh

  • 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

  • Returns a node constructor based on type name

    Returns

    the new constructor or null

    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)>

  • Returns a new TransformNode object parsed from the source provided.

    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

  • Parse animation range data from a serialization object and store them into a given node

    Parameters

    • node: Node

      defines where to store the animation ranges

    • parsedNode: any

      defines the serialization object to read data from

    • _scene: Scene

      defines the hosting scene

    Returns void

Generated using TypeDoc