API

Class GaussianSplattingCompoundMesh

Class used to compose multiple Gaussian Splatting meshes into a single draw call, with per-part world-matrix and visibility control via addPart/addParts/removePart.

This is the recommended class for multi-part Gaussian Splatting use cases.

Next major version: the compound mesh API (addPart/addParts/removePart) will move exclusively to this class and will be removed from GaussianSplattingMesh.

Hierarchy (View Summary)

Index
actionManager alphaIndex alwaysSelectAsActiveMesh animations cullingStrategy customMarkAsDirty decalMap definedFacingForward delayLoadingFile delayLoadState doNotSyncBoundingInfo edgesColor edgesRenderer edgesShareWithInstances edgesWidth ellipsoid ellipsoidOffset enablePointerMoveEvents forceRenderingWhenOccluded id ignoreCameraMaxZ ignoreNonUniformScaling inspectableCustomProperties instancedBuffers instances isBlocker isNearGrabbable isNearPickable isOccluded isOcclusionQueryInProgress isPickable metadata name occlusionForRenderPassId occlusionQueryAlgorithmType occlusionRetryCount occlusionType onAccessibilityTagChangedObservable onAfterWorldMatrixUpdateObservable onCollideObservable onCollisionPositionChangeObservable onDisposeObservable onLODLevelSelection onMaterialChangedObservable onMeshReadyObservable onPartCountChangedObservable onPartRemovedObservable onReady onRebuildObservable outlineColor outlineWidth overlayAlpha overlayColor physicsBody physicsImpostor reIntegrateRotationIntoRotationQuaternion renderOutline renderOverlay reservedDataStore safeOrbitCameraLimits scalingDeterminant showBoundingBox showSubMeshesBoundingBox state subMeshes thinInstanceAllowAutomaticStaticBufferRecreation thinInstanceCount thinInstanceEnablePicking uniqueId useOctreeForCollisions useOctreeForPicking useOctreeForRenderingSelection viewUpdateThreshold BACKSIDE BillboardUseParentOrientation BOTTOM CAP_ALL CAP_END CAP_START CENTER CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY CULLINGSTRATEGY_OPTIMISTIC_INCLUSION CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY CULLINGSTRATEGY_STANDARD DefaultIsPickable DEFAULTSIDE DOUBLESIDE FLIP_N_ROTATE_ROW FLIP_N_ROTATE_TILE FLIP_ROW FLIP_TILE FRONTSIDE INSTANCEDMESH_SORT_TRANSPARENT LEFT LogSortPerformance NO_CAP NO_FLIP OCCLUSION_ALGORITHM_TYPE_ACCURATE OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE OCCLUSION_TYPE_NONE OCCLUSION_TYPE_OPTIMISTIC OCCLUSION_TYPE_STRICT ProgressiveUpdateAmount RIGHT ROTATE_ROW ROTATE_TILE TOP UseCountingSort
absolutePosition absoluteRotationQuaternion absoluteScaling accessibilityTag animationPropertiesOverride applyFog areNormalsFrozen bakedVertexAnimationManager behaviors billboardMode centersTexture checkCollisions cloneMeshMap collider collisionGroup collisionMask collisionResponse collisionRetryCount colorsTexture compensation computeBonesUsingShaders covariancesATexture covariancesBTexture disableDepthSort doNotSerialize enableDistantPicking facetDepthSortFrom facetNb forcedInstanceCount forceWorldMatrixInstancedBufferUpdate forward geometry hasBoundingInfo hasInstances hasLODLevels hasThinInstances hasVertexAlpha infiniteDistance inheritVisibility isAnInstance isBlocked isFacetDataEnabled isUnIndexed isVisible isWorldMatrixFrozen kernelSize layerMask lightSources manualUpdateOfPreviousWorldMatrixInstancedBuffer manualUpdateOfWorldMatrixInstancedBuffer material maxShDegree meshBlendingTag minPixelSize morphTargetManager mustDepthSortFacets needsRotationScaleTextures nonUniformScaling numBoneInfluencers onAfterRenderObservable onBeforeBindObservable onBeforeDraw onBeforeDrawObservable onBeforeRenderObservable onBetweenPassObservable onClonedObservable onCollide onCollisionPositionChange onDispose onEffectiveEnabledStateChangedObservable onEnabledStateChangedObservable overrideMaterialSideOrientation overridenInstanceCount overrideRenderingFillMode parent partCount partIndicesTexture partitioningBBoxRatio partitioningSubdivisions partVisibility pointerOverDisableMeshTesting position previousWorldMatrixInstancedBuffer rawBoundingInfo receiveShadows renderedSplatCount renderingGroupId right rotation rotationQuaternion rotationsATexture rotationsBTexture rotationScaleTexture scaling shData shDegree shTextures sideOrientation skeleton sogParams source splatBudget splatCount splatsData splatSizeRange surroundingMeshes up useBones useLODScreenCoverage useSog useVertexColors viewDirectionFactor visibility worldMatrixFromCache worldMatrixInstancedBuffer BILLBOARDMODE_ALL BILLBOARDMODE_NONE BILLBOARDMODE_USE_POSITION BILLBOARDMODE_X BILLBOARDMODE_Y BILLBOARDMODE_Z
_getCameraDirection _invalidateInstanceVertexArrayObject _updateBoundingInfo addBehavior addChild addLODLevel addPart addParts addRotation alignWithNormal applyAngularImpulse applyDisplacementMap applyDisplacementMapFromBuffer applyImpulse applySkeleton applyTorque attachToBone bakeCurrentTransformIntoVertices bakeTransformIntoVertices beginAnimation buildBoundingInfo calcMovePOV calcRotatePOV cleanMatrixWeights clone compactAtlas computeWorldMatrix convertToFlatShadedMesh convertToUnIndexedMesh copyVerticesData createAnimationRange createInstance createNormals createOrUpdateSubmeshesOctree deleteAnimationRange detachFromBone directRender disableEdgesRendering disableFacetData dispose enableEdgesRendering flipFaces forceSharedVertices freezeNormals freezeWorldMatrix getAbsolutePivotPoint getAbsolutePivotPointToRef getAbsolutePosition getAnimatables getAnimationByName getAnimationRange getAnimationRanges getBehaviorByName getBoundingInfo getChildMeshes getChildren getChildTransformNodes getClassName getClosestFacetAtCoordinates getClosestFacetAtLocalCoordinates getConnectedParticleSystems getDescendants getDirection getDirectionToRef getDistanceToCamera getEmittedParticleSystems getEngine getFacetDataParameters getFacetLocalNormals getFacetLocalPartitioning getFacetLocalPositions getFacetNormal getFacetNormalToRef getFacetPosition getFacetPositionToRef getFacetsAtLocalCoordinates getHierarchyBoundingVectors getHierarchyEmittedParticleSystems getIndices getLoadingPromise getLOD getLODLevelAtDistance getLODLevels getMaterialForRenderPass getMeshUniformBuffer getNormalsData getPartVisibility getPhysicsBody getPhysicsImpostor getPivotMatrix getPivotPoint getPivotPointToRef getPoseMatrix getPositionData getPositionExpressedInLocalSpace getPositionInCameraSpace getRawBoundingInfo getScene getTotalIndices getTotalVertices getVertexBuffer getVerticesData getVerticesDataKinds getWorldMatrix getWorldMatrixForPart increaseVertices instantiateHierarchy intersects intersectsMesh intersectsPoint isCompletelyInFrustum isDescendantOf isDisposed isEnabled isInFrustum isReady isUsingPivotMatrix isUsingPostMultiplyPivotMatrix isVertexBufferUpdatable isVerticesDataPresent isWorldMatrixCameraDependent loadDataAsync loadFileAsync locallyTranslate lookAt makeGeometryUnique markAsDirty markVerticesDataAsUpdatable movePOV moveWithCollisions normalizeToUnitCube optimizeIndices optimizeIndicesAsync refreshBoundingInfo registerAfterRender registerAfterWorldMatrixUpdate registerBeforeRender registerInstancedBuffer registerLodBudgetParticipant releaseSubMeshes removeBehavior removeChild removeLODLevel removePart removeVerticesData render renderWithRenderPassId reserveStreamingPart resetDrawCache resetLocalMatrix rotate rotateAround rotatePOV serialize serializeAnimationRanges setAbsolutePosition setBoundingInfo setDirection setEnabled setIndexBuffer setIndices setMaterialById setMaterialByID setMaterialForRenderPass setNormalsForCPUSkinning setParent setPartSplatRanges setPartVisibility setPhysicsLinkWith setPivotMatrix setPivotPoint setPositionsForCPUSkinning setPositionWithLocalVector setPreTransformMatrix setSplatIndexRanges setVerticesBuffer setVerticesData setWorldMatrixForPart simplify subdivide synchronizeInstances thinInstanceAdd thinInstanceAddSelf thinInstanceBufferUpdated thinInstanceGetWorldMatrices thinInstancePartialBufferUpdate thinInstanceRefreshBoundingInfo thinInstanceRegisterAttribute thinInstanceSetAttributeAt thinInstanceSetBuffer thinInstanceSetMatrixAt toLeftHanded toString transferToEffect translate unfreezeNormals unfreezeWorldMatrix unregisterAfterRender unregisterAfterWorldMatrixUpdate unregisterBeforeRender unregisterLodBudgetParticipant updateData updateDataAsync updateFacetData updateIndices updateMeshPositions updatePoseMatrix updateVerticesData validateSkinning AddNodeConstructor Center Construct ConvertPLYToSplat ConvertPLYToSplatAsync ConvertPLYWithSHToSplat ConvertPLYWithSHToSplatAsync CreateBox CreateCapsule CreateCylinder CreateDashedLines CreateDecal CreateDisc CreateGround CreateGroundFromHeightMap CreateHemisphere CreateIcoSphere CreateLathe CreateLines CreatePlane CreatePolygon CreatePolyhedron CreateRibbon CreateSphere CreateTiledGround CreateTorus CreateTorusKnot CreateTube ExtendToGoldberg ExtrudePolygon ExtrudeShape ExtrudeShapeCustom MergeMeshes MergeMeshesAsync MinMax Parse ParseAnimationRanges ParseHeader
actionManager: Nullable<AbstractActionManager> = null

