Options
All
  • Public
  • Public/Protected
  • All
Menu

A BABYLON.mesh which updates as the user's face and deforms as the user's expression changes.

see

https://docs.zap.works/universal-ar/web-libraries/babylonjs/face-tracking/

Hierarchy

  • Mesh
    • FaceMeshGeometry

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Constructs a new face mesh.

    Parameters

    • name: string

      The name of the face mesh,

    • scene: Scene

      A babylon scene.

    • Optional faceMesh: FaceMesh

    Returns FaceMeshGeometry

Properties

_faceMesh

_faceMesh: FaceMesh

actionManager

actionManager: Nullable<AbstractActionManager>

Gets or sets the current action manager

see

https://doc.babylonjs.com/how_to/how_to_use_actions

alphaIndex

alphaIndex: number

Gets or sets the alpha index used to sort transparent meshes

see

https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#alpha-index

alwaysSelectAsActiveMesh

alwaysSelectAsActiveMesh: boolean

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

animations

animations: Animation[]

Gets a list of Animations associated with the node

cullingStrategy

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.

definedFacingForward

definedFacingForward: boolean

Gets or sets the orientation for POV movement & rotation

delayLoadState

delayLoadState: number

Gets the delay loading state of the mesh (when delay loading is turned on)

see

https://doc.babylonjs.com/how_to/using_the_incremental_loading_system

delayLoadingFile

delayLoadingFile: string

Gets the file containing delay loading data for this mesh

doNotSyncBoundingInfo

doNotSyncBoundingInfo: boolean

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

edgesColor

edgesColor: Color4

Defines edge color used when edgesRenderer is enabled

see

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

edgesRenderer

edgesRenderer: Nullable<EdgesRenderer>

Gets the edgesRenderer associated with the mesh

edgesShareWithInstances

edgesShareWithInstances: boolean

true to use the edge renderer for all instances of this mesh

edgesWidth

edgesWidth: number

Defines edge width used when edgesRenderer is enabled

see

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

ellipsoid

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/babylon101/cameras,_mesh_collisions_and_gravity

ellipsoidOffset

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/babylon101/cameras,_mesh_collisions_and_gravity

enablePointerMoveEvents

enablePointerMoveEvents: boolean

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

id

id: string

Gets or sets the id of the node

ignoreNonUniformScaling

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

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

see

https://doc.babylonjs.com/how_to/debug_layer#extensibility

instancedBuffers

instancedBuffers: {}

Object used to store instanced buffers defined by user

see

https://doc.babylonjs.com/how_to/how_to_use_instances#custom-buffers

Type declaration

  • [key: string]: any

instances

instances: InstancedMesh[]

Gets the list of instances created from this mesh it is not supposed to be modified manually. Note also that the order of the InstancedMesh wihin the array is not significant and might change.

see

https://doc.babylonjs.com/how_to/how_to_use_instances

isBlocker

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/how_to/how_to_use_lens_flares

isOccluded

isOccluded: boolean

Gets or sets whether the mesh is occluded or not, it is used also to set the intial state of the mesh to be occluded or not

see

https://doc.babylonjs.com/features/occlusionquery

isOcclusionQueryInProgress

isOcclusionQueryInProgress: boolean

Flag to check the progress status of the query

see

https://doc.babylonjs.com/features/occlusionquery

isPickable

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

isVisible: boolean

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

metadata

metadata: any

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

name

name: string

Gets or sets the name of the node

occlusionQueryAlgorithmType

occlusionQueryAlgorithmType: number

This property determines the type of occlusion query algorithm to run in WebGl, you can use:

  • AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.
  • AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.
see

https://doc.babylonjs.com/features/occlusionquery

occlusionRetryCount

occlusionRetryCount: number

This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retireved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decideds to show or hide the object. The default value is -1 which means don't break the query and wait till the result

see

https://doc.babylonjs.com/features/occlusionquery

occlusionType

occlusionType: number

This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:

  • OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query whith the Mesh.
  • OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.
  • OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.
see

https://doc.babylonjs.com/features/occlusionquery

onAfterWorldMatrixUpdateObservable

onAfterWorldMatrixUpdateObservable: Observable<TransformNode>

An event triggered after the world matrix is updated

onCollideObservable

onCollideObservable: Observable<AbstractMesh>

An event triggered when this mesh collides with another one

onCollisionPositionChangeObservable

onCollisionPositionChangeObservable: Observable<Vector3>

An event triggered when the collision's position changes

onDisposeObservable

onDisposeObservable: Observable<Node>

An event triggered when the mesh is disposed

onLODLevelSelection

onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void

User defined function used to change how LOD level selection is done

see

https://doc.babylonjs.com/how_to/how_to_use_lod

Type declaration

    • (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>): void

onMaterialChangedObservable

onMaterialChangedObservable: Observable<AbstractMesh>

An event triggered when material is changed

onReady

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

Callback raised when the node is ready to be used

onRebuildObservable

onRebuildObservable: Observable<AbstractMesh>

An event triggered when the mesh is rebuilt.

outlineColor

outlineColor: Color3

Defines color to use when rendering outline

outlineWidth

outlineWidth: number

Define width to use when rendering outline

overlayAlpha

overlayAlpha: number

Defines alpha to use when rendering overlay

overlayColor

overlayColor: Color3

Defines color to use when rendering overlay

overrideMaterialSideOrientation

overrideMaterialSideOrientation: Nullable<number>

Use this property to change the original side orientation defined at construction time

physicsImpostor

physicsImpostor: Nullable<PhysicsImpostor>

Gets or sets impostor used for physic simulation

see

https://doc.babylonjs.com/features/physics_engine

reIntegrateRotationIntoRotationQuaternion

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

renderOutline

renderOutline: boolean

Gets or sets a boolean indicating if the outline must be rendered as well

see

https://www.babylonjs-playground.com/#10WJ5S#3

renderOverlay

renderOverlay: boolean

Gets or sets a boolean indicating if the overlay must be rendered as well

see

https://www.babylonjs-playground.com/#10WJ5S#2

reservedDataStore

reservedDataStore: any

For internal use only. Please do not use.

scalingDeterminant

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

showBoundingBox: boolean

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

showSubMeshesBoundingBox

showSubMeshesBoundingBox: boolean

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

state

state: string

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

subMeshes

subMeshes: SubMesh[]

Gets or sets the list of subMeshes

see

https://doc.babylonjs.com/how_to/multi_materials

thinInstanceCount

thinInstanceCount: number

Gets / sets the number of thin instances to display. Note that you can't set a number higher than what the underlying buffer can handle.

thinInstanceEnablePicking

thinInstanceEnablePicking: boolean

Gets or sets a boolean defining if we want picking to pick thin instances as well

uniqueId

uniqueId: number

Gets or sets the unique id of the node

useOctreeForCollisions

useOctreeForCollisions: boolean

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

useOctreeForPicking

useOctreeForPicking: boolean

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

useOctreeForRenderingSelection

useOctreeForRenderingSelection: boolean

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

Static Readonly BACKSIDE

BACKSIDE: number

Mesh side orientation : usually the internal or back surface

Static Readonly BOTTOM

BOTTOM: number

Mesh tile positioning : part tiles on bottom

Static Readonly CAP_ALL

CAP_ALL: number

Mesh cap setting : two caps, one at the beginning and one at the end of the mesh

Static Readonly CAP_END

CAP_END: number

Mesh cap setting : one cap at the end of the mesh

Static Readonly CAP_START

CAP_START: number

Mesh cap setting : one cap at the beginning of the mesh

Static Readonly CENTER

CENTER: number

Mesh tile positioning : part tiles same on left/right or top/bottom

Static Readonly CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY

CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY: number

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.

Static Readonly CULLINGSTRATEGY_OPTIMISTIC_INCLUSION

CULLINGSTRATEGY_OPTIMISTIC_INCLUSION: number

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.

Static Readonly CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY

CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY: number

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.

Static Readonly CULLINGSTRATEGY_STANDARD

CULLINGSTRATEGY_STANDARD: number

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.

Static Readonly DEFAULTSIDE

DEFAULTSIDE: number

Mesh side orientation : by default, FRONTSIDE

Static Readonly DOUBLESIDE

DOUBLESIDE: number

Mesh side orientation : both internal and external or front and back surfaces

Static Readonly FLIP_N_ROTATE_ROW

FLIP_N_ROTATE_ROW: number

Mesh pattern setting : rotate pattern and rotate

Static Readonly FLIP_N_ROTATE_TILE

FLIP_N_ROTATE_TILE: number

Mesh pattern setting : flip and rotate alternate tiles on each row or column

Static Readonly FLIP_ROW

FLIP_ROW: number

Mesh pattern setting : flip (reflect in y axis) all tiles on alternate rows

Static Readonly FLIP_TILE

FLIP_TILE: number

Mesh pattern setting : flip (reflect in y axis) alternate tiles on each row or column

Static Readonly FRONTSIDE

FRONTSIDE: number

Mesh side orientation : usually the external or front surface

Static Readonly LEFT

LEFT: number

Mesh tile positioning : part tiles on left

Static Readonly NO_CAP

NO_CAP: number

Mesh cap setting : no cap

Static Readonly NO_FLIP

NO_FLIP: number

Mesh pattern setting : no flip or rotate

Static OCCLUSION_ALGORITHM_TYPE_ACCURATE

OCCLUSION_ALGORITHM_TYPE_ACCURATE: number

Use an accurante occlusion algorithm

Static OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE

OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE: number

Use a conservative occlusion algorithm

Static OCCLUSION_TYPE_NONE

OCCLUSION_TYPE_NONE: number

No occlusion

Static OCCLUSION_TYPE_OPTIMISTIC

OCCLUSION_TYPE_OPTIMISTIC: number

Occlusion set to optimisitic

Static OCCLUSION_TYPE_STRICT

OCCLUSION_TYPE_STRICT: number

Occlusion set to strict

Static Readonly RIGHT

RIGHT: number

Mesh tile positioning : part tiles on right

Static Readonly ROTATE_ROW

ROTATE_ROW: number

Mesh pattern setting : rotate (180degs) all tiles on alternate rows

Static Readonly ROTATE_TILE

ROTATE_TILE: number

Mesh pattern setting : rotate (180degs) alternate tiles on each row or column