Gets or sets the current action manager

alphaIndex: number = Number.MAX_VALUE

Gets or sets the alpha index used to sort transparent meshes

alwaysSelectAsActiveMesh: boolean = false

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

animations: Animation[] = []

Gets a list of Animations associated with the node

cullingStrategy: number = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY

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.
customMarkAsDirty: () => void

Allow user to specify custom mechanism for mark as dirty

Gets or sets the decal map for this mesh

definedFacingForward: boolean = true

Gets or sets the orientation for POV movement & rotation

delayLoadingFile: string

Gets the file containing delay loading data for this mesh

delayLoadState: number = Constants.DELAYLOADSTATE_NONE

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

doNotSyncBoundingInfo: boolean = false

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

edgesColor: Color4 = ...

Defines edge color used when edgesRenderer is enabled

edgesRenderer: Nullable<EdgesRenderer>

Gets the edgesRenderer associated with the mesh

edgesShareWithInstances: boolean

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

edgesWidth: number = 1

Defines edge width used when edgesRenderer is enabled

ellipsoid: Vector3 = ...

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

ellipsoidOffset: Vector3 = ...

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

enablePointerMoveEvents: boolean = false

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

forceRenderingWhenOccluded: boolean

Flag to force rendering the mesh even if occluded

id: string