Static Readonly TOP

TOP: number

Mesh tile positioning : part tiles on top

Accessors

absolutePosition

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

    Returns Vector3

absoluteRotationQuaternion

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

    Returns Quaternion

absoluteScaling

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

    Returns Vector3

animationPropertiesOverride

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

    Returns Nullable<AnimationPropertiesOverride>

  • Gets or sets the animation properties override

    Parameters

    • value: Nullable<AnimationPropertiesOverride>

    Returns void

applyFog

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

    Returns boolean

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

    Parameters

    • value: boolean

    Returns void

areNormalsFrozen

  • get areNormalsFrozen(): boolean
  • Gets a boolean indicating if the normals aren't to be recomputed on next mesh positions array update. This property is pertinent only for updatable parametric shapes.

    Returns boolean

behaviors

  • get behaviors(): Behavior<Node>[]

billboardMode

  • get billboardMode(): number
  • set billboardMode(value: number): void
  • 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

checkCollisions

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

    see

    https://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity

    Returns boolean

  • Gets or sets a boolean indicating that this mesh can be used in the collision engine

    Parameters

    • collisionEnabled: boolean

    Returns void

cloneMeshMap

  • get cloneMeshMap(): Nullable<{}>
  • Gets the list of clones of this mesh The scene must have been constructed with useClonedMeshMap=true for this to work! Note that useClonedMeshMap=true is the default setting

    Returns Nullable<{}>

collider

  • get collider(): Nullable<Collider>

collisionGroup

  • get collisionGroup(): number
  • set collisionGroup(mask: number): void
  • 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

  • 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

    Parameters

    • mask: number

    Returns void

collisionMask

  • get collisionMask(): number
  • set collisionMask(mask: number): void
  • 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

  • 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

    Parameters

    • mask: number

    Returns void

collisionResponse

  • get collisionResponse(): boolean
  • set collisionResponse(response: boolean): void
  • 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

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

    Parameters

    • response: boolean

    Returns void

computeBonesUsingShaders

  • get computeBonesUsingShaders(): boolean
  • set computeBonesUsingShaders(value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

doNotSerialize

  • get doNotSerialize(): boolean
  • set doNotSerialize(value: boolean): void
  • 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

facetDepthSortFrom

  • get facetDepthSortFrom(): Vector3
  • set facetDepthSortFrom(location: Vector3): void
  • 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/how_to/how_to_use_facetdata#facet-depth-sort

    Returns 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

    Parameters

    • location: Vector3

    Returns void

facetNb

  • get facetNb(): number

forward

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

    Returns Vector3

geometry

  • get geometry(): Nullable<Geometry>
  • Gets the mesh internal Geometry object

    Returns Nullable<Geometry>

hasInstances

  • get hasInstances(): boolean
  • Returns boolean

hasLODLevels

  • get hasLODLevels(): boolean
  • Gets a boolean indicating if this mesh has LOD

    Returns boolean

hasThinInstances

  • get hasThinInstances(): boolean
  • Returns boolean

hasVertexAlpha

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

    Returns boolean

  • Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values

    Parameters

    • value: boolean

    Returns void

infiniteDistance

  • get infiniteDistance(): boolean
  • set infiniteDistance(value: boolean): void
  • 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

isAnInstance

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

    Returns boolean

isBlocked

  • get isBlocked(): boolean
  • Returns boolean

isFacetDataEnabled

  • get isFacetDataEnabled(): boolean

isUnIndexed

  • get isUnIndexed(): boolean
  • set isUnIndexed(value: boolean): void
  • Gets or sets a boolean indicating that this mesh does not use index buffer

    Returns boolean

  • Gets or sets a boolean indicating that this mesh does not use index buffer

    Parameters

    • value: boolean

    Returns void

isWorldMatrixFrozen

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

    Returns boolean

layerMask

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

    see

    https://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures

    Returns number

  • Gets or sets the current layer mask (default is 0x0FFFFFFF)

    Parameters

    • value: number

    Returns void

lightSources

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

    Returns Light[]

manualUpdateOfWorldMatrixInstancedBuffer

  • get manualUpdateOfWorldMatrixInstancedBuffer(): boolean
  • set manualUpdateOfWorldMatrixInstancedBuffer(value: boolean): void
  • Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual

    Returns boolean

  • Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual

    Parameters

    • value: boolean

    Returns void

material

  • get material(): Nullable<Material>
  • set material(value: Nullable<Material>): void
  • Gets or sets current material

    Returns Nullable<Material>

  • Gets or sets current material

    Parameters

    • value: Nullable<Material>

    Returns void

morphTargetManager

  • get morphTargetManager(): Nullable<MorphTargetManager>
  • set morphTargetManager(value: Nullable<MorphTargetManager>): void
  • Gets or sets the morph target manager

    see

    https://doc.babylonjs.com/how_to/how_to_use_morphtargets

    Returns Nullable<MorphTargetManager>

  • Gets or sets the morph target manager

    Parameters

    • value: Nullable<MorphTargetManager>

    Returns void

mustDepthSortFacets

  • get mustDepthSortFacets(): boolean
  • set mustDepthSortFacets(sort: boolean): void
  • 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/how_to/how_to_use_facetdata#facet-depth-sort

    Returns 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

    Parameters

    • sort: boolean

    Returns void

nonUniformScaling

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

    Returns boolean

numBoneInfluencers

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

    Returns number

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

    Parameters

    • value: number

    Returns void

onAfterRenderObservable

  • get onAfterRenderObservable(): Observable<Mesh>
  • An event triggered after rendering the mesh

    Returns Observable<Mesh>

onBeforeBindObservable

  • get onBeforeBindObservable(): Observable<Mesh>
  • An event triggered before binding the mesh

    Returns Observable<Mesh>

onBeforeDraw

  • set onBeforeDraw(callback: () => void): void
  • Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead

    Parameters

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

    Returns void

onBeforeDrawObservable

  • get onBeforeDrawObservable(): Observable<Mesh>
  • An event triggered before drawing the mesh

    Returns Observable<Mesh>

onBeforeRenderObservable

  • get onBeforeRenderObservable(): Observable<Mesh>
  • An event triggered before rendering the mesh

    Returns Observable<Mesh>

onCollide

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

    Parameters

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

    Returns void

onCollisionPositionChange

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

    Parameters

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

    Returns void

onDispose

  • 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

overridenInstanceCount

  • set overridenInstanceCount(count: number): void
  • Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs

    Parameters

    • count: number

    Returns void

parent

  • get parent(): Nullable<Node>
  • set parent(parent: Nullable<Node>): void
  • Gets or sets the parent of the node (without keeping the current position in the scene)

    Returns Nullable<Node>

  • Gets or sets the parent of the node (without keeping the current position in the scene)

    see

    https://doc.babylonjs.com/how_to/parenting

    Parameters

    • parent: Nullable<Node>

    Returns void

partitioningBBoxRatio

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

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning

    Returns number

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

    Parameters

    • ratio: number

    Returns void

partitioningSubdivisions

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

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning

    Returns number

  • Gets or set the number (integer) of subdivisions per axis in the partioning space

    Parameters

    • nb: number

    Returns void

position

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

    Returns Vector3

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

    Parameters

    • newPosition: Vector3

    Returns void

preserveParentRotationForBillboard

  • get preserveParentRotationForBillboard(): boolean
  • set preserveParentRotationForBillboard(value: boolean): void
  • 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

receiveShadows

  • get receiveShadows(): boolean
  • set receiveShadows(value: boolean): void
  • Gets or sets a boolean indicating that this mesh can receive realtime shadows

    see

    https://doc.babylonjs.com/babylon101/shadows

    Returns boolean

  • Gets or sets a boolean indicating that this mesh can receive realtime shadows

    Parameters

    • value: boolean

    Returns void

renderingGroupId

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

right

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

    Returns Vector3

rotation

  • get rotation(): Vector3
  • set rotation(newRotation: Vector3): void
  • 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

rotationQuaternion

  • get rotationQuaternion(): Nullable<Quaternion>
  • set rotationQuaternion(quaternion: Nullable<Quaternion>): void
  • 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

  • get scaling(): Vector3
  • set scaling(newScaling: Vector3): void
  • Gets or sets a Vector3 depicting the mesh scaling along each local axis X, Y, Z. Default is (1.0, 1.0, 1.0)

    Returns Vector3

  • Gets or sets a Vector3 depicting the mesh scaling along each local axis X, Y, Z. Default is (1.0, 1.0, 1.0)

    Parameters

    • newScaling: Vector3

    Returns void

skeleton

  • get skeleton(): Nullable<Skeleton>
  • set skeleton(value: Nullable<Skeleton>): void
  • Gets or sets a skeleton to apply skining transformations

    Returns Nullable<Skeleton>

  • Gets or sets a skeleton to apply skining transformations

    see

    https://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons

    Parameters

    • value: Nullable<Skeleton>

    Returns void

source

  • get source(): Nullable<Mesh>
  • Gets the source mesh (the one used to clone this one from)

    Returns Nullable<Mesh>

surroundingMeshes

  • get surroundingMeshes(): Nullable<AbstractMesh[]>
  • set surroundingMeshes(meshes: Nullable<AbstractMesh[]>): void
  • 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[]>

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

    Parameters

    • meshes: Nullable<AbstractMesh[]>

    Returns void

up

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

    Returns Vector3

useBones

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

    Returns boolean

useVertexColors

  • get useVertexColors(): boolean
  • set useVertexColors(value: boolean): void
  • 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

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

    Parameters

    • value: boolean

    Returns void

visibility

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

    Returns number

  • Gets or sets mesh visibility between 0 and 1 (default is 1)

    Parameters

    • value: number

    Returns void

worldMatrixFromCache

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

    Returns Matrix

worldMatrixInstancedBuffer

  • get worldMatrixInstancedBuffer(): Float32Array
  • Gets the array buffer used to store the instanced buffer used for instances' world matrices

    Returns Float32Array

Static BILLBOARDMODE_ALL

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

    Returns number

Static BILLBOARDMODE_NONE

  • get BILLBOARDMODE_NONE(): number
  • No billboard

    Returns number

Static BILLBOARDMODE_USE_POSITION

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

    Returns number

Static BILLBOARDMODE_X

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

    Returns number

Static BILLBOARDMODE_Y

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

    Returns number

Static BILLBOARDMODE_Z

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

    Returns number

Methods

addBehavior

  • addBehavior(behavior: Behavior<Node>, attachImmediately?: boolean): Node
  • Attach a behavior to the node

    see

    https://doc.babylonjs.com/features/behaviour

    Parameters

    • behavior: Behavior<Node>

      defines the behavior to attach

    • Optional attachImmediately: boolean

      defines that the behavior must be attached even if the scene is still loading

    Returns Node

    the current Node

addChild

  • addChild(mesh: AbstractMesh): AbstractMesh
  • Adds the passed mesh as a child to the current mesh

    Parameters

    • mesh: AbstractMesh

      defines the child mesh

    Returns AbstractMesh

    the current mesh

addLODLevel

  • addLODLevel(distance: number, mesh: Nullable<Mesh>): Mesh
  • Add a mesh as LOD level triggered at the given distance.

    see

    https://doc.babylonjs.com/how_to/how_to_use_lod

    Parameters

    • distance: number

      The distance from the center of the object to show this level

    • mesh: Nullable<Mesh>

      The mesh to be added as LOD level (can be null)

    Returns Mesh

    This mesh (for chaining)

addRotation

  • addRotation(x: number, y: number, z: number): TransformNode
  • 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.

alignWithNormal

  • alignWithNormal(normal: Vector3, upDirection?: Vector3): AbstractMesh
  • Align the mesh with a normal

    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

    the current mesh

applyDisplacementMap

  • applyDisplacementMap(url: string, minHeight: number, maxHeight: number, onSuccess?: (mesh: Mesh) => void, uvOffset?: Vector2, uvScale?: Vector2, forceUpdate?: boolean): Mesh
  • Modifies the mesh geometry according to a displacement map. A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.

    Parameters

    • url: string

      is a string, the URL from the image file is to be downloaded.

    • minHeight: number

      is the lower limit of the displacement.

    • maxHeight: number

      is the upper limit of the displacement.

    • Optional onSuccess: (mesh: Mesh) => void

      is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.

        • (mesh: Mesh): void
        • Parameters

          • mesh: Mesh

          Returns void

    • Optional uvOffset: Vector2

      is an optional vector2 used to offset UV.

    • Optional uvScale: Vector2

      is an optional vector2 used to scale UV.

    • Optional forceUpdate: boolean

      defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.

    Returns Mesh

    the Mesh.

applyDisplacementMapFromBuffer

  • applyDisplacementMapFromBuffer(buffer: Uint8Array, heightMapWidth: number, heightMapHeight: number, minHeight: number, maxHeight: number, uvOffset?: Vector2, uvScale?: Vector2, forceUpdate?: boolean): Mesh
  • Modifies the mesh geometry according to a displacementMap buffer. A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.

    Parameters

    • buffer: Uint8Array

      is a Uint8Array buffer containing series of Uint8 lower than 255, the red, green, blue and alpha values of each successive pixel.

    • heightMapWidth: number

      is the width of the buffer image.

    • heightMapHeight: number

      is the height of the buffer image.

    • minHeight: number

      is the lower limit of the displacement.

    • maxHeight: number

      is the upper limit of the displacement.

    • Optional uvOffset: Vector2

      is an optional vector2 used to offset UV.

    • Optional uvScale: Vector2

      is an optional vector2 used to scale UV.

    • Optional forceUpdate: boolean

      defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.

    Returns Mesh

    the Mesh.

applyImpulse

  • applyImpulse(force: Vector3, contactPoint: Vector3): AbstractMesh
  • Apply a physic impulse to the mesh

    see

    https://doc.babylonjs.com/how_to/using_the_physics_engine

    Parameters

    • force: Vector3

      defines the force to apply

    • contactPoint: Vector3

      defines where to apply the force

    Returns AbstractMesh

    the current mesh

applySkeleton

  • applySkeleton(skeleton: Skeleton): Mesh
  • Updates the vertex buffer by applying transformation from the bones

    Parameters

    • skeleton: Skeleton

      defines the skeleton to apply to current mesh

    Returns Mesh

    the current mesh

attachToBone

  • attachToBone(bone: Bone, affectedTransformNode: TransformNode): TransformNode
  • 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

bakeCurrentTransformIntoVertices

  • bakeCurrentTransformIntoVertices(bakeIndependenlyOfChildren?: boolean): Mesh
  • Modifies the mesh geometry according to its own current World Matrix. The mesh World Matrix is then reset. This method returns nothing but really modifies the mesh even if it's originally not set as updatable. Note that, under the hood, this method sets a new VertexBuffer each call.

    see

    https://doc.babylonjs.com/resources/baking_transformations

    Parameters

    • Optional bakeIndependenlyOfChildren: boolean

      indicates whether to preserve all child nodes' World Matrix during baking

    Returns Mesh

    the current mesh

bakeTransformIntoVertices

  • bakeTransformIntoVertices(transform: Matrix): Mesh
  • Modifies the mesh geometry according to the passed transformation matrix. This method returns nothing but it really modifies the mesh even if it's originally not set as updatable. The mesh normals are modified using the same transformation. Note that, under the hood, this method sets a new VertexBuffer each call.

    see

    https://doc.babylonjs.com/resources/baking_transformations

    Parameters

    • transform: Matrix

      defines the transform matrix to use

    Returns Mesh

    the current mesh

beginAnimation

  • beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Nullable<Animatable>
  • 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)

        • (): void
        • Returns void

    Returns Nullable<Animatable>

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