Gets or sets the id of the node

ignoreCameraMaxZ: boolean = false

Gets or sets a boolean indicating whether to render ignoring the active camera's max z setting. (false by default) You should not mix meshes that have this property set to true with meshes that have it set to false if they all write to the depth buffer, because the z-values are not comparable in the two cases and you will get rendering artifacts if you do. You can set the property to true for meshes that do not write to the depth buffer, or set the same value (either false or true) otherwise. Note this will reduce performance when set to true.

ignoreNonUniformScaling: boolean = false

Gets or sets a boolean indicating that non uniform scaling (when at least one component is different from others) should be ignored. By default the system will update normals to compensate

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

instancedBuffers: { [key: string]: any }

Object used to store instanced buffers defined by user

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.

isBlocker: boolean = false

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

isNearGrabbable: boolean = false

Gets or sets a boolean indicating if the mesh can be grabbed. Default is false. Setting this to true, while using the XR near interaction feature, will trigger a pointer event when the mesh is grabbed. Grabbing means that the controller is using the squeeze or main trigger button to grab the mesh. This is different from nearPickable which only triggers the event when the mesh is touched by the controller

isNearPickable: boolean = false

Gets or sets a boolean indicating if the mesh can be near picked (touched by the XR controller or hands). Default is false

isOccluded: boolean

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

isOcclusionQueryInProgress: boolean

Flag to check the progress status of the query

isPickable: boolean = AbstractMesh.DefaultIsPickable

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

metadata: any = null

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

name: string

Gets or sets the name of the node

occlusionForRenderPassId: number

This number indicates the render pass id used to run the occlusion query. The default value is -1, which means run the occlusion query in all render passes.

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.
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 retrieved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decides to show or hide the object. The default value is -1 which means don't break the query and wait till the result

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 within 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.
onAccessibilityTagChangedObservable: Observable<Nullable<IAccessibilityTag>> = ...

Observable fired when an accessibility tag is changed

onAfterWorldMatrixUpdateObservable: Observable<TransformNode> = ...

An event triggered after the world matrix is updated

onCollideObservable: Observable<AbstractMesh> = ...

An event triggered when this mesh collides with another one

onCollisionPositionChangeObservable: Observable<Vector3> = ...

An event triggered when the collision's position changes

onDisposeObservable: Observable<Node> = ...

An event triggered when the mesh is disposed

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

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

onMaterialChangedObservable: Observable<AbstractMesh> = ...

An event triggered when material is changed

onMeshReadyObservable: Observable<Mesh>

Will notify when the mesh is completely ready, including materials. Observers added to this observable will be removed once triggered

onPartCountChangedObservable: any = ...

Fired after parts are added or the mesh is rebuilt following a removal. Payload is the new part count.

onPartRemovedObservable: any = ...

Fired after part-removal validation passes but before the mesh is rebuilt. Payload is the original (pre-removal) part index.

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

Callback raised when the node is ready to be used

onRebuildObservable: Observable<AbstractMesh> = ...

An event triggered when the mesh is rebuilt.

outlineColor: Color3 = ...

Defines color to use when rendering outline

outlineWidth: number = 0.02

Define width to use when rendering outline

overlayAlpha: number = 0.5

Defines alpha to use when rendering overlay

overlayColor: Color3 = ...

Defines color to use when rendering overlay

physicsBody: Nullable<PhysicsBody>

Gets or sets the physics body associated with this node.

physicsImpostor: Nullable<PhysicsImpostor>

Gets or sets impostor used for physic simulation

reIntegrateRotationIntoRotationQuaternion: boolean = false

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: boolean

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

renderOverlay: boolean

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

reservedDataStore: any = null

For internal use only. Please do not use.

safeOrbitCameraLimits: Nullable<ISafeOrbitCameraLimits> = null

Safe-orbit camera limits parsed from the source file's metadata, or null when the file carries none. The loader also auto-applies these to an active ArcRotateCamera at load time (unless disableAutoCameraLimits is set); this field exposes the raw values so they can be applied or tracked regardless of the active camera type. See ISafeOrbitCameraLimits.

scalingDeterminant: number = 1

Multiplication factor on scale x/y/z when computing the world matrix. Eg. for a 1x1x1 cube setting this to 2 will make it a 2x2x2 cube

showBoundingBox: boolean

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

showSubMeshesBoundingBox: boolean = false

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

state: string = ""

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

subMeshes: SubMesh[]

Gets or sets the list of subMeshes

thinInstanceAllowAutomaticStaticBufferRecreation: boolean

Indicates that a buffer created as static should be recreated if the buffer is updated (by calling thinInstanceSetMatrixAt or thinInstanceSetAttributeAt, for eg.) If this flag is false (the default behavior), a buffer created as "static" won't show any update done to it, and will stay the same as it was created. Note however that recreating a buffer each time there's a change will have some performance cost, that's why it is set to false by default. You should set this flag to true only if your static buffers should change infrequently. If they change frequently, you should create your buffers as "dynamic" instead.

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: boolean

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

uniqueId: number

Gets or sets the unique id of the node

useOctreeForCollisions: boolean = true

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

useOctreeForPicking: boolean = true

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

useOctreeForRenderingSelection: boolean = true

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

viewUpdateThreshold: number = GaussianSplattingMeshBase._DefaultViewUpdateThreshold

Cosine value of the angle threshold to update view dependent splat sorting. Default is 0.0001.

BACKSIDE: 1 = VertexData.BACKSIDE

Mesh side orientation : usually the internal or back surface

BillboardUseParentOrientation: boolean = false

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

BOTTOM: 4