calcMovePOV

  • calcMovePOV(amountRight: number, amountUp: number, amountForward: number): Vector3
  • 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

    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

    the new displacement vector

calcRotatePOV

  • calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): 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.

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns Vector3

    the new rotation vector

cleanMatrixWeights

  • cleanMatrixWeights(): void
  • Renormalize the mesh and patch it up if there are no weights Similar to normalization by adding the weights compute the reciprocal and multiply all elements, this wil ensure that everything adds to 1. However in the case of zero weights then we set just a single influence to 1. We check in the function for extra's present and if so we use the normalizeSkinWeightsWithExtras rather than the FourWeights version.

    Returns void

clone

  • clone(name?: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean): Mesh
  • Returns a new Mesh object generated from the current mesh properties. This method must not get confused with createInstance()

    Parameters

    • Optional name: string

      is a string, the name given to the new mesh

    • Optional newParent: Nullable<Node>

      can be any Node object (default null)

    • Optional doNotCloneChildren: boolean

      allows/denies the recursive cloning of the original mesh children if any (default false)

    • Optional clonePhysicsImpostor: boolean

      allows/denies the cloning in the same time of the original mesh body used by the physics engine, if any (default true)

    Returns Mesh

    a new mesh

computeWorldMatrix

  • computeWorldMatrix(force?: boolean): Matrix
  • 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

    Returns Matrix

    the world matrix

convertToFlatShadedMesh

  • convertToFlatShadedMesh(): Mesh
  • Modify the mesh to get a flat shading rendering. This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result. Warning : the mesh is really modified even if not set originally as updatable and, under the hood, a new VertexBuffer is allocated.

    Returns Mesh

    current mesh

convertToUnIndexedMesh

  • convertToUnIndexedMesh(): Mesh
  • This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers. In other words, more vertices, no more indices and a single bigger VBO. The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated.

    Returns Mesh

    current mesh

createAnimationRange

  • createAnimationRange(name: string, from: number, to: number): void
  • 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

createInstance

  • createInstance(name: string): InstancedMesh
  • Creates a new InstancedMesh object from the mesh model.

    see

    https://doc.babylonjs.com/how_to/how_to_use_instances

    Parameters

    • name: string

      defines the name of the new instance

    Returns InstancedMesh

    a new InstancedMesh

createNormals

  • createNormals(updatable: boolean): AbstractMesh
  • Creates new normals data for the mesh

    Parameters

    • updatable: boolean

      defines if the normal vertex buffer must be flagged as updatable

    Returns AbstractMesh

    the current mesh

createOrUpdateSubmeshesOctree

  • createOrUpdateSubmeshesOctree(maxCapacity?: number, maxDepth?: number): Octree<SubMesh>
  • This function will create an octree to help to select the right submeshes for rendering, picking and collision computations. Please note that you must have a decent number of submeshes to get performance improvements when using an octree

    see

    https://www.babylonjs-playground.com/#NA4OQ#12

    see

    https://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees

    Parameters

    • Optional maxCapacity: number

      defines the maximum size of each block (64 by default)

    • Optional maxDepth: number

      defines the maximum depth to use (no more than 2 levels by default)

    Returns Octree<SubMesh>

    the new octree

deleteAnimationRange

  • deleteAnimationRange(name: string, deleteFrames?: boolean): void
  • 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

detachFromBone

  • detachFromBone(): TransformNode
  • Detach the transform node if its associated with a bone

    Returns TransformNode

    this object

disableEdgesRendering

  • disableEdgesRendering(): AbstractMesh
  • Disables the mesh edge rendering mode

    Returns AbstractMesh

    the currentAbstractMesh

disableFacetData

  • disableFacetData(): AbstractMesh

dispose

  • dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean): void
  • Releases resources associated with this mesh.

    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

enableEdgesRendering

  • enableEdgesRendering(epsilon?: number, checkVerticesInsteadOfIndices?: boolean, options?: IEdgesRendererOptions): AbstractMesh
  • Enables the edge rendering mode on the mesh. This mode makes the mesh edges visible

    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

    the currentAbstractMesh

flipFaceNormals

  • flipFaceNormals(meshNormals: Float32Array): Float32Array

flipFaces

  • flipFaces(flipNormals?: boolean): Mesh
  • Inverses facet orientations. Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.

    Parameters

    • Optional flipNormals: boolean

      will also inverts the normals

    Returns Mesh

    current mesh

forceSharedVertices

  • forceSharedVertices(): void
  • Force adjacent facets to share vertices and remove any facets that have all vertices in a line This will undo any application of covertToFlatShadedMesh Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.

    Returns void

freezeNormals

  • freezeNormals(): Mesh
  • This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It prevents the mesh normals from being recomputed on next positions array update.

    Returns Mesh

    the current mesh