Mesh tile positioning : part tiles on bottom

CAP_ALL: 3

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

CAP_END: 2

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

CAP_START: 1

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

CENTER: 0

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

CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY: 1 = Constants.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY

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

CULLINGSTRATEGY_OPTIMISTIC_INCLUSION: 2 = Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION

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

CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY: 3 = Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY

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

CULLINGSTRATEGY_STANDARD: 0 = Constants.MESHES_CULLINGSTRATEGY_STANDARD

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.

DefaultIsPickable: boolean = true

Gets or sets the default value for isPickable for newly created meshes. When set to false, all meshes created after the change will not be pickable by default. Individual meshes can still override this by setting their own isPickable property.

DEFAULTSIDE: 0 = VertexData.DEFAULTSIDE

Mesh side orientation : by default, FRONTSIDE

DOUBLESIDE: 2 = VertexData.DOUBLESIDE

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

FLIP_N_ROTATE_ROW: 6

Mesh pattern setting : rotate pattern and rotate

FLIP_N_ROTATE_TILE: 5

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

FLIP_ROW: 3

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

FLIP_TILE: 1

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

FRONTSIDE: 0 = VertexData.FRONTSIDE

Mesh side orientation : usually the external or front surface

INSTANCEDMESH_SORT_TRANSPARENT: boolean = false

Indicates that the instanced meshes should be sorted from back to front before rendering if their material is transparent

LEFT: 1

Mesh tile positioning : part tiles on left

LogSortPerformance: boolean = false

When true, the depth-sort worker logs each sort's duration (ms) and active splat count to the console. Off by default; intended for performance investigation only.

NO_CAP: 0

Mesh cap setting : no cap

NO_FLIP: 0

Mesh pattern setting : no flip or rotate

OCCLUSION_ALGORITHM_TYPE_ACCURATE: number = 0

Use an accurate occlusion algorithm

OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE: number = 1

Use a conservative occlusion algorithm

OCCLUSION_TYPE_NONE: number = 0

No occlusion

OCCLUSION_TYPE_OPTIMISTIC: number = 1

Occlusion set to optimistic

OCCLUSION_TYPE_STRICT: number = 2

Occlusion set to strict

ProgressiveUpdateAmount: number = 0

Set the number of batch (a batch is 16384 splats) after which a display update is performed A value of 0 (default) means display update will not happens before splat is ready.

RIGHT: 2

Mesh tile positioning : part tiles on right

ROTATE_ROW: 4

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

ROTATE_TILE: 2

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

TOP: 3

Mesh tile positioning : part tiles on top

UseCountingSort: boolean = true