freezeWorldMatrix

  • freezeWorldMatrix(newWorldMatrix?: Nullable<Matrix>): TransformNode
  • Prevents the World matrix to be computed any longer

    Parameters

    • Optional newWorldMatrix: Nullable<Matrix>

      defines an optional matrix to use as world matrix

    Returns TransformNode

    the TransformNode.

getAbsolutePivotPoint

  • getAbsolutePivotPoint(): Vector3
  • 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.

getAbsolutePivotPointToRef

  • getAbsolutePivotPointToRef(result: Vector3): TransformNode
  • Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.

    Parameters

    • result: Vector3

      vector3 to store the result

    Returns TransformNode

    this TransformNode.

getAbsolutePosition

  • getAbsolutePosition(): Vector3
  • Retuns the mesh absolute position in the World.

    Returns Vector3

    a Vector3.

getAnimatables

  • getAnimatables(): IAnimatable[]
  • Returns as a new array populated with the mesh material and/or skeleton, if any.

    Returns IAnimatable[]

    an array of IAnimatable

getAnimationByName

  • getAnimationByName(name: string): Nullable<Animation>
  • Get an animation by name

    Parameters

    • name: string

      defines the name of the animation to look for

    Returns Nullable<Animation>

    null if not found else the requested animation

getAnimationRange

  • getAnimationRange(name: string): Nullable<AnimationRange>
  • 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

getAnimationRanges

  • getAnimationRanges(): Nullable<AnimationRange>[]
  • Gets the list of all animation ranges defined on this node

    Returns Nullable<AnimationRange>[]

    an array

getBehaviorByName

  • getBehaviorByName(name: string): Nullable<Behavior<Node>>
  • Gets an attached behavior by name

    see

    https://doc.babylonjs.com/features/behaviour

    Parameters

    • name: string

      defines the name of the behavior to look for

    Returns Nullable<Behavior<Node>>

    null if behavior was not found else the requested behavior

getBoundingInfo

  • getBoundingInfo(): BoundingInfo
  • 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). To get the full bounding of all children, call getHierarchyBoundingVectors instead.

    Returns BoundingInfo

    a BoundingInfo

getChildMeshes

  • getChildMeshes(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): 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

        • (node: Node): boolean
        • Parameters

          • node: Node

          Returns boolean

    Returns AbstractMesh[]

    an array of AbstractMesh

getChildTransformNodes

  • getChildTransformNodes(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): TransformNode[]
  • 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

        • (node: Node): boolean
        • Parameters

          • node: Node

          Returns boolean

    Returns TransformNode[]

    an array of TransformNode

getChildren

  • getChildren(predicate?: (node: Node) => boolean, directDescendantsOnly?: boolean): 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

        • (node: Node): boolean
        • 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

getClassName

  • getClassName(): string
  • Gets the class name

    Returns string

    the string "Mesh".

getClosestFacetAtCoordinates

  • getClosestFacetAtCoordinates(x: number, y: number, z: number, projected?: Vector3, checkFace?: boolean, facing?: boolean): Nullable<number>
  • Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found

    see

    https://doc.babylonjs.com/how_to/how_to_use_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>

    the face index if found (or null instead)

getClosestFacetAtLocalCoordinates

  • getClosestFacetAtLocalCoordinates(x: number, y: number, z: number, projected?: Vector3, checkFace?: boolean, facing?: boolean): Nullable<number>
  • Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found

    see

    https://doc.babylonjs.com/how_to/how_to_use_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>

    the face index if found (or null instead)

getConnectedParticleSystems

  • getConnectedParticleSystems(): IParticleSystem[]
  • This function returns all of the particle systems in the scene that use the mesh as an emitter.

    Returns IParticleSystem[]

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

getDescendants

  • getDescendants(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): Node[]
  • 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

        • (node: Node): boolean
        • Parameters

          • node: Node

          Returns boolean

    Returns Node[]

    all children nodes of all types

getDirection

  • getDirection(localAxis: Vector3): Vector3
  • 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.

getDirectionToRef

  • getDirectionToRef(localAxis: Vector3, result: Vector3): TransformNode
  • 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 Wordl space from the mesh World matrix.

    Parameters

    • localAxis: Vector3

      axis to rotate

    • result: Vector3

      the resulting transformnode

    Returns TransformNode

    this TransformNode.

getDistanceToCamera

  • getDistanceToCamera(camera?: Nullable<Camera>): number
  • Returns the distance from the mesh to the active camera

    Parameters

    • Optional camera: Nullable<Camera>

      defines the camera to use

    Returns number

    the distance

getEmittedParticleSystems

  • getEmittedParticleSystems(): IParticleSystem[]
  • Returns an array populated with IParticleSystem objects whose the mesh is the emitter

    Returns IParticleSystem[]

    an array of IParticleSystem

getEngine

  • getEngine(): Engine
  • Gets the engine of the node

    Returns Engine

    a Engine

getFacetDataParameters

  • getFacetDataParameters(): any
  • Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals()

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Returns any

    the parameters

getFacetLocalNormals

  • getFacetLocalNormals(): Vector3[]
  • Returns the facetLocalNormals array. The normals are expressed in the mesh local spac

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Returns Vector3[]

    an array of Vector3

getFacetLocalPartitioning

  • getFacetLocalPartitioning(): number[][]

getFacetLocalPositions

  • getFacetLocalPositions(): Vector3[]
  • Returns the facetLocalPositions array. The facet positions are expressed in the mesh local space

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Returns Vector3[]

    an array of Vector3

getFacetNormal

  • getFacetNormal(i: number): Vector3
  • Returns the i-th facet normal in the world system. This method allocates a new Vector3 per call

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Parameters

    • i: number

      defines the facet index

    Returns Vector3

    a new Vector3

getFacetNormalToRef

  • Sets the reference Vector3 with the i-th facet normal in the world system

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Parameters

    • i: number

      defines the facet index

    • ref: Vector3

      defines the target vector

    Returns FaceMeshGeometry

    the current mesh

getFacetPosition

  • getFacetPosition(i: number): Vector3
  • Returns the i-th facet position in the world system. This method allocates a new Vector3 per call

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Parameters

    • i: number

      defines the facet index

    Returns Vector3

    a new Vector3

getFacetPositionToRef

  • getFacetPositionToRef(i: number, ref: Vector3): AbstractMesh
  • Sets the reference Vector3 with the i-th facet position in the world system

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Parameters

    • i: number

      defines the facet index

    • ref: Vector3

      defines the target vector

    Returns AbstractMesh

    the current mesh

getFacetsAtLocalCoordinates

  • getFacetsAtLocalCoordinates(x: number, y: number, z: number): Nullable<number[]>
  • 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)

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    Returns Nullable<number[]>

    the array of facet indexes

getHierarchyBoundingVectors

  • getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): { max: Vector3; min: Vector3 }
  • 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

    • max: Vector3
    • min: Vector3

getHierarchyEmittedParticleSystems

  • getHierarchyEmittedParticleSystems(): IParticleSystem[]
  • Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter

    Returns IParticleSystem[]

    an array of IParticleSystem

getIndices

  • getIndices(copyWhenShared?: boolean, forceCopy?: boolean): Nullable<IndicesArray>
  • Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.

    Parameters

    • 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 indicating that the returned array must be cloned upon returning it

    Returns Nullable<IndicesArray>

    the indices array or an empty array if the mesh has no geometry

getLOD

  • getLOD(camera: Camera, boundingSphere?: BoundingSphere): Nullable<AbstractMesh>
  • Returns the registered LOD mesh distant from the parameter camera position if any, else returns the current mesh.

    see

    https://doc.babylonjs.com/how_to/how_to_use_lod

    Parameters

    • camera: Camera

      defines the camera to use to compute distance

    • Optional boundingSphere: BoundingSphere

      defines a custom bounding sphere to use instead of the one from this mesh

    Returns Nullable<AbstractMesh>

    This mesh (for chaining)

getLODLevelAtDistance

  • getLODLevelAtDistance(distance: number): Nullable<Mesh>
  • Returns the LOD level mesh at the passed distance or null if not found.

    see

    https://doc.babylonjs.com/how_to/how_to_use_lod

    Parameters

    • distance: number

      The distance from the center of the object to show this level

    Returns Nullable<Mesh>

    a Mesh or null

getLODLevels

  • getLODLevels(): MeshLODLevel[]
  • Gets the list of MeshLODLevel associated with the current mesh

    Returns MeshLODLevel[]

    an array of MeshLODLevel

getPhysicsImpostor

  • getPhysicsImpostor(): Nullable<PhysicsImpostor>
  • Gets the current physics impostor

    see

    https://doc.babylonjs.com/features/physics_engine

    Returns Nullable<PhysicsImpostor>

    a physics impostor or null

getPivotMatrix

  • getPivotMatrix(): Matrix
  • Returns the mesh pivot matrix. Default : Identity.

    Returns Matrix

    the matrix

getPivotPoint

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

    Returns Vector3

    the pivot point

getPivotPointToRef

  • getPivotPointToRef(result: Vector3): TransformNode
  • 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.

getPoseMatrix

  • getPoseMatrix(): Matrix
  • Returns the mesh Pose matrix.

    Returns Matrix

    the pose matrix

getPositionExpressedInLocalSpace

  • getPositionExpressedInLocalSpace(): Vector3
  • Returns the mesh position in the local space from the current World matrix values.

    Returns Vector3

    a new Vector3.

getPositionInCameraSpace

  • getPositionInCameraSpace(camera?: Nullable<Camera>): Vector3
  • Gets the position of the current mesh in camera space

    Parameters

    • Optional camera: Nullable<Camera>

      defines the camera to use

    Returns Vector3

    a position

getScene

  • getScene(): Scene
  • Gets the scene of the node

    Returns Scene

    a scene

getTotalIndices

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

    Returns number

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

getTotalVertices

  • getTotalVertices(): number
  • Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry.

    Returns number

    the total number of vertices

getVertexBuffer

  • getVertexBuffer(kind: string): Nullable<VertexBuffer>
  • Returns the mesh VertexBuffer object from the requested kind

    Parameters

    • kind: string

      defines which buffer to read from (positions, indices, normals, etc). Possible kind values :

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

    Returns Nullable<VertexBuffer>

    a FloatArray or null if the mesh has no vertex buffer for this kind.

getVerticesData

  • getVerticesData(kind: string, copyWhenShared?: boolean, forceCopy?: boolean): Nullable<FloatArray>
  • Returns the content of an associated vertex buffer

    Parameters

    • kind: string

      defines which buffer to read from (positions, indices, normals, etc). 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
    • Optional copyWhenShared: boolean

      defines a boolean indicating that 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>

    a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.

getVerticesDataKinds

  • getVerticesDataKinds(): string[]
  • Returns a string which contains the list of existing kinds of Vertex Data associated with this mesh.

    Returns string[]

    an array of strings

getWorldMatrix

  • getWorldMatrix(): Matrix
  • Gets the current world matrix

    Returns Matrix

    a Matrix

increaseVertices

  • increaseVertices(numberPerEdge: number): void
  • Increase the number of facets and hence vertices in a mesh Vertex normals are interpolated from existing vertex normals Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.

    Parameters

    • numberPerEdge: number

      the number of new vertices to add to each edge of a facet, optional default 1

    Returns void

instantiateHierarchy

  • instantiateHierarchy(newParent?: Nullable<TransformNode>, options?: { doNotInstantiate: boolean }, onNewNodeCreated?: (source: TransformNode, clone: TransformNode) => void): Nullable<TransformNode>
  • Parameters

    • Optional newParent: Nullable<TransformNode>
    • Optional options: { doNotInstantiate: boolean }
      • doNotInstantiate: boolean
    • Optional onNewNodeCreated: (source: TransformNode, clone: TransformNode) => void
        • (source: TransformNode, clone: TransformNode): void
        • Parameters

          • source: TransformNode
          • clone: TransformNode

          Returns void

    Returns Nullable<TransformNode>

intersects

  • intersects(ray: Ray, fastCheck?: boolean, trianglePredicate?: TrianglePickingPredicate, onlyBoundingInfo?: boolean, worldToUse?: Matrix, skipBoundingInfo?: boolean): PickingInfo
  • Checks if the passed Ray intersects with the mesh

    see

    https://doc.babylonjs.com/babylon101/intersect_collisions_-_mesh

    Parameters

    • ray: Ray

      defines the ray to use

    • 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

    the picking info

intersectsMesh

  • intersectsMesh(mesh: AbstractMesh | SolidParticle, precise?: boolean, includeDescendants?: boolean): boolean
  • True if the mesh intersects another mesh or a SolidParticle object

    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

    true if there is an intersection

intersectsPoint

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

    Parameters

    • point: Vector3

      defines the point to test

    Returns boolean

    true if there is an intersection

isCompletelyInFrustum

  • isCompletelyInFrustum(frustumPlanes: Plane[]): 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.

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum to test

    Returns boolean

    true if the mesh is completely in the frustum planes

isDescendantOf

  • isDescendantOf(ancestor: Node): 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

    Parameters

    • ancestor: Node

      defines the parent node to inspect

    Returns boolean

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

isDisposed

  • isDisposed(): boolean
  • Gets a boolean indicating if the node has been disposed

    Returns boolean

    true if the node was disposed

isEnabled

  • isEnabled(checkAncestors?: boolean): 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

    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

isInFrustum

  • isInFrustum(frustumPlanes: Plane[]): 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

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum to test

    Returns boolean

    true if the mesh is in the frustum planes

isReady

  • isReady(completeCheck?: boolean, forceInstanceSupport?: boolean): boolean
  • Determine if the current mesh is ready to be rendered

    Parameters

    • Optional completeCheck: boolean

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

    • Optional forceInstanceSupport: boolean

      will check if the mesh will be ready when used with instances (false by default)

    Returns boolean

    true if all associated assets are ready (material, textures, shaders)

isVertexBufferUpdatable

  • isVertexBufferUpdatable(kind: string): boolean
  • Returns a boolean defining if the vertex data for the requested kind is updatable.

    Parameters

    • kind: string

      defines which buffer to check (positions, indices, normals, etc). 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 boolean

    a boolean

isVerticesDataPresent

  • isVerticesDataPresent(kind: string): boolean
  • Tests if a specific vertex buffer is associated with this mesh

    Parameters

    • kind: string

      defines which buffer to check (positions, indices, normals, etc). Possible kind values :

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

    Returns boolean

    a boolean

locallyTranslate

  • locallyTranslate(vector3: Vector3): TransformNode
  • Translates the mesh along the passed Vector3 in its local space.

    Parameters

    • vector3: Vector3

      the distance to translate in localspace

    Returns TransformNode

    the TransformNode.

lookAt

  • lookAt(targetPoint: Vector3, yawCor?: number, pitchCor?: number, rollCor?: number, space?: Space): TransformNode
  • 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 choosen space of the target

    Returns TransformNode

    the TransformNode.

makeGeometryUnique

  • makeGeometryUnique(): Mesh
  • Creates a un-shared specific occurence of the geometry for the mesh.

    Returns Mesh

    the current mesh

markAsDirty

  • markAsDirty(property: string): TransformNode
  • Flag the transform node as dirty (Forcing it to update everything)

    Parameters

    • property: string

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

    Returns TransformNode

    this transform node

markVerticesDataAsUpdatable

  • markVerticesDataAsUpdatable(kind: string, updatable?: boolean): void
  • Flags an associated vertex buffer as updatable

    Parameters

    • kind: string

      defines which buffer to use (positions, indices, normals, etc). 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
    • Optional updatable: boolean

      defines if the updated vertex buffer must be flagged as updatable

    Returns void

movePOV

  • movePOV(amountRight: number, amountUp: number, amountForward: number): 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

    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

    the current mesh

moveWithCollisions

  • moveWithCollisions(displacement: Vector3): AbstractMesh

normalizeToUnitCube

  • normalizeToUnitCube(includeDescendants?: boolean, ignoreRotation?: boolean, predicate?: Nullable<(node: AbstractMesh) => boolean>): AbstractMesh
  • 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 AbstractMesh

    the current mesh

optimizeIndices

  • optimizeIndices(successCallback?: (mesh?: Mesh) => void): Mesh
  • Optimization of the mesh's indices, in case a mesh has duplicated vertices. The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes. This should be used together with the simplification to avoid disappearing triangles.

    Parameters

    • Optional successCallback: (mesh?: Mesh) => void

      an optional success callback to be called after the optimization finished.

        • (mesh?: Mesh): void
        • Parameters

          • Optional mesh: Mesh

          Returns void

    Returns Mesh

    the current mesh

refreshBoundingInfo

  • refreshBoundingInfo(applySkeleton?: boolean): Mesh
  • 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.

    Parameters

    • Optional applySkeleton: boolean

      defines whether to apply the skeleton before computing the bounding info

    Returns Mesh

    the current mesh

registerAfterRender

  • registerAfterRender(func: (mesh: AbstractMesh) => void): Mesh
  • Registers for this mesh a javascript function called just after the rendering is complete

    Parameters

    • func: (mesh: AbstractMesh) => void

      defines the function to call after rendering this mesh

        • (mesh: AbstractMesh): void
        • Parameters

          • mesh: AbstractMesh

          Returns void

    Returns Mesh

    the current mesh

registerAfterWorldMatrixUpdate

  • registerAfterWorldMatrixUpdate(func: (mesh: TransformNode) => void): TransformNode
  • 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

        • (mesh: TransformNode): void
        • Parameters

          • mesh: TransformNode

          Returns void

    Returns TransformNode

    the TransformNode.

registerBeforeRender

  • registerBeforeRender(func: (mesh: AbstractMesh) => void): Mesh
  • Registers for this mesh a javascript function called just before the rendering process

    Parameters

    • func: (mesh: AbstractMesh) => void

      defines the function to call before rendering this mesh

        • (mesh: AbstractMesh): void
        • Parameters

          • mesh: AbstractMesh

          Returns void

    Returns Mesh

    the current mesh

registerInstancedBuffer

  • registerInstancedBuffer(kind: string, stride: number): void

releaseSubMeshes

  • releaseSubMeshes(): AbstractMesh
  • Disposes all the submeshes of the current meshnp

    Returns AbstractMesh

    the current mesh

removeBehavior

  • removeBehavior(behavior: Behavior<Node>): Node
  • Remove an attached behavior

    see

    https://doc.babylonjs.com/features/behaviour

    Parameters

    • behavior: Behavior<Node>

      defines the behavior to attach

    Returns Node

    the current Node

removeChild

  • removeChild(mesh: AbstractMesh): AbstractMesh
  • Removes the passed mesh from the current mesh children list

    Parameters

    • mesh: AbstractMesh

      defines the child mesh

    Returns AbstractMesh

    the current mesh

removeLODLevel

  • removeLODLevel(mesh: Mesh): Mesh
  • Remove a mesh from the LOD array

    see

    https://doc.babylonjs.com/how_to/how_to_use_lod

    Parameters

    • mesh: Mesh

      defines the mesh to be removed

    Returns Mesh

    This mesh (for chaining)

removeVerticesData

  • removeVerticesData(kind: string): void
  • Delete a vertex buffer associated with this mesh

    Parameters

    • kind: string

      defines which buffer to delete (positions, indices, normals, etc). 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 void

render

  • render(subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh
  • Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager

    Parameters

    • subMesh: SubMesh

      defines the subMesh to render

    • enableAlphaMode: boolean

      defines if alpha mode can be changed

    • Optional effectiveMeshReplacement: AbstractMesh

      defines an optional mesh used to provide info for the rendering

    Returns Mesh

    the current mesh

resetLocalMatrix

  • resetLocalMatrix(independentOfChildren?: boolean): 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

rotate

  • rotate(axis: Vector3, amount: number, space?: Space): TransformNode
  • 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.

    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.

rotateAround

  • rotateAround(point: Vector3, axis: Vector3, amount: number): TransformNode
  • 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 property rotation 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.htm

    Parameters

    • 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

rotatePOV

  • rotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): AbstractMesh
  • Perform relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns AbstractMesh

    the current mesh

serialize

  • serialize(serializationObject: any): void
  • Serialize current mesh

    Parameters

    • serializationObject: any

      defines the object which will receive the serialization data

    Returns void

serializeAnimationRanges

  • serializeAnimationRanges(): any
  • Serialize animation ranges into a JSON compatible object

    Returns any

    serialization object

setAbsolutePosition

  • setAbsolutePosition(absolutePosition: Vector3): TransformNode
  • 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.