When true (default), the depth-sort worker uses the fast O(n) counting (radix) sort. Set to false to fall back to the legacy comparison sort (useful for A/B comparison or as a safety fallback). The change takes effect on the next sort.

  • get accessibilityTag(): Nullable<IAccessibilityTag>

    Returns Nullable<IAccessibilityTag>

  • set accessibilityTag(value: Nullable<IAccessibilityTag>): void

    Gets or sets the accessibility tag to describe the node for accessibility purpose.

    Parameters

    Returns void

  • 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

  • get cloneMeshMap(): Nullable<{ [id: string]: Mesh | undefined }>

    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<{ [id: string]: Mesh | undefined }>

  • get collisionResponse(): boolean

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

    Returns boolean

  • set collisionResponse(response: boolean): void

    Parameters

    • response: boolean

    Returns void

  • get doNotSerialize(): boolean

    Gets or sets a boolean used to define if the node must be serialized

    Returns boolean

  • set doNotSerialize(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get forcedInstanceCount(): number

    Gets or sets the forced number of instances to display. If 0 (default value), the number of instances is not forced and depends on the draw type (regular / instance / thin instances mesh)

    Returns number

  • set forcedInstanceCount(count: number): void

    Parameters

    • count: number

    Returns void

  • get forceWorldMatrixInstancedBufferUpdate(): boolean

    Gets or sets a boolean indicating that the update of the instance buffer of the world matrices must be performed in all cases (and notably even in frozen mode)

    Returns boolean

  • set forceWorldMatrixInstancedBufferUpdate(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get hasVertexAlpha(): boolean

    Gets or sets a boolean indicating that this mesh needs to use vertex alpha data to render. This property is misnamed and should be useVertexAlpha. Note that the mesh will be rendered with alpha blending when this flag is set even if vertex alpha data is missing from the geometry.

    Returns boolean

  • set hasVertexAlpha(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get inheritVisibility(): boolean

    If set to true, this node, when renderable, will only be visible if its parent(s) are also visible.

    Returns boolean

    false
    
  • set inheritVisibility(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get isVisible(): boolean

    Gets or sets a boolean indicating whether this node is visible, either this node itself when it is renderable or its renderable child nodes when inheritVisibility is true.

    Returns boolean

    true
    
  • set isVisible(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get manualUpdateOfPreviousWorldMatrixInstancedBuffer(): boolean

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

    Returns boolean

  • set manualUpdateOfPreviousWorldMatrixInstancedBuffer(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get manualUpdateOfWorldMatrixInstancedBuffer(): boolean

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

    Returns boolean

  • set manualUpdateOfWorldMatrixInstancedBuffer(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get meshBlendingTag(): number

    Gets or sets the packed mesh-blending tag for this mesh.

    Group ID occupies bits 0..5 and radius class occupies bits 6..7. Use PackMeshBlendingTag to construct the value. Group 0 disables blending; valid participating groups are 1..63. Meshes in the same nonzero group are treated as one logical surface and do not blend together. This visual-only property does not alter geometry, collision queries, depth, normals, or shadows.

    Returns number

  • set meshBlendingTag(value: number): void

    Parameters

    • value: number

    Returns void

  • set onBeforeDraw(callback: () => void): void

    Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead

    Parameters

    • callback: () => void

    Returns void

  • set onCollisionPositionChange(callback: () => void): void

    Set a function to call when the collision's position changes

    Parameters

    • callback: () => void

    Returns void

  • set onDispose(callback: () => void): void

    Sets a callback that will be raised when the node will be disposed

    Parameters

    • callback: () => void

    Returns void

  • get onEffectiveEnabledStateChangedObservable(): Observable<boolean>

    An event triggered when the effective enabled state of the node changes, i.e. whenever the value returned by isEnabled changes. Unlike onEnabledStateChangedObservable, this fires for changes caused by an ancestor's enabled state as well as this node's own state. The observable is created on first access, so no cost is incurred for nodes that never observe it.

    Returns Observable<boolean>

  • get onEnabledStateChangedObservable(): Observable<boolean>

    An event triggered when the enabled state of the node changes. This only reflects changes to the node's own enabled flag (as set via setEnabled), not changes inherited from an ancestor. Use onEffectiveEnabledStateChangedObservable to also be notified when an ancestor's enabled state changes the effective enabled state.

    Returns Observable<boolean>

  • 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

  • get pointerOverDisableMeshTesting(): boolean

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

    Returns boolean

  • set pointerOverDisableMeshTesting(disable: boolean): void

    Parameters

    • disable: boolean

    Returns void

  • get previousWorldMatrixInstancedBuffer(): Float32Array

    Gets the array buffer used to store the instanced buffer used for instances' previous world matrices

    Returns Float32Array

  • get sideOrientation(): number

    Use this property to change the original side orientation defined at construction time Material.sideOrientation will override this value if set User will still be able to change the material sideOrientation afterwards if they really need it

    Returns number

  • set sideOrientation(value: number): void

    Parameters

    • value: number

    Returns void

  • get splatSizeRange(): Nullable<{ max: number; min: number }>

    Returns the min/max size range of splats in this mesh, where size is pow(|det(Σ)|, 1/6) of the 3D covariance matrix — equivalent to the geometric mean of the principal radii. Computed automatically during updateData(). Returns null before any data has been loaded.

    Returns Nullable<{ max: number; min: number }>

  • get useLODScreenCoverage(): boolean

    Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.

    Returns boolean

  • set useLODScreenCoverage(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get worldMatrixFromCache(): Matrix

    Returns directly the latest state of the mesh World matrix. A Matrix is returned.

    Returns Matrix

  • get worldMatrixInstancedBuffer(): Float32Array

    Gets the array buffer used to store the instanced buffer used for instances' world matrices

    Returns Float32Array

  • Adds the passed mesh as a child to the current mesh. The node will remain exactly where it is and its position / rotation will be updated accordingly. This method is equivalent to calling setParent().

    Parameters

    • mesh: TransformNode

      defines the child mesh

    • preserveScalingSign: boolean = false

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

    Returns this

    the current mesh

  • Add multiple meshes to this compound mesh as new parts in a single operation. Splat data is written into texture arrays while the compound refreshes its retained merged source buffers.

    Parameters

    • others: GaussianSplattingMesh[]

      The meshes to add. Each must be fully loaded and must not be a compound.

    • disposeOthers: boolean = true

      Whether to dispose the other meshes after adding them.

    Returns GaussianSplattingPartProxyMesh[]

    an array of placeholder meshes that can be used to manipulate the part transforms

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

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

    • OptionalonSuccess: (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.

    • OptionaluvOffset: Vector2

      is an optional vector2 used to offset UV.

    • OptionaluvScale: Vector2

      is an optional vector2 used to scale UV.

    • forceUpdate: boolean = false

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

    • OptionalonError: (message?: string, exception?: any) => void

      defines a callback called when an error occurs during the processing of the request.

    Returns Mesh

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

    • OptionaluvOffset: Vector2

      is an optional vector2 used to offset UV.

    • OptionaluvScale: Vector2

      is an optional vector2 used to scale UV.

    • forceUpdate: boolean = false

      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.

  • Will start the animation sequence

    Parameters

    • name: string

      defines the range frames for animation sequence

    • Optionalloop: boolean

      defines if the animation should loop (false by default)

    • OptionalspeedRatio: number

      defines the speed factor in which to run the animation (1 by default)

    • OptionalonAnimationEnd: () => void

      defines a function to be executed when the animation ended (undefined by default)

    Returns Nullable<Animatable>

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

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

    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

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

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns Vector3

    the new rotation vector

  • 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

  • Reclaims the atlas rows of parts removed (tombstoned) while a streaming part was resident. removePart on a streaming compound only tombstones — it excludes the part from the render union and hides its proxy, but leaves its rows allocated, since compacting them would relocate the still-resident streaming regions. This method performs that compaction: it rebuilds the shared atlas from the LIVE parts at new, contiguous (row-aligned for streaming) offsets, physically relocating each surviving streaming region's GPU texels, CPU sort positions, and decode/render base offset, and drops the tombstoned rows — shrinking the atlas.

    Call it after removing one or more models to actually free the GPU/CPU memory (e.g. on idle, or once a batch of removals settles). No-op when nothing is tombstoned. Safe while streams are actively decoding: each surviving region is backed up before the old atlas is disposed and restored at its new base after.

    Returns void

  • Copies the requested vertex data kind into the given vertex data map. Float data is constructed if the map doesn't have the data.

    Parameters

    • kind: string

      defines the vertex data kind to use

    • vertexData: { [kind: string]: Float32Array<ArrayBufferLike> }

      defines the map that stores the resulting data

    Returns void

  • Delete a specific animation range

    Parameters

    • name: string

      defines the name of the range to delete

    • deleteFrames: boolean = true

      defines if animation frames from the range must be deleted as well

    Returns 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

  • Prevents the World matrix to be computed any longer. Please note that the "moral" contract is that the world matrix is not going to be updated anymore. It is up to the developer to force updates. You trade flexibility for performance. If you want to update it, you have to unfreeze it first.

    Parameters

    • newWorldMatrix: Nullable<Matrix> = null

      defines an optional matrix to use as world matrix

    • decompose: boolean = false

      defines whether to decompose the given newWorldMatrix or directly assign

    Returns TransformNode

    the TransformNode.

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

    Returns BoundingInfo

    a BoundingInfo

  • Get all child-meshes of this node

    Type Parameters

    Parameters

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

    • Optionalpredicate: (node: Node) => node is T

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    Returns T[]

    an array of AbstractMesh

  • Get all child-meshes of this node

    Parameters

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

    • Optionalpredicate: (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

    Returns AbstractMesh[]

    an array of AbstractMesh

  • Get all direct children of this node

    Type Parameters

    Parameters

    • Optionalpredicate: (node: Node) => node is T

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)

    Returns T[]

    an array of Node

  • Get all direct children of this node

    Parameters

    • Optionalpredicate: (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

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)

    Returns Node[]

    an array of Node

  • Get all child-transformNodes of this node

    Parameters

    • OptionaldirectDescendantsOnly: 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

    • Optionalpredicate: (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

    Returns TransformNode[]

    an array of TransformNode

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

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    • Optionalprojected: Vector3

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

    • checkFace: boolean = false

      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

    • facing: boolean = true

      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)

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

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    • Optionalprojected: Vector3

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

    • checkFace: boolean = false

      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

    • facing: boolean = true

      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)

  • Will return all nodes that have this node as ascendant

    Type Parameters

    Parameters

    • OptionaldirectDescendantsOnly: 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

    • Optionalpredicate: (node: Node) => node is T

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    Returns T[]

    all children nodes of all types

  • Will return all nodes that have this node as ascendant

    Parameters

    • OptionaldirectDescendantsOnly: 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

    • Optionalpredicate: (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

    Returns Node[]

    all children nodes of all types

  • Replaces the base hierarchy bounds computation for compound meshes: computes world bounds from scratch by iterating part 0's local AABB and all proxy meshes, rather than delegating to the base _children traversal which never reaches proxies (they are not parented to the compound). Visibility per-part is respected; invisible parts are excluded.

    Parameters

    • includeDescendants: boolean = true

      when true, includes descendants (default: true)

    • predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null

      optional filter predicate

    Returns { max: Vector3; min: Vector3 }

    world-space min/max of the hierarchy bounding box

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

    Parameters

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

    • OptionalforceCopy: 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

  • 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
    • OptionalbypassInstanceData: boolean

      defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false

    Returns Nullable<VertexBuffer>

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

  • 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
    • OptionalcopyWhenShared: 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

    • OptionalforceCopy: boolean

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

    • OptionalbypassInstanceData: boolean

      defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false

    Returns Nullable<FloatArray>

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

  • Returns a string which contains the list of existing kinds of Vertex Data associated with this mesh.

    Parameters

    • OptionalbypassInstanceData: boolean

      defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false

    Returns string[]

    an array of strings

  • 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 = 1

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

    Returns void

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

    Parameters

    • mesh: AbstractMesh | SolidParticle

      defines a target mesh or SolidParticle to test

    • precise: boolean = false

      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)

    • OptionalincludeDescendants: 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

  • Is this node a descendant of the given node? The function will iterate up the hierarchy until the ancestor was found or no more parents defined

    Parameters

    • ancestor: Node

      defines the parent node to inspect

    Returns boolean

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

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

    • checkAncestors: boolean = true

      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

    To observe changes to the value returned when calling this with checkAncestors set to true (the default, i.e. the effective enabled state), subscribe to onEffectiveEnabledStateChangedObservable. To observe changes to the value returned when calling this with checkAncestors set to false (i.e. this node's own enabled state only), subscribe to onEnabledStateChangedObservable.

  • Is this node ready to be used/rendered. Force-syncs every part proxy's world matrix into _partMatrices BEFORE delegating to the base readiness check. This guarantees that any pending proxy transform changes (for example a user-set proxy.position) are reflected in the next sort post, so the base isReady will only return true once sortAppliedId === sortRequestId for that up-to-date state. Without this, the proxy's onAfterWorldMatrixUpdateObservable would fire during the first render and queue a fresh sort AFTER readiness was reported, leaving the rendered frame with stale splat order on renderCount=1 runs.

    Parameters

    • completeCheck: boolean = false

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

    Returns boolean

    true when ready

  • 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
    • OptionalbypassInstanceData: boolean

      defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false

    Returns boolean

    a 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
    • OptionalbypassInstanceData: boolean

      defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false

    Returns boolean

    a boolean

  • 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

    • yawCor: number = 0

      optional yaw (y-axis) correction in radians

    • pitchCor: number = 0

      optional pitch (x-axis) correction in radians

    • rollCor: number = 0

      optional roll (z-axis) correction in radians

    • space: Space = Space.LOCAL

      the chosen space of the target

    Returns TransformNode

    the TransformNode.

  • 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
    • updatable: boolean = true

      defines if the updated vertex buffer must be flagged as updatable

    Returns void

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

    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

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

    Parameters

    • includeDescendants: boolean = true

      Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false

    • ignoreRotation: boolean = false

      ignore rotation when computing the scale (ie. object will be axis aligned). Default is false

    • Optionalpredicate: 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

  • 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

    • OptionalsuccessCallback: (mesh?: Mesh) => void

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

    Returns Mesh

    the current mesh

  • 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

  • Triggers the draw call for the mesh (or a submesh), for a specific render pass id

    Parameters

    • OptionalrenderPassId: number

      defines the render pass id to use to draw the mesh / submesh. If not provided, use the current renderPassId of the engine.

    • OptionalenableAlphaMode: boolean

      defines if alpha mode can be changed (default: false)

    • OptionaleffectiveMeshReplacement: AbstractMesh

      defines an optional mesh used to provide info for the rendering (default: undefined)

    • OptionalsubMesh: SubMesh

      defines the subMesh to render. If not provided, draw all mesh submeshes (default: undefined)

    • checkFrustumCulling: boolean = true

      defines if frustum culling must be checked (default: true). If you know the mesh is in the frustum (or if you don't care!), you can pass false to optimize.

    Returns GaussianSplattingCompoundMesh

    the current mesh

  • Reserves a contiguous region of capacity splats in the compound as a new part for dynamic (streamed) content. Unlike addPart, no source data is copied: the region is created as invisible padding (zeroed) for a streaming engine to populate over time via the returned handle. The reserved part participates in the compound's single shared depth sort and draw exactly like a static part — it has a partIndex, a per-part world matrix (via its proxy), and a per-part visibility — so streamed splats are sorted and rendered together in one pass with the static parts.

    Add the streaming part LAST (after all static parts). The returned handle drives which of the region's splats render (LOD) and writes their data.

    Parameters

    • capacity: number

      number of splats to reserve

    • worldMatrix: Matrix = ...

      initial world matrix for the region's proxy (e.g. carrying a source's up-axis convention); defaults to identity

    • name: string = ...

      name for the region's proxy mesh

    • shTextureCount: number = 0

      number of packed-u32 higher-order SH textures to allocate as a shared render-target SH atlas the streaming engine bakes into (ceil(coeffs*3/16) for the stream's max SH degree); 0 = no SH

    • shDegree: number = 0

      SH degree of the streamed content (drives the compound's SH_DEGREE); ignored when shTextureCount is 0. The compound keeps the MAX SH degree across its parts.

    • needsRotationScale: boolean = false

      when true, converts the compound's rotation/scale textures to a shared render-target half-float atlas the streaming engine decodes into, so the streamed splats participate in voxel-IBL shadows.

    Returns IGaussianSplattingStreamingPart

    a handle used to populate and control the reserved region

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

    Parameters

    • OptionalpassId: number

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

    • immediate: boolean = false

      If true, the effect will be released immediately, otherwise it will be released at the next frame

    Returns void

  • Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in the given space. space (default LOCAL) can be either Space.LOCAL, either Space.WORLD. Note that the property rotationQuaternion is then automatically updated and the property rotation is set to (0,0,0) and no longer used. The passed axis is also normalized.

    Parameters

    • axis: Vector3

      the axis to rotate around

    • amount: number

      the amount to rotate in radians

    • Optionalspace: Space

      Space to rotate in (Default: local)

    Returns TransformNode

    the TransformNode.

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

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns AbstractMesh

    the current mesh

  • Sets the index buffer of this mesh.

    Parameters

    • indexBuffer: DataBuffer

      Defines the index buffer to use for this mesh

    • totalVertices: number

      Defines the total number of vertices used by the buffer

    • totalIndices: number

      Defines the total number of indices in the index buffer

    • is32Bits: Nullable<boolean> = null

      Defines if the indices are 32 bits. If null (default), the value is guessed from the number of vertices

    Returns void

  • Set the index buffer of this mesh

    Parameters

    • indices: IndicesArray

      defines the source data

    • totalVertices: Nullable<number> = null

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

    • updatable: boolean = false

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

    • dontForceSubMeshRecreation: boolean = false

      defines a boolean indicating that we don't want to force the recreation of sub-meshes if we don't have to (false by default)

    Returns AbstractMesh

    the current mesh

  • 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. If you don't want to preserve the current rotation / position, assign the parent through parent accessor. Note that if the mesh has a pivot matrix / point defined it will be applied after the parent was updated. In that case the node will not remain in the same space as it is, as the pivot will be applied. To avoid this, you can set updatePivot to true and the pivot will be updated to identity

    Parameters

    • node: Nullable<Node>

      the node ot set as the parent

    • preserveScalingSign: boolean = false

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

    • updatePivot: boolean = false

      if true, update the pivot matrix to keep the node in the same space as before

    Returns TransformNode

    this TransformNode.

  • Restricts which source splats of a single part are sorted and rendered, in GLOBAL source-splat coordinates (offsets into the merged atlas). Static parts render fully by default; a streaming part uses this to render only its currently-active LOD splats. The compound recomputes the union of every part's active ranges and drives the single shared depth sort / draw with it, so all parts still sort together in one pass.

    Passing null clears the override for that part (it reverts to rendering its full range). When no part has an override, the compound clears the range filter entirely (renders every splat), which preserves the non-streaming fast path.

    Parameters

    • partIndex: number

      index of the part to constrain

    • ranges: Nullable<readonly IGaussianSplattingSplatRange[]>

      active global source-splat ranges for the part, or null to render the whole part

    Returns void

  • 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

    • updatable: boolean = false

      defines if the updated vertex buffer must be flagged as updatable

    • Optionalstride: number

      defines the data stride size (can be null)

    Returns AbstractMesh

    the current mesh

  • Adds the transformation (matrix) of the current mesh as a thin instance

    Parameters

    • Optionalrefresh: 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

  • 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

    • dataOrLength: number | Float32Array<ArrayBufferLike>

      the data to set in the GPU buffer, or the length (in elements) of data to update starting from the offset. If you pass a length (number), it is the number of elements to update. For example, if kind is "matrix" and you pass 2 as length, it will update 2 matrices (2*16 floats) in the GPU buffer starting from the offset; in this case offset should also be expressed as a number of elements. If you pass a Float32Array, offset is interpreted in floats in the underlying GPU buffer, consistent with low-level buffer update methods such as updateDirectly.

    • offset: number

      the offset in the GPU buffer where to update the data:

      • when dataOrLength is a number, this is an element offset (for example, a matrix index);
      • when dataOrLength is a Float32Array, this is a float offset in the underlying buffer.

    Returns void

  • Refreshes the bounding info, taking into account all the thin instances defined

    Parameters

    • OptionalforceRefreshParentInfo: boolean

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

    • OptionalapplySkeleton: boolean

      defines whether to apply the skeleton before computing the bounding info

    • OptionalapplyMorph: boolean

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

    • OptionalapplyBakedVertexAnimation: boolean

      defines whether to apply baked vertex animation before computing the bounding info

    Returns 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

    • Optionalrefresh: 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

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

      buffer to set

    • Optionalstride: number

      size in floats of each value of the buffer

    • OptionalstaticBuffer: boolean

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

    Returns void

  • Experimental

    Update data from GS (position, orientation, color, scaling)

    Parameters

    • data: ArrayBuffer

      array that contain all the datas

    • Optionalsh: Uint8Array<ArrayBufferLike>[]

      optional array of uint8 array for SH data

    • options: IUpdateOptions = ...

      optional informations on how to treat data (needs to be 3rd for backward compatibility)

    • OptionalpartIndices: Uint8Array<ArrayBufferLike>

      optional array of uint8 for rig node indices

    • OptionalshDegree: number

      optional SH degree of the data

    Returns void

  • Update asynchronously the buffer

    Parameters

    • data: ArrayBuffer

      array buffer containing center, color, orientation and scale of splats

    • Optionalsh: Uint8Array<ArrayBufferLike>[]

      optional array of uint8 array for SH data

    • OptionalpartIndices: Uint8Array<ArrayBufferLike>

      optional array of uint8 for rig node indices

    • OptionalshDegree: number

      optional SH degree of the data

    Returns Promise<void>

    a promise

  • 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

    • OptionalupdateExtends: boolean

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

    • OptionalmakeItUnique: 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 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

  • 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

    • Optionaloptions: any

      defines optional options to transmit to constructors

    Returns Nullable<() => Node>

    the new constructor or null

  • Converts a .ply data with SH coefficients splat if data array buffer is not ply, returns the original buffer

    Parameters

    • data: ArrayBuffer

      the .ply data to load

    • useCoroutine: boolean = false

      use coroutine and yield

    Returns Generator<
        undefined,
        | { buffer: ArrayBuffer; sh?: undefined; shDegree?: undefined }
        | { buffer: ArrayBuffer; sh: any[] | null; shDegree: number },
        unknown,
    >

    the loaded splat buffer and optional array of sh coefficients

  • Creates a cylinder or a cone mesh.

    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

    Please use MeshBuilder instead

  • Creates a decal mesh. . 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

    Please use MeshBuilder instead

  • Creates a plane polygonal mesh. By default, this is a disc.

    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

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

    Please use MeshBuilder instead

  • Creates a ground mesh.

    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

    Please use MeshBuilder instead

  • Creates a ground mesh from a 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)

    • 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

  • Creates a hemisphere mesh.

    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

    Please use MeshBuilder instead

  • 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 (positive 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/features/featuresDeepDive/mesh/creation/set#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

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

      defines the options used to create the mesh

    • _scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

  • Creates lathe mesh. The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe.

    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

    Please use MeshBuilder instead

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

    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

  • Creates a polyhedron mesh. .

    • The parameter type (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embedded 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/features/featuresDeepDive/materials/using/texturePerBoxFace
    • 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/features/featuresDeepDive/mesh/creation/set#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

    • _scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

    Please use MeshBuilder instead

  • Creates a tiled ground mesh.

    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

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

    • _scene: Scene

      defines the hosting scene

    • Optional_updatable: boolean

      defines if the mesh must be flagged as updatable

    Returns Mesh

    a new Mesh

    Please use MeshBuilder instead

  • Creates a torus mesh.

    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 (positive 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

    Please use MeshBuilder instead

  • Creates a torus knot mesh.

    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

    Please use MeshBuilder instead

  • Creates a tube mesh. The tube is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.

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

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

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

    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: Nullable<(i: number, distance: number) => number>

      is a custom Javascript function called on each path point

    • _rotationFunction: Nullable<(i: number, distance: number) => number>

      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/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape)

    Returns Mesh

    a new Mesh

  • Merge the array of meshes into a single mesh for performance reasons.

    Parameters

    • meshes: Mesh[]

      array of meshes with the vertices to merge. Entries cannot be empty meshes.

    • disposeSource: boolean = true

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

    • Optionalallow32BitsIndices: boolean

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

    • OptionalmeshSubclass: Mesh

      (optional) can be set to a Mesh where the merged vertices will be inserted.

    • OptionalsubdivideWithSubMeshes: boolean

      when true (false default), subdivide mesh into subMeshes.

    • OptionalmultiMultiMaterials: boolean

      when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.

    Returns Nullable<Mesh>

    a new mesh

  • Merge the array of meshes into a single mesh for performance reasons.

    Parameters

    • meshes: Mesh[]

      array of meshes with the vertices to merge. Entries cannot be empty meshes.

    • disposeSource: boolean = true

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

    • Optionalallow32BitsIndices: boolean

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

    • OptionalmeshSubclass: Mesh

      (optional) can be set to a Mesh where the merged vertices will be inserted.

    • OptionalsubdivideWithSubMeshes: boolean

      when true (false default), subdivide mesh into subMeshes.

    • OptionalmultiMultiMaterials: boolean

      when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.

    Returns Promise<any>

    a new mesh