setBoundingInfo

  • setBoundingInfo(boundingInfo: BoundingInfo): AbstractMesh
  • Overwrite the current bounding info

    Parameters

    • boundingInfo: BoundingInfo

      defines the new bounding info

    Returns AbstractMesh

    the current mesh

setDirection

  • setDirection(localAxis: Vector3, yawCor?: number, pitchCor?: number, rollCor?: number): TransformNode
  • 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

setEnabled

  • setEnabled(value: boolean): void
  • Set the enabled state of this node

    Parameters

    • value: boolean

      defines the new enabled state

    Returns void

setIndices

  • setIndices(indices: IndicesArray, totalVertices?: Nullable<number>, updatable?: boolean): AbstractMesh
  • Set the index buffer of this mesh

    Parameters

    • indices: IndicesArray

      defines the source data

    • Optional totalVertices: Nullable<number>

      defines the total number of vertices referenced by this index data (can be null)

    • Optional updatable: boolean

      defines if the updated index buffer must be flagged as updatable (default is false)

    Returns AbstractMesh

    the current mesh

setMaterialByID

  • setMaterialByID(id: string): Mesh
  • Sets the mesh material by the material or multiMaterial id property

    Parameters

    • id: string

      is a string identifying the material or the multiMaterial

    Returns Mesh

    the current mesh

setNormalsForCPUSkinning

  • setNormalsForCPUSkinning(): Float32Array
  • Prepare internal normal array for software CPU skinning

    Returns Float32Array

    original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.

setParent

  • setParent(node: Nullable<Node>): TransformNode
  • 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

    see

    https://doc.babylonjs.com/how_to/parenting

    Parameters

    • node: Nullable<Node>

      the node ot set as the parent

    Returns TransformNode

    this TransformNode.

setPhysicsLinkWith

  • setPhysicsLinkWith(otherMesh: Mesh, pivot1: Vector3, pivot2: Vector3, options?: any): AbstractMesh
  • Creates a physic joint between two meshes

    see

    https://www.babylonjs-playground.com/#0BS5U0#0

    Parameters

    • otherMesh: Mesh

      defines the other mesh to use

    • pivot1: Vector3

      defines the pivot to use on this mesh

    • pivot2: Vector3

      defines the pivot to use on the other mesh

    • Optional options: any

      defines additional options (can be plugin dependent)

    Returns AbstractMesh

    the current mesh

setPivotMatrix

  • setPivotMatrix(matrix: DeepImmutableObject<Matrix>, postMultiplyPivotMatrix?: boolean): TransformNode
  • 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

setPivotPoint

  • setPivotPoint(point: Vector3, space?: Space): TransformNode
  • 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

setPositionWithLocalVector

  • setPositionWithLocalVector(vector3: Vector3): TransformNode
  • Sets the mesh position in its local space.

    Parameters

    • vector3: Vector3

      the position to set in localspace

    Returns TransformNode

    the TransformNode.

setPositionsForCPUSkinning

  • setPositionsForCPUSkinning(): Float32Array
  • Prepare internal position array for software CPU skinning

    Returns Float32Array

    original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh

setPreTransformMatrix

  • setPreTransformMatrix(matrix: Matrix): TransformNode
  • Sets a new matrix to apply before all other transformation

    Parameters

    • matrix: Matrix

      defines the transform matrix

    Returns TransformNode

    the current TransformNode

setVerticesBuffer

  • setVerticesBuffer(buffer: VertexBuffer): Mesh
  • Sets the mesh global Vertex Buffer

    Parameters

    • buffer: VertexBuffer

      defines the buffer to use

    Returns Mesh

    the current mesh

setVerticesData

  • setVerticesData(kind: string, data: FloatArray, updatable?: boolean, stride?: number): AbstractMesh
  • Copy a FloatArray into a specific associated vertex buffer

    Parameters

    • kind: string

      defines which buffer to write to (positions, indices, normals, etc). 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
    • data: FloatArray

      defines the data source

    • Optional updatable: boolean

      defines if the updated vertex buffer must be flagged as updatable

    • Optional stride: number

      defines the data stride size (can be null)

    Returns AbstractMesh

    the current mesh

simplify

  • simplify(settings: ISimplificationSettings[], parallelProcessing?: boolean, simplificationType?: QUADRATIC, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): Mesh
  • Simplify the mesh according to the given array of settings. Function will return immediately and will simplify async

    Parameters

    • settings: ISimplificationSettings[]

      a collection of simplification settings

    • Optional parallelProcessing: boolean

      should all levels calculate parallel or one after the other

    • Optional simplificationType: QUADRATIC

      the type of simplification to run

    • Optional successCallback: (mesh?: Mesh, submeshIndex?: number) => void

      optional success callback to be called after the simplification finished processing all settings

        • (mesh?: Mesh, submeshIndex?: number): void
        • Parameters

          • Optional mesh: Mesh
          • Optional submeshIndex: number

          Returns void

    Returns Mesh

    the current mesh

subdivide

  • subdivide(count: number): void
  • This function will subdivide the mesh into multiple submeshes

    Parameters

    • count: number

      defines the expected number of submeshes

    Returns void

synchronizeInstances

  • synchronizeInstances(): Mesh
  • Synchronises all the mesh instance submeshes to the current mesh submeshes, if any. After this call, all the mesh instances have the same submeshes than the current mesh.

    Returns Mesh

    the current mesh

thinInstanceAdd

  • thinInstanceAdd(matrix: DeepImmutableObject<Matrix> | DeepImmutableObject<Matrix>[], refresh: boolean): number
  • Creates a new thin instance

    Parameters

    • matrix: DeepImmutableObject<Matrix> | DeepImmutableObject<Matrix>[]

      the matrix or array of matrices (position, rotation, scale) of the thin instance(s) to create

    • refresh: boolean

      true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance

    Returns number

    the thin instance index number. If you pass an array of matrices, other instance indexes are index+1, index+2, etc

thinInstanceAddSelf

  • thinInstanceAddSelf(refresh: boolean): number
  • Adds the transformation (matrix) of the current mesh as a thin instance

    Parameters

    • refresh: boolean

      true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance

    Returns number

    the thin instance index number

thinInstanceBufferUpdated

  • thinInstanceBufferUpdated(kind: string): void
  • Synchronize the gpu buffers with a thin instance buffer. Call this method if you update later on the buffers passed to thinInstanceSetBuffer

    Parameters

    • kind: string

      name of the attribute to update. Use "matrix" to update the buffer of matrices

    Returns void

thinInstanceGetWorldMatrices

  • thinInstanceGetWorldMatrices(): Matrix[]
  • Gets the list of world matrices

    Returns Matrix[]

    an array containing all the world matrices from the thin instances

thinInstancePartialBufferUpdate

  • thinInstancePartialBufferUpdate(kind: string, data: Float32Array, offset: number): void
  • Applies a partial update to a buffer directly on the GPU Note that the buffer located on the CPU is NOT updated! It's up to you to update it (or not) with the same data you pass to this method

    Parameters

    • kind: string

      name of the attribute to update. Use "matrix" to update the buffer of matrices

    • data: Float32Array

      the data to set in the GPU buffer

    • offset: number

      the offset in the GPU buffer where to update the data

    Returns void

thinInstanceRefreshBoundingInfo

  • thinInstanceRefreshBoundingInfo(forceRefreshParentInfo: boolean): void
  • Refreshes the bounding info, taking into account all the thin instances defined

    Parameters

    • forceRefreshParentInfo: boolean

      true to force recomputing the mesh bounding info and use it to compute the aggregated bounding info

    Returns void

thinInstanceRegisterAttribute

  • thinInstanceRegisterAttribute(kind: string, stride: number): void
  • Registers a custom attribute to be used with thin instances

    Parameters

    • kind: string

      name of the attribute

    • stride: number

      size in floats of the attribute

    Returns void

thinInstanceSetAttributeAt

  • thinInstanceSetAttributeAt(kind: string, index: number, value: number[], refresh: boolean): void
  • Sets the value of a custom attribute for a thin instance

    Parameters

    • kind: string

      name of the attribute

    • index: number

      index of the thin instance

    • value: number[]

      value to set

    • refresh: boolean

      true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance

    Returns void

thinInstanceSetBuffer

  • thinInstanceSetBuffer(kind: string, buffer: Nullable<Float32Array>, stride: number, staticBuffer: boolean): void
  • Sets a buffer to be used with thin instances. This method is a faster way to setup multiple instances than calling thinInstanceAdd repeatedly

    Parameters

    • kind: string

      name of the attribute. Use "matrix" to setup the buffer of matrices

    • buffer: Nullable<Float32Array>

      buffer to set

    • stride: number

      size in floats of each value of the buffer

    • staticBuffer: boolean

      indicates that the buffer is static, so that you won't change it after it is set (better performances - false by default)

    Returns void

thinInstanceSetMatrixAt

  • thinInstanceSetMatrixAt(index: number, matrix: DeepImmutableObject<Matrix>, refresh: boolean): void
  • Sets the matrix of a thin instance

    Parameters

    • index: number

      index of the thin instance

    • matrix: DeepImmutableObject<Matrix>

      matrix to set

    • refresh: boolean

      true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance

    Returns void

toLeftHanded

  • toLeftHanded(): Mesh
  • Invert the geometry to move from a right handed system to a left handed one.

    Returns Mesh

    the current mesh

toString

  • toString(fullDetails?: boolean): string
  • Returns a description of this mesh

    Parameters

    • Optional fullDetails: boolean

      define if full details about this mesh must be used

    Returns string

    a descriptive string representing this mesh

translate

  • translate(axis: Vector3, distance: number, space?: Space): TransformNode
  • 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.

unfreezeNormals

  • unfreezeNormals(): Mesh
  • This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It reactivates the mesh normals computation if it was previously frozen

    Returns Mesh

    the current mesh

unfreezeWorldMatrix

  • Allows back the World matrix computation.

    Returns FaceMeshGeometry

    the TransformNode.

unregisterAfterRender

  • unregisterAfterRender(func: (mesh: AbstractMesh) => void): Mesh
  • Disposes a previously registered javascript function called after the rendering.

    Parameters

    • func: (mesh: AbstractMesh) => void

      defines the function to remove

        • (mesh: AbstractMesh): void
        • Parameters

          • mesh: AbstractMesh

          Returns void

    Returns Mesh

    the current mesh

unregisterAfterWorldMatrixUpdate

  • unregisterAfterWorldMatrixUpdate(func: (mesh: TransformNode) => void): TransformNode
  • Removes a registered callback function.

    Parameters

    • func: (mesh: TransformNode) => void

      callback function to remove

        • (mesh: TransformNode): void
        • Parameters

          • mesh: TransformNode

          Returns void

    Returns TransformNode

    the TransformNode.

unregisterBeforeRender

  • unregisterBeforeRender(func: (mesh: AbstractMesh) => void): Mesh
  • Disposes a previously registered javascript function called before the rendering

    Parameters

    • func: (mesh: AbstractMesh) => void

      defines the function to remove

        • (mesh: AbstractMesh): void
        • Parameters

          • mesh: AbstractMesh

          Returns void

    Returns Mesh

    the current mesh

update

  • update(): void

updateFacetData

  • updateFacetData(): AbstractMesh
  • Updates the mesh facetData arrays and the internal partitioning when the mesh is morphed or updated. This method can be called within the render loop. You don't need to call this method by yourself in the render loop when you update/morph a mesh with the methods CreateXXX() as they automatically manage this computation

    see

    https://doc.babylonjs.com/how_to/how_to_use_facetdata

    Returns AbstractMesh

    the current mesh

updateFromFaceAnchor

updateFromFaceAnchorTransformNode

updateFromFaceTracker

  • updateFromFaceTracker(faceTracker: FaceTracker): void

updateIndices

  • updateIndices(indices: IndicesArray, offset?: number, gpuMemoryOnly?: boolean): AbstractMesh
  • Update the current index buffer

    Parameters

    • indices: IndicesArray

      defines the source data

    • 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

    the current mesh

updateMeshPositions

  • updateMeshPositions(positionFunction: (data: FloatArray) => void, computeNormals?: boolean): Mesh
  • This method updates the vertex positions of an updatable mesh according to the positionFunction returned values.

    see

    https://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh#other-shapes-updatemeshpositions

    Parameters

    • positionFunction: (data: FloatArray) => void

      is a simple JS function what is passed the mesh positions array. It doesn't need to return anything

        • (data: FloatArray): void
        • Parameters

          • data: FloatArray

          Returns void

    • Optional computeNormals: boolean

      is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update

    Returns Mesh

    the current mesh

updatePoseMatrix

  • updatePoseMatrix(matrix: Matrix): TransformNode
  • Copies the parameter passed Matrix into the mesh Pose matrix.

    Parameters

    • matrix: Matrix

      the matrix to copy the pose from

    Returns TransformNode

    this TransformNode.

updateVerticesData

  • updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean, makeItUnique?: boolean): AbstractMesh
  • Update a specific associated vertex buffer

    Parameters

    • kind: string

      defines which buffer to write to (positions, indices, normals, etc). 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
    • data: FloatArray

      defines the data source

    • Optional updateExtends: boolean

      defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind

    • Optional makeItUnique: boolean

      defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)

    Returns AbstractMesh

    the current mesh

validateSkinning

  • validateSkinning(): { report: string; skinned: boolean; valid: boolean }
  • ValidateSkinning is used to determine that a mesh has valid skinning data along with skin metrics, if missing weights, or not normalized it is returned as invalid mesh the string can be used for console logs, or on screen messages to let the user know there was an issue with importing the mesh

    Returns { report: string; skinned: boolean; valid: boolean }

    a validation object with skinned, valid and report string

    • report: string
    • skinned: boolean
    • valid: boolean

Static AddNodeConstructor

  • AddNodeConstructor(type: string, constructorFunc: NodeConstructor): void
  • 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 Center

  • Center(meshesOrMinMaxVector: AbstractMesh[] | { max: Vector3; min: Vector3 }): Vector3
  • Returns the center of the {min: Vector3, max: Vector3} or the center of MinMax vector3 computed from a mesh array

    Parameters

    • meshesOrMinMaxVector: AbstractMesh[] | { max: Vector3; min: Vector3 }

      could be an array of meshes or a {min: Vector3, max: Vector3} object

    Returns Vector3

    a vector3

Static Construct

  • Construct(type: string, name: string, scene: Scene, options?: any): Nullable<() => Node>
  • 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 CreateBox

  • CreateBox(name: string, size: number, scene?: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a box mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • size: number

      sets the size (float) of each box side (default 1)

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateCapsule

  • CreateCapsule(name: string, options: ICreateCapsuleOptions, scene: Scene): Mesh
  • Parameters

    • name: string

      defines the name of the mesh.

    • options: ICreateCapsuleOptions

      the constructors options used to shape the mesh.

    • scene: Scene

      defines the scene the mesh is scoped to.

    Returns Mesh

    the capsule mesh

Static CreateCylinder

  • CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene?: Scene, updatable?: any, sideOrientation?: number): Mesh
  • Creates a cylinder or a cone mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • height: number

      sets the height size (float) of the cylinder/cone (float, default 2)

    • diameterTop: number

      set the top cap diameter (floats, default 1)

    • diameterBottom: number

      set the bottom cap diameter (floats, default 1). This value can't be zero

    • tessellation: number

      sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance

    • subdivisions: any

      sets the number of rings along the cylinder height (positive integer, default 1)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: any

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateDashedLines

  • CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene?: Nullable<Scene>, updatable?: boolean, instance?: LinesMesh): LinesMesh
  • Creates a dashed line mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • points: Vector3[]

      is an array successive Vector3

    • dashSize: number

      is the size of the dashes relatively the dash number (positive float, default 3)

    • gapSize: number

      is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)

    • dashNb: number

      is the intended total number of dashes (positive integer, default 200)

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional instance: LinesMesh

      is an instance of an existing LineMesh object to be updated with the passed points parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines)

    Returns LinesMesh

    a new Mesh

Static CreateDecal

  • CreateDecal(name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle: number): Mesh
  • Creates a decal mesh. Please consider using the same method from the MeshBuilder class instead. A decal is a mesh usually applied as a model onto the surface of another mesh

    Parameters

    • name: string

      defines the name of the mesh

    • sourceMesh: AbstractMesh

      defines the mesh receiving the decal

    • position: Vector3

      sets the position of the decal in world coordinates

    • normal: Vector3

      sets the normal of the mesh where the decal is applied onto in world coordinates

    • size: Vector3

      sets the decal scaling

    • angle: number

      sets the angle to rotate the decal

    Returns Mesh

    a new Mesh

Static CreateDisc

  • CreateDisc(name: string, radius: number, tessellation: number, scene?: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a plane polygonal mesh. By default, this is a disc. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • radius: number

      sets the radius size (float) of the polygon (default 0.5)

    • tessellation: number

      sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateGround

  • CreateGround(name: string, width: number, height: number, subdivisions: number, scene?: Scene, updatable?: boolean): Mesh
  • Creates a ground mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • width: number

      set the width of the ground

    • height: number

      set the height of the ground

    • subdivisions: number

      sets the number of subdivisions per side

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    Returns Mesh

    a new Mesh

Static CreateGroundFromHeightMap

  • CreateGroundFromHeightMap(name: string, url: string, width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, scene: Scene, updatable?: boolean, onReady?: (mesh: GroundMesh) => void, alphaFilter?: number): GroundMesh
  • Creates a ground mesh from a height map. Please consider using the same method from the MeshBuilder class instead

    see

    https://doc.babylonjs.com/babylon101/height_map

    Parameters

    • name: string

      defines the name of the mesh to create

    • url: string

      sets the URL of the height map image resource

    • width: number

      set the ground width size

    • height: number

      set the ground height size

    • subdivisions: number

      sets the number of subdivision per side

    • minHeight: number

      is the minimum altitude on the ground

    • maxHeight: number

      is the maximum altitude on the ground

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional onReady: (mesh: GroundMesh) => void

      is a callback function that will be called once the mesh is built (the height map download can last some time)

        • (mesh: GroundMesh): void
        • Parameters

          • mesh: GroundMesh

          Returns void

    • Optional alphaFilter: number

      will filter any data where the alpha channel is below this value, defaults 0 (all data visible)

    Returns GroundMesh

    a new Mesh

Static CreateHemisphere

  • CreateHemisphere(name: string, segments: number, diameter: number, scene?: Scene): Mesh
  • Creates a hemisphere mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • segments: number

      sets the sphere number of horizontal stripes (positive integer, default 32)

    • diameter: number

      sets the diameter size (float) of the sphere (default 1)

    • Optional scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

Static CreateIcoSphere

  • CreateIcoSphere(name: string, options: { flat?: boolean; radius?: number; sideOrientation?: number; subdivisions?: number; updatable?: boolean }, scene: Scene): Mesh
  • Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided

    • The parameter radius sets the radius size (float) of the icosphere (default 1)
    • You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters radiusX, radiusY and radiusZ (all by default have the same value than radius)
    • The parameter subdivisions sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
    • The parameter flat (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
    • You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
    • If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters frontUVs and backUVs (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
    • The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created
    see

    https://doc.babylonjs.com/how_to/polyhedra_shapes#icosphere

    Parameters

    • name: string

      defines the name of the mesh

    • options: { flat?: boolean; radius?: number; sideOrientation?: number; subdivisions?: number; updatable?: boolean }

      defines the options used to create the mesh

      • Optional flat?: boolean
      • Optional radius?: number
      • Optional sideOrientation?: number
      • Optional subdivisions?: number
      • Optional updatable?: boolean
    • scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

Static CreateLathe

  • CreateLathe(name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates lathe mesh. The lathe is a shape with a symetry axis : a 2D model shape is rotated around this axis to design the lathe. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero

    • radius: number

      is the radius value of the lathe

    • tessellation: number

      is the side number of the lathe.

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateLines

  • CreateLines(name: string, points: Vector3[], scene?: Nullable<Scene>, updatable?: boolean, instance?: Nullable<LinesMesh>): LinesMesh
  • Creates a line mesh. Please consider using the same method from the MeshBuilder class instead.

    Parameters

    • name: string

      defines the name of the mesh to create

    • points: Vector3[]

      is an array successive Vector3

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional instance: Nullable<LinesMesh>

      is an instance of an existing LineMesh object to be updated with the passed points parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines).

    Returns LinesMesh

    a new Mesh

Static CreatePlane

  • CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a plane mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • size: number

      sets the size (float) of both sides of the plane at once (default 1)

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreatePolygon

  • CreatePolygon(name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection?: any): Mesh
  • Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh. The parameter shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors. You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created. Remember you can only change the shape positions, not their number when updating a polygon.

    see

    https://doc.babylonjs.com/how_to/parametric_shapes#non-regular-polygon

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors

    • scene: Scene

      defines the hosting scene

    • Optional holes: Vector3[][]

      is a required array of arrays of successive Vector3 used to defines holes in the polygon

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional earcutInjection: any

      can be used to inject your own earcut reference

    Returns Mesh

    a new Mesh

Static CreatePolyhedron

  • CreatePolyhedron(name: string, options: { custom?: any; faceColors?: Color4[]; faceUV?: Vector4[]; sideOrientation?: number; size?: number; sizeX?: number; sizeY?: number; sizeZ?: number; type?: number; updatable?: boolean }, scene: Scene): Mesh
  • Creates a polyhedron mesh. Please consider using the same method from the MeshBuilder class instead.

    • The parameter type (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted type
    • The parameter size (positive float, default 1) sets the polygon size
    • You can overwrite the size on each dimension bu using the parameters sizeX, sizeY or sizeZ (positive floats, default to size value)
    • You can build other polyhedron types than the 15 embbeded ones by setting the parameter custom (polyhedronObject, default null). If you set the parameter custom, this overwrittes the parameter type
    • A polyhedronObject is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
    • You can set the color and the UV of each side of the polyhedron with the parameters faceColors (Color4, default (1, 1, 1, 1)) and faceUV (Vector4, default (0, 0, 1, 1))
    • To understand how to set faceUV or faceColors, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors
    • The parameter flat (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, faceColors and faceUV are ignored
    • You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
    • If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters frontUVs and backUVs (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
    • The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created

    Parameters

    • name: string

      defines the name of the mesh to create

    • options: { custom?: any; faceColors?: Color4[]; faceUV?: Vector4[]; sideOrientation?: number; size?: number; sizeX?: number; sizeY?: number; sizeZ?: number; type?: number; updatable?: boolean }

      defines the options used to create the mesh

      • Optional custom?: any
      • Optional faceColors?: Color4[]
      • Optional faceUV?: Vector4[]
      • Optional sideOrientation?: number
      • Optional size?: number
      • Optional sizeX?: number
      • Optional sizeY?: number
      • Optional sizeZ?: number
      • Optional type?: number
      • Optional updatable?: boolean
    • scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

Static CreateRibbon

  • CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, scene?: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates a ribbon mesh. Please consider using the same method from the MeshBuilder class instead

    see

    https://doc.babylonjs.com/how_to/parametric_shapes

    Parameters

    • name: string

      defines the name of the mesh to create

    • pathArray: Vector3[][]

      is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.

    • closeArray: boolean

      creates a seam between the first and the last paths of the path array (default is false)

    • closePath: boolean

      creates a seam between the first and the last points of each path of the path array

    • offset: number

      is taken in account only if the pathArray is containing a single path

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

      defines an instance of an existing Ribbon object to be updated with the passed pathArray parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon)

    Returns Mesh

    a new Mesh

Static CreateSphere

  • CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a sphere mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • segments: number

      sets the sphere number of horizontal stripes (positive integer, default 32)

    • diameter: number

      sets the diameter size (float) of the sphere (default 1)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateTiledGround

  • CreateTiledGround(name: string, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: { h: number; w: number }, precision: { h: number; w: number }, scene: Scene, updatable?: boolean): Mesh
  • Creates a tiled ground mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • xmin: number

      set the ground minimum X coordinate

    • zmin: number

      set the ground minimum Y coordinate

    • xmax: number

      set the ground maximum X coordinate

    • zmax: number

      set the ground maximum Z coordinate

    • subdivisions: { h: number; w: number }

      is an object {w: positive integer, h: positive integer} (default {w: 6, h: 6}). w and h are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile

      • h: number
      • w: number
    • precision: { h: number; w: number }

      is an object {w: positive integer, h: positive integer} (default {w: 2, h: 2}). w and h are the numbers of subdivisions on the ground width and height of each tile

      • h: number
      • w: number
    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    Returns Mesh

    a new Mesh

Static CreateTorus

  • CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a torus mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • diameter: number

      sets the diameter size (float) of the torus (default 1)

    • thickness: number

      sets the diameter size of the tube of the torus (float, default 0.5)

    • tessellation: number

      sets the number of torus sides (postive integer, default 16)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateTorusKnot

  • CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a torus knot mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • radius: number

      sets the global radius size (float) of the torus knot (default 2)

    • tube: number

      sets the diameter size of the tube of the torus (float, default 0.5)

    • radialSegments: number

      sets the number of sides on each tube segments (positive integer, default 32)

    • tubularSegments: number

      sets the number of tubes to decompose the knot into (positive integer, default 32)

    • p: number

      the number of windings on X axis (positive integers, default 2)

    • q: number

      the number of windings on Y axis (positive integers, default 3)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateTube

  • CreateTube(name: string, path: Vector3[], radius: number, tessellation: number, radiusFunction: (i: number, distance: number) => number, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates a tube mesh. The tube is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead

    see

    https://doc.babylonjs.com/how_to/parametric_shapes

    Parameters

    • name: string

      defines the name of the mesh to create

    • path: Vector3[]

      is a required array of successive Vector3. It is the curve used as the axis of the tube

    • radius: number

      sets the tube radius size

    • tessellation: number

      is the number of sides on the tubular surface

    • radiusFunction: (i: number, distance: number) => number

      is a custom function. If it is not null, it overwrittes the parameter radius. This function is called on each point of the tube path and is passed the index i of the i-th point and the distance of this point from the first point of the path

        • (i: number, distance: number): number
        • Parameters

          • i: number
          • distance: number

          Returns number

    • cap: number

      sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

      is an instance of an existing Tube object to be updated with the passed pathArray parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube)

    Returns Mesh

    a new Mesh

Static ExtrudePolygon

  • ExtrudePolygon(name: string, shape: Vector3[], depth: number, scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection?: any): Mesh
  • Creates an extruded polygon mesh, with depth in the Y direction. Please consider using the same method from the MeshBuilder class instead.

    see

    https://doc.babylonjs.com/how_to/parametric_shapes#extruded-non-regular-polygon

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors

    • depth: number

      defines the height of extrusion

    • scene: Scene

      defines the hosting scene

    • Optional holes: Vector3[][]

      is a required array of arrays of successive Vector3 used to defines holes in the polygon

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional earcutInjection: any

      can be used to inject your own earcut reference

    Returns Mesh

    a new Mesh

Static ExtrudeShape

  • ExtrudeShape(name: string, shape: Vector3[], path: Vector3[], scale: number, rotation: number, cap: number, scene?: Nullable<Scene>, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates an extruded shape mesh. The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead

    see

    https://doc.babylonjs.com/how_to/parametric_shapes

    see

    https://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis

    • path: Vector3[]

      is a required array of successive Vector3. This is the axis curve the shape is extruded along

    • scale: number

      is the value to scale the shape

    • rotation: number

      is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve

    • cap: number

      sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

      is an instance of an existing ExtrudedShape object to be updated with the passed shape, path, scale or rotation parameters (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#extruded-shape)

    Returns Mesh

    a new Mesh

Static ExtrudeShapeCustom

  • ExtrudeShapeCustom(name: string, shape: Vector3[], path: Vector3[], scaleFunction: Function, rotationFunction: Function, ribbonCloseArray: boolean, ribbonClosePath: boolean, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates an custom extruded shape mesh. The custom extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead

    see

    https://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis

    • path: Vector3[]

      is a required array of successive Vector3. This is the axis curve the shape is extruded along

    • scaleFunction: Function

      is a custom Javascript function called on each path point

    • rotationFunction: Function

      is a custom Javascript function called on each path point

    • ribbonCloseArray: boolean

      forces the extrusion underlying ribbon to close all the paths in its pathArray

    • ribbonClosePath: boolean

      forces the extrusion underlying ribbon to close its pathArray

    • cap: number

      sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

      is an instance of an existing ExtrudedShape object to be updated with the passed shape, path, scale or rotation parameters (https://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh#extruded-shape)

    Returns Mesh

    a new Mesh

Static MergeMeshes

  • MergeMeshes(meshes: Mesh[], disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh, subdivideWithSubMeshes?: boolean, multiMultiMaterials?: boolean): Nullable<Mesh>
  • Merge the array of meshes into a single mesh for performance reasons.

    Parameters

    • meshes: Mesh[]

      defines he vertices source. They should all be of the same material. Entries can empty

    • Optional disposeSource: boolean

      when true (default), dispose of the vertices from the source meshes

    • Optional allow32BitsIndices: boolean

      when the sum of the vertices > 64k, this must be set to true

    • Optional meshSubclass: Mesh

      when set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class.

    • Optional subdivideWithSubMeshes: boolean

      when true (false default), subdivide mesh to his subMesh array with meshes source.

    • Optional multiMultiMaterials: boolean

      when true (false default), subdivide mesh and accept multiple multi materials, ignores subdivideWithSubMeshes.

    Returns Nullable<Mesh>

    a new mesh

Static MinMax

  • MinMax(meshes: AbstractMesh[]): { max: Vector3; min: Vector3 }
  • Returns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates

    Parameters

    • meshes: AbstractMesh[]

      defines the list of meshes to scan

    Returns { max: Vector3; min: Vector3 }

    an object {min: Vector3, max: Vector3}

    • max: Vector3
    • min: Vector3

Static Parse

  • Parse(parsedMesh: any, scene: Scene, rootUrl: string): Mesh
  • Returns a new Mesh object parsed from the source provided.

    Parameters

    • parsedMesh: any

      is the source

    • scene: Scene

      defines the hosting scene

    • rootUrl: string

      is the root URL to prefix the delayLoadingFile property with

    Returns Mesh

    a new Mesh

Static ParseAnimationRanges

  • ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void
  • 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

Legend

  • Constructor
  • Property
  • Method

Generated using TypeDoc