bp-cloner
    Preparing search index...

    Class CMesh

    Hierarchy

    • Mesh
      • CMesh
    Index

    Constructors

    Properties

    __occlusionDataStorage _accessibilityTag _binaryInfo _bonesTransformMatrices _boundingInfo _boundingInfoIsDirty _cache _children _childUpdateId _cloner _creationDataStorage _currentRenderId _decalMap _delayInfo _delayLoadingFunction _disposePhysicsObserver _edgesRenderer _geometry _index _indexInSceneTransformNodesArray _instanceDataStorage _internalAbstractMeshDataInfo _internalMetadata _intersectionsInProgress _isDirty _isNode _isWorldMatrixFrozen _lightSources _localMatrix _masterMesh _occlusionDataStorage _occlusionQuery _originalBuilderSideOrientation _parentContainer _parentNode _physicsBody _physicsImpostor _poseMatrix _postMultiplyPivotMatrix _ranges _renderId _renderingGroup _renderOutline _renderOverlay _scaling _scene _shouldGenerateFlatShading _showBoundingBox _submeshesOctree _thinInstanceDataStorage _transformMatrixTexture _uniformBuffer _unIndexed _userInstancedBuffersStorage _userThinInstanceBuffersStorage _waitingData _waitingMaterialId _waitingMorphTargetManagerId _waitingParentId _waitingParentInstanceIndex _waitingParsedUniqueId _worldMatrix _worldMatrixDeterminant _worldMatrixDeterminantIsDirty 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 occlusionQueryAlgorithmType occlusionRetryCount occlusionType onAccessibilityTagChangedObservable onAfterWorldMatrixUpdateObservable onCollideObservable onCollisionPositionChangeObservable onDisposeObservable onLODLevelSelection onMaterialChangedObservable onMeshReadyObservable onReady onRebuildObservable outlineColor outlineWidth overlayAlpha overlayColor physicsBody physicsImpostor reIntegrateRotationIntoRotationQuaternion renderOutline renderOverlay reservedDataStore scalingDeterminant showBoundingBox showSubMeshesBoundingBox state subMeshes thinInstanceAllowAutomaticStaticBufferRecreation thinInstanceCount thinInstanceEnablePicking uniqueId useOctreeForCollisions useOctreeForPicking useOctreeForRenderingSelection _AnimationRangeFactory _GoldbergMeshParser _GreasedLineMeshParser _GreasedLineRibbonMeshParser _GroundMeshParser _LinesMeshParser _TrailMeshParser BACKSIDE BillboardUseParentOrientation BOTTOM CAP_ALL CAP_END CAP_START CENTER CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY CULLINGSTRATEGY_OPTIMISTIC_INCLUSION CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY CULLINGSTRATEGY_STANDARD DEFAULTSIDE DOUBLESIDE FLIP_N_ROTATE_ROW FLIP_N_ROTATE_TILE FLIP_ROW FLIP_TILE FRONTSIDE INSTANCEDMESH_SORT_TRANSPARENT LEFT NO_CAP NO_FLIP OCCLUSION_ALGORITHM_TYPE_ACCURATE OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE OCCLUSION_TYPE_NONE OCCLUSION_TYPE_OPTIMISTIC OCCLUSION_TYPE_STRICT RIGHT ROTATE_ROW ROTATE_TILE TOP

    Accessors

    _isMesh _positions absolutePosition absoluteRotationQuaternion absoluteScaling accessibilityTag animationPropertiesOverride applyFog areNormalsFrozen bakedVertexAnimationManager behaviors billboardMode checkCollisions cloneMeshMap collider collisionGroup collisionMask collisionResponse collisionRetryCount computeBonesUsingShaders doNotSerialize enableDistantPicking facetDepthSortFrom facetNb forcedInstanceCount forceWorldMatrixInstancedBufferUpdate forward geometry hasBoundingInfo hasInstances hasLODLevels hasThinInstances hasVertexAlpha infiniteDistance inheritVisibility isAnInstance isBlocked isFacetDataEnabled isUnIndexed isVisible isWorldMatrixFrozen layerMask lightSources manualUpdateOfPreviousWorldMatrixInstancedBuffer manualUpdateOfWorldMatrixInstancedBuffer material morphTargetManager mustDepthSortFacets nonUniformScaling numBoneInfluencers onAfterRenderObservable onBeforeBindObservable onBeforeDraw onBeforeDrawObservable onBeforeRenderObservable onBetweenPassObservable onClonedObservable onCollide onCollisionPositionChange onDispose onEnabledStateChangedObservable overrideMaterialSideOrientation overridenInstanceCount overrideRenderingFillMode parent partitioningBBoxRatio partitioningSubdivisions pointerOverDisableMeshTesting position preserveParentRotationForBillboard previousWorldMatrixInstancedBuffer rawBoundingInfo receiveShadows renderingGroupId right rotation rotationQuaternion scaling sideOrientation skeleton source surroundingMeshes up useBones useLODScreenCoverage useVertexColors visibility worldMatrixFromCache worldMatrixInstancedBuffer BILLBOARDMODE_ALL BILLBOARDMODE_NONE BILLBOARDMODE_USE_POSITION BILLBOARDMODE_X BILLBOARDMODE_Y BILLBOARDMODE_Z

    Methods

    _activate _addToSceneRootNodes _afterComputeWorldMatrix _bind _bindDirect _buildUniformLayout _checkCollision _checkDelayState _checkOcclusionQuery _collideForSubMesh _copySource _createGlobalSubMesh _disposeInstanceSpecificData _disposeThinInstanceSpecificData _draw _freeze _generatePointsArray _getActionManagerForTrigger _getData _getDescendants _getEffectiveParent _getInstancesRenderList _getRenderingFillMode _getWorldMatrixDeterminant _initCache _invalidateInstanceVertexArrayObject _isSynchronized _markSubMeshesAsAttributesDirty _markSubMeshesAsLightDirty _markSubMeshesAsMiscDirty _markSyncedWithParent _postActivate _preActivate _preActivateForIntermediateRendering _processCollisionsForSubMeshes _processInstancedBuffers _processRendering _rebuild _refreshBoundingInfo _refreshBoundingInfoDirect _registerInstanceForRenderId _removeFromSceneRootNodes _removeLightSource _renderWithInstances _renderWithThinInstances _resetPointsArrayCache _resyncLightSource _resyncLightSources _serializeAsParent _setMaterial _setReady _shouldConvertRHS _syncGeometryWithMorphTargetManager _syncParentEnabledState _thinInstanceCreateMatrixBuffer _thinInstanceInitializeUserStorage _thinInstanceRecreateBuffer _thinInstanceUpdateBufferSize _unBindEffect _unFreeze _updateBoundingInfo _updateCache _updateInstancedBuffers _updateNonUniformScalingState _updateSubMeshesBoundingInfo addBehavior addChild addInstance addLODLevel addRotation alignWithNormal applyAngularImpulse applyDisplacementMap applyDisplacementMapFromBuffer applyImpulse applySkeleton attachToBone bakeCurrentTransformIntoVertices bakeTransformIntoVertices beginAnimation buildBoundingInfo calcMovePOV calcRotatePOV cleanMatrixWeights clone computeWorldMatrix convertToFlatShadedMesh convertToUnIndexedMesh copyVerticesData createAnimationRange createClone createInstance createNormals createOrUpdateSubmeshesOctree delete 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 getLOD getLODLevelAtDistance getLODLevels getMaterialForRenderPass getMeshUniformBuffer getNormalsData getPhysicsBody getPhysicsImpostor getPivotMatrix getPivotPoint getPivotPointToRef getPoseMatrix getPositionData getPositionExpressedInLocalSpace getPositionInCameraSpace getRawBoundingInfo getScene getTotalIndices getTotalVertices getVertexBuffer getVerticesData getVerticesDataKinds getWorldMatrix increaseVertices instantiateHierarchy intersects intersectsMesh intersectsPoint isCompletelyInFrustum isDescendantOf isDisposed isEnabled isInFrustum isReady isSynchronized isSynchronizedWithParent isUsingPivotMatrix isUsingPostMultiplyPivotMatrix isVertexBufferUpdatable isVerticesDataPresent isWorldMatrixCameraDependent locallyTranslate lookAt makeGeometryUnique markAsDirty markVerticesDataAsUpdatable movePOV moveWithCollisions normalizeToUnitCube optimizeIndices optimizeIndicesAsync refreshBoundingInfo registerAfterRender registerAfterWorldMatrixUpdate registerBeforeRender registerInstancedBuffer releaseSubMeshes removeBehavior removeChild removeInstance removeLODLevel removeVerticesData render renderWithRenderPassId resetDrawCache resetLocalMatrix rotate rotateAround rotatePOV serialize serializeAnimationRanges setAbsolutePosition setBoundingInfo setDirection setEnabled setIndexBuffer setIndices setMaterialById setMaterialByID setMaterialForRenderPass setNormalsForCPUSkinning setParent setPhysicsLinkWith setPivotMatrix setPivotPoint setPositionsForCPUSkinning setPositionWithLocalVector setPreTransformMatrix setVerticesBuffer setVerticesData simplify subdivide synchronizeInstances thinInstanceAdd thinInstanceAddSelf thinInstanceBufferUpdated thinInstanceGetWorldMatrices thinInstancePartialBufferUpdate thinInstanceRefreshBoundingInfo thinInstanceRegisterAttribute thinInstanceSetAttributeAt thinInstanceSetBuffer thinInstanceSetMatrixAt toLeftHanded toString transferToEffect translate unfreezeNormals unfreezeWorldMatrix unregisterAfterRender unregisterAfterWorldMatrixUpdate unregisterBeforeRender updateCache updateFacetData updateIndices updateMeshPositions updatePoseMatrix updateVerticesData validateSkinning _GetDefaultSideOrientation _instancedMeshFactory _PhysicsImpostorParser AddNodeConstructor Center Construct 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

    Constructors

    • Parameters

      • name: string
      • scene: Scene
      • parent: null | Mesh
      • cloner: null | Cloner = null

      Returns CMesh

    Properties

    __occlusionDataStorage: _OcclusionDataStorage

    Backing filed

    _accessibilityTag: Nullable<IAccessibilityTag>
    _binaryInfo: any
    _bonesTransformMatrices: Nullable<Float32Array<ArrayBufferLike>>
    _boundingInfo: Nullable<BoundingInfo>
    _boundingInfoIsDirty: boolean
    _cache: any
    _children: Nullable<Node[]>
    _childUpdateId: number
    _cloner: null | Cloner = null
    _creationDataStorage: Nullable<_CreationDataStorage>
    _currentRenderId: number
    _decalMap: Nullable<MeshUVSpaceRenderer>
    _delayInfo: string[]
    _delayLoadingFunction: (any: any, mesh: Mesh) => void
    _disposePhysicsObserver: Nullable<Observer<Node>>
    _edgesRenderer: Nullable<IEdgesRenderer>
    _geometry: Nullable<Geometry>
    _index: number = 0
    _indexInSceneTransformNodesArray: number
    _instanceDataStorage: _InstanceDataStorage
    _internalAbstractMeshDataInfo: _InternalAbstractMeshDataInfo
    _internalMetadata: any
    _intersectionsInProgress: AbstractMesh[]
    _isDirty: boolean
    _isNode: true
    _isWorldMatrixFrozen: boolean
    _lightSources: Light[]
    _localMatrix: Matrix
    _masterMesh: Nullable<AbstractMesh>
    _occlusionDataStorage: _OcclusionDataStorage

    Access property

    _occlusionQuery: Nullable<number | WebGLQuery>
    _originalBuilderSideOrientation: number
    _parentContainer: Nullable<IAssetContainer>
    _parentNode: Nullable<Node>
    _physicsBody: Nullable<PhysicsBody>
    _physicsImpostor: Nullable<PhysicsImpostor>
    _poseMatrix: Nullable<Matrix>
    _postMultiplyPivotMatrix: boolean
    _ranges: { [name: string]: Nullable<AnimationRange> }
    _renderId: number
    _renderingGroup: Nullable<RenderingGroup>
    _renderOutline: boolean

    (Backing field)

    _renderOverlay: boolean

    (Backing field)

    _scaling: Vector3
    _scene: Scene
    _shouldGenerateFlatShading: boolean
    _showBoundingBox: boolean

    (Backing field)

    _submeshesOctree: Octree<SubMesh>

    Backing Field

    _thinInstanceDataStorage: _ThinInstanceDataStorage
    _transformMatrixTexture: Nullable<RawTexture>
    _uniformBuffer: UniformBuffer

    The current mesh uniform buffer. Internal use only.

    _unIndexed: boolean
    _userInstancedBuffersStorage: {
        data: { [key: string]: Float32Array<ArrayBufferLike> };
        sizes: { [key: string]: number };
        strides: { [key: string]: number };
        vertexArrayObjects?: { [key: string]: WebGLVertexArrayObject };
        vertexBuffers: { [key: string]: Nullable<VertexBuffer> };
    }
    _userThinInstanceBuffersStorage: {
        data: { [key: string]: Float32Array<ArrayBufferLike> };
        sizes: { [key: string]: number };
        strides: { [key: string]: number };
        vertexBuffers: { [key: string]: Nullable<VertexBuffer> };
    }
    _waitingData: { actions: any; freezeWorldMatrix: Nullable<boolean>; lods: any }
    _waitingMaterialId: Nullable<string>
    _waitingMorphTargetManagerId: Nullable<number>
    _waitingParentId: Nullable<string>
    _waitingParentInstanceIndex: Nullable<string>
    _waitingParsedUniqueId: Nullable<number>
    _worldMatrix: Matrix
    _worldMatrixDeterminant: number
    _worldMatrixDeterminantIsDirty: boolean
    actionManager: Nullable<AbstractActionManager>

    Gets or sets the current action manager

    alphaIndex: number

    Gets or sets the alpha index used to sort transparent meshes

    alwaysSelectAsActiveMesh: boolean

    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

    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

    decalMap: Nullable<MeshUVSpaceRenderer>

    Gets or sets the decal map for this mesh

    definedFacingForward: boolean

    Gets or sets the orientation for POV movement & rotation

    delayLoadingFile: string

    Gets the file containing delay loading data for this mesh

    delayLoadState: number

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

    doNotSyncBoundingInfo: boolean

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

    edgesColor: Color4

    Defines edge color used when edgesRenderer is enabled

    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

    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

    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

    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

    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

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

    isNearGrabbable: boolean

    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

    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

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

    metadata: any

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

    name: string

    Gets or sets the name of the node

    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

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

    Callback raised when the node is ready to be used

    onRebuildObservable: Observable<AbstractMesh>

    An event triggered when the mesh is rebuilt.

    outlineColor: Color3

    Defines color to use when rendering outline

    outlineWidth: number

    Define width to use when rendering outline

    overlayAlpha: number

    Defines alpha to use when rendering overlay

    overlayColor: Color3

    Defines color to use when rendering overlay

    physicsBody: Nullable<PhysicsBody>
    physicsImpostor: Nullable<PhysicsImpostor>

    Gets or sets impostor used for physic simulation

    reIntegrateRotationIntoRotationQuaternion: boolean

    Gets or sets a boolean indicating that even if rotationQuaternion is defined, you can keep updating rotation property and Babylon.js will just mix both

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

    For internal use only. Please do not use.

    scalingDeterminant: number

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

    showBoundingBox: boolean

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

    showSubMeshesBoundingBox: boolean

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

    state: string

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

    subMeshes: SubMesh[]

    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

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

    useOctreeForPicking: boolean

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

    useOctreeForRenderingSelection: boolean

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

    _AnimationRangeFactory: (
        _name: string,
        _from: number,
        _to: number,
    ) => AnimationRange
    _GoldbergMeshParser: (parsedMesh: any, scene: Scene) => GoldbergMesh
    _GreasedLineMeshParser: (parsedMesh: any, scene: Scene) => Mesh
    _GreasedLineRibbonMeshParser: (parsedMesh: any, scene: Scene) => Mesh
    _GroundMeshParser: (parsedMesh: any, scene: Scene) => Mesh
    _LinesMeshParser: (parsedMesh: any, scene: Scene) => Mesh
    _TrailMeshParser: (parsedMesh: any, scene: Scene) => Mesh
    BACKSIDE: 1

    Mesh side orientation : usually the internal or back surface

    BillboardUseParentOrientation: boolean

    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

    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

    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

    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

    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.

    DEFAULTSIDE: 0

    Mesh side orientation : by default, FRONTSIDE

    DOUBLESIDE: 2

    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

    Mesh side orientation : usually the external or front surface

    INSTANCEDMESH_SORT_TRANSPARENT: boolean

    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

    NO_CAP: 0

    Mesh cap setting : no cap

    NO_FLIP: 0

    Mesh pattern setting : no flip or rotate

    OCCLUSION_ALGORITHM_TYPE_ACCURATE: number

    Use an accurate occlusion algorithm

    OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE: number

    Use a conservative occlusion algorithm

    OCCLUSION_TYPE_NONE: number

    No occlusion

    OCCLUSION_TYPE_OPTIMISTIC: number

    Occlusion set to optimistic

    OCCLUSION_TYPE_STRICT: number

    Occlusion set to strict

    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

    Accessors

    • get _isMesh(): boolean
      Internal

      Returns boolean

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

      Returns Nullable<Vector3[]>

    • get absolutePosition(): Vector3

      Returns the current mesh absolute position. Returns a Vector3.

      Returns Vector3

    • get absoluteRotationQuaternion(): Quaternion

      Returns the current mesh absolute rotation. Returns a Quaternion.

      Returns Quaternion

    • get absoluteScaling(): Vector3

      Returns the current mesh absolute scaling. Returns a Vector3.

      Returns Vector3

    • get accessibilityTag(): Nullable<IAccessibilityTag>

      Returns Nullable<IAccessibilityTag>

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

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

      Parameters

      • value: Nullable<IAccessibilityTag>

      Returns void

    • get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride>

      Gets or sets the animation properties override

      Returns Nullable<AnimationPropertiesOverride>

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

      Parameters

      • value: Nullable<AnimationPropertiesOverride>

      Returns void

    • get applyFog(): boolean

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

      Returns boolean

    • set applyFog(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get 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 bakedVertexAnimationManager(): Nullable<IBakedVertexAnimationManager>

      Gets or sets the baked vertex animation manager

      Returns Nullable<IBakedVertexAnimationManager>

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

      Parameters

      • value: Nullable<IBakedVertexAnimationManager>

      Returns void

    • get billboardMode(): number

      Gets or sets the billboard mode. Default is 0.

      Value Type Description
      0 BILLBOARDMODE_NONE
      1 BILLBOARDMODE_X
      2 BILLBOARDMODE_Y
      4 BILLBOARDMODE_Z
      7 BILLBOARDMODE_ALL

      Returns number

    • set billboardMode(value: number): void

      Parameters

      • value: number

      Returns void

    • get checkCollisions(): boolean

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

      Returns boolean

    • set checkCollisions(collisionEnabled: boolean): void

      Parameters

      • collisionEnabled: boolean

      Returns void

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

      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]: undefined | Mesh }>

    • get collisionGroup(): number

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

      Returns number

    • set collisionGroup(mask: number): void

      Parameters

      • mask: number

      Returns void

    • get collisionMask(): number

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

      Returns number

    • set collisionMask(mask: number): void

      Parameters

      • mask: number

      Returns void

    • get collisionResponse(): boolean

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

      Returns boolean

    • set collisionResponse(response: boolean): void

      Parameters

      • response: boolean

      Returns void

    • get collisionRetryCount(): number

      number of collision detection tries. Change this value if not all collisions are detected and handled properly

      Returns number

    • set collisionRetryCount(retryCount: number): void

      Parameters

      • retryCount: number

      Returns void

    • get computeBonesUsingShaders(): boolean

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

      Returns boolean

    • set computeBonesUsingShaders(value: boolean): void

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

      Parameters

      • value: boolean

      Returns void

    • get doNotSerialize(): boolean

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

      Returns boolean

    • set doNotSerialize(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get enableDistantPicking(): boolean

      When enabled, decompose picking matrices for better precision with large values for mesh position and scling

      Returns boolean

    • set enableDistantPicking(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get facetDepthSortFrom(): Vector3

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

      Returns Vector3

    • set facetDepthSortFrom(location: Vector3): void

      Parameters

      • location: Vector3

      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 forward(): Vector3

      The forward direction of that transform in world space.

      Returns Vector3

    • get geometry(): Nullable<Geometry>

      Gets the mesh internal Geometry object

      Returns Nullable<Geometry>

    • get hasBoundingInfo(): boolean

      Returns true if there is already a bounding info

      Returns boolean

    • get hasInstances(): boolean

      Gets a boolean indicating if this mesh has instances

      Returns boolean

    • get hasLODLevels(): boolean

      Gets a boolean indicating if this mesh has LOD

      Returns boolean

    • get hasThinInstances(): boolean

      Gets a boolean indicating if this mesh has thin instances

      Returns boolean

    • get hasVertexAlpha(): boolean

      Gets or sets a boolean indicating that this mesh 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 infiniteDistance(): boolean

      Gets or sets the distance of the object to max, often used by skybox

      Returns boolean

    • set infiniteDistance(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get inheritVisibility(): boolean

      If set to true, a mesh will only be visible only if its parent(s) are also visible (default is false)

      Returns boolean

    • set inheritVisibility(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isAnInstance(): boolean

      Gets a boolean indicating if this mesh is an instance or a regular mesh

      Returns boolean

    • get isBlocked(): boolean

      Returns true if the mesh is blocked. Implemented by child classes

      Returns boolean

    • get isUnIndexed(): boolean

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

      Returns boolean

    • set isUnIndexed(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isVisible(): boolean

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

      Returns boolean

    • set isVisible(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isWorldMatrixFrozen(): boolean

      True if the World matrix has been frozen.

      Returns boolean

    • get layerMask(): number

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

      Returns number

    • set layerMask(value: number): void

      Parameters

      • value: number

      Returns void

    • get lightSources(): Light[]

      Gets the list of lights affecting that mesh

      Returns Light[]

    • get 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 material(): Nullable<Material>

      Gets or sets current material

      Returns Nullable<Material>

    • set material(value: Nullable<Material>): void

      Gets or sets current material

      Parameters

      • value: Nullable<Material>

      Returns void

    • get morphTargetManager(): Nullable<MorphTargetManager>

      Gets or sets the morph target manager

      Returns Nullable<MorphTargetManager>

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

      Parameters

      • value: Nullable<MorphTargetManager>

      Returns void

    • get mustDepthSortFacets(): boolean

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

      Returns boolean

    • set mustDepthSortFacets(sort: boolean): void

      Parameters

      • sort: boolean

      Returns void

    • get nonUniformScaling(): boolean

      True if the scaling property of this object is non uniform eg. (1,2,1)

      Returns boolean

    • get numBoneInfluencers(): number

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

      Returns number

    • set numBoneInfluencers(value: number): void

      Parameters

      • value: number

      Returns void

    • get onAfterRenderObservable(): Observable<Mesh>

      An event triggered after rendering the mesh

      Returns Observable<Mesh>

    • get onBeforeBindObservable(): Observable<Mesh>

      An event triggered before binding the mesh

      Returns Observable<Mesh>

    • 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

    • get onBeforeDrawObservable(): Observable<Mesh>

      An event triggered before drawing the mesh

      Returns Observable<Mesh>

    • get onBeforeRenderObservable(): Observable<Mesh>

      An event triggered before rendering the mesh

      Returns Observable<Mesh>

    • get onBetweenPassObservable(): Observable<SubMesh>

      An event triggeredbetween rendering pass when using separateCullingPass = true

      Returns Observable<SubMesh>

    • get onClonedObservable(): Observable<Node>

      An event triggered when the node is cloned

      Returns Observable<Node>

    • set onCollide(callback: (collidedMesh?: AbstractMesh) => void): void

      Set a function to call when this mesh collides with another one

      Parameters

      • callback: (collidedMesh?: AbstractMesh) => 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 onEnabledStateChangedObservable(): Observable<boolean>

      An event triggered when the enabled state of the node changes

      Returns Observable<boolean>

    • get overrideMaterialSideOrientation(): number

      Returns number

      Please use sideOrientation instead.

    • set overrideMaterialSideOrientation(value: number): void

      Parameters

      • value: number

      Returns void

    • 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 overrideRenderingFillMode(): Nullable<number>

      Use this property to override the Material's fillMode value

      Returns Nullable<number>

    • set overrideRenderingFillMode(fillMode: Nullable<number>): void

      Parameters

      • fillMode: Nullable<number>

      Returns void

    • get parent(): Nullable<Node>

      Returns Nullable<Node>

    • set parent(parent: Nullable<Node>): void

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

      Parameters

      • parent: Nullable<Node>

      Returns void

    • get partitioningBBoxRatio(): number

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

      Returns number

    • set partitioningBBoxRatio(ratio: number): void

      Parameters

      • ratio: number

      Returns void

    • get partitioningSubdivisions(): number

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

      Returns number

    • set partitioningSubdivisions(nb: number): void

      Parameters

      • nb: number

      Returns void

    • get pointerOverDisableMeshTesting(): boolean

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

      Returns boolean

    • set pointerOverDisableMeshTesting(disable: boolean): void

      Parameters

      • disable: boolean

      Returns void

    • get position(): Vector3

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

      Returns Vector3

    • set position(newPosition: Vector3): void

      Parameters

      • newPosition: Vector3

      Returns void

    • get preserveParentRotationForBillboard(): boolean

      Gets or sets a boolean indicating that parent rotation should be preserved when using billboards. This could be useful for glTF objects where parent rotation helps converting from right handed to left handed

      Returns boolean

    • set preserveParentRotationForBillboard(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get previousWorldMatrixInstancedBuffer(): Float32Array

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

      Returns Float32Array

    • get rawBoundingInfo(): Nullable<BoundingInfo>
      Internal

      Returns Nullable<BoundingInfo>

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

      Parameters

      • boundingInfo: Nullable<BoundingInfo>

      Returns void

    • get receiveShadows(): boolean

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

      Returns boolean

    • set receiveShadows(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get right(): Vector3

      The right direction of that transform in world space.

      Returns Vector3

    • get rotation(): Vector3

      Gets or sets the rotation property : a Vector3 defining the rotation value in radians around each local axis X, Y, Z (default is (0.0, 0.0, 0.0)). If rotation quaternion is set, this Vector3 will be ignored and copy from the quaternion

      Returns Vector3

    • set rotation(newRotation: Vector3): void

      Parameters

      • newRotation: Vector3

      Returns void

    • get rotationQuaternion(): Nullable<Quaternion>

      Gets or sets the rotation Quaternion property : this a Quaternion object defining the node rotation by using a unit quaternion (undefined by default, but can be null). If set, only the rotationQuaternion is then used to compute the node rotation (ie. node.rotation will be ignored)

      Returns Nullable<Quaternion>

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

      Parameters

      • quaternion: Nullable<Quaternion>

      Returns void

    • get scaling(): Vector3

      Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).

      Returns Vector3

    • set scaling(newScaling: Vector3): void

      Parameters

      • newScaling: Vector3

      Returns void

    • 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 skeleton(): Nullable<Skeleton>

      Returns Nullable<Skeleton>

    • set skeleton(value: Nullable<Skeleton>): void

      Gets or sets a skeleton to apply skinning transformations

      Parameters

      • value: Nullable<Skeleton>

      Returns void

    • get source(): Nullable<Mesh>

      Gets the source mesh (the one used to clone this one from)

      Returns Nullable<Mesh>

    • get surroundingMeshes(): Nullable<AbstractMesh[]>

      Gets or sets current surrounding meshes (null by default).

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

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

      Returns Nullable<AbstractMesh[]>

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

      Parameters

      • meshes: Nullable<AbstractMesh[]>

      Returns void

    • get up(): Vector3

      The up direction of that transform in world space.

      Returns Vector3

    • get useBones(): boolean

      Gets a boolean indicating if this mesh has skinning data and an attached skeleton

      Returns boolean

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

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

      Returns boolean

    • set useVertexColors(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get visibility(): number

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

      Returns number

    • set visibility(value: number): void

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

      Parameters

      • value: number

      Returns void

    • get worldMatrixFromCache(): Matrix

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

      Returns Matrix

    • get worldMatrixInstancedBuffer(): Float32Array

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

      Returns Float32Array

    • get BILLBOARDMODE_ALL(): number

      Billboard on all axes

      Returns number

    • get BILLBOARDMODE_NONE(): number

      No billboard

      Returns number

    • get BILLBOARDMODE_USE_POSITION(): number

      Billboard on using position instead of orientation

      Returns number

    • get BILLBOARDMODE_X(): number

      Billboard on X axis

      Returns number

    • get BILLBOARDMODE_Y(): number

      Billboard on Y axis

      Returns number

    • get BILLBOARDMODE_Z(): number

      Billboard on Z axis

      Returns number

    Methods

    • Internal

      Parameters

      • renderId: number
      • intermediateRendering: boolean

      Returns boolean

    • Internal

      Returns void

    • Internal

      Returns void

    • Internal

      Parameters

      • subMesh: SubMesh
      • effect: Effect
      • fillMode: number
      • OptionalallowInstancedRendering: boolean

      Returns Mesh

    • Internal

      Parameters

      • effect: Effect
      • indexToBind: Nullable<DataBuffer>
      • OptionalallowInstancedRendering: boolean

      Returns Mesh

    • Returns void

    • Internal

      Parameters

      • collider: Collider

      Returns AbstractMesh

    • Internal

      Returns Mesh

    • Internal

      Returns boolean

    • Internal

      Parameters

      • subMesh: SubMesh
      • transformMatrix: Matrix
      • collider: Collider

      Returns AbstractMesh

    • Parameters

      • source: Mesh
      • OptionaldoNotCloneChildren: boolean
      • OptionalclonePhysicsImpostor: boolean
      • OptionalcloneThinInstances: boolean

      Returns void

    • Internal

      Parameters

      • force: boolean

      Returns Nullable<SubMesh>

    • Internal

      Returns void

    • Internal

      Returns void

    • Internal

      Parameters

      • subMesh: SubMesh
      • fillMode: number
      • OptionalinstancesCount: number

      Returns Mesh

    • Internal

      Returns void

    • Internal

      Returns boolean

    • Internal

      Parameters

      • Optionaltrigger: number
      • OptionalinitialCall: boolean

      Returns Nullable<AbstractActionManager>

    • Internal

      Parameters

      • options: IMeshDataOptions
      • data: Nullable<FloatArray>
      • Optionalkind: string

      Returns Nullable<FloatArray>

    • Internal

      Parameters

      • results: Node[]
      • OptionaldirectDescendantsOnly: boolean
      • Optionalpredicate: (node: Node) => boolean

      Returns void

    • Internal

      Returns Nullable<Node>

    • Internal

      Parameters

      • subMeshId: number
      • OptionalisReplacementMode: boolean

      Returns _InstancesBatch

    • Internal

      Parameters

      • fillMode: number

      Returns number

    • Internal

      Returns number

    • Internal

      Returns void

    • Invalidate VertexArrayObjects belonging to the mesh (but not to the Geometry of the mesh).

      Returns void

    • Internal

      Returns boolean

    • Internal

      Returns void

    • Internal

      Parameters

      • Optionaldispose: boolean

      Returns void

    • Internal

      Returns void

    • Internal

      Returns void

    • Internal

      Returns void

    • Internal

      Returns Mesh

    • Internal

      Parameters

      • renderId: number

      Returns Mesh

    • Internal

      Parameters

      • collider: Collider
      • transformMatrix: Matrix

      Returns AbstractMesh

    • Internal

      Parameters

      • visibleInstances: Nullable<InstancedMesh[]>
      • renderSelf: boolean

      Returns void

    • Internal

      Parameters

      • renderingMesh: AbstractMesh
      • subMesh: SubMesh
      • effect: Effect
      • fillMode: number
      • batch: _InstancesBatch
      • hardwareInstancedRendering: boolean
      • onBeforeDraw: (isInstance: boolean, world: Matrix, effectiveMaterial?: Material) => void
      • OptionaleffectiveMaterial: Material

      Returns Mesh

    • Internal

      Parameters

      • Optionaldispose: boolean

      Returns void

    • Internal

      Parameters

      • data: Nullable<FloatArray>
      • bias: Nullable<Vector2>

      Returns void

    • Internal

      Parameters

      • extend: { maximum: Vector3; minimum: Vector3 }

      Returns void

    • Internal

      Parameters

      • instance: InstancedMesh
      • renderId: number

      Returns Mesh

    • Internal

      Returns void

    • Internal

      Parameters

      • light: Light
      • dispose: boolean

      Returns void

    • Internal

      Parameters

      • subMesh: SubMesh
      • fillMode: number
      • batch: _InstancesBatch
      • effect: Effect
      • engine: AbstractEngine

      Returns Mesh

    • Internal

      Parameters

      • subMesh: SubMesh
      • fillMode: number
      • effect: Effect
      • engine: AbstractEngine

      Returns void

    • Internal

      Returns Mesh

    • Internal

      Parameters

      • light: Light

      Returns void

    • Internal

      Returns void

    • Internal

      Parameters

      • serializationObject: any

      Returns void

    • Internal

      Parameters

      • value: Nullable<Material>

      Returns void

    • Internal

      Parameters

      • state: boolean

      Returns void

    • Internal

      Returns boolean

    • Internal

      Returns void

    • Internal

      Returns void

    • Internal

      Parameters

      • kind: string
      • buffer: Nullable<Float32Array<ArrayBufferLike>>
      • staticBuffer: boolean

      Returns Buffer

    • Internal

      Returns void

    • Internal

      Parameters

      • kind: string
      • OptionalstaticBuffer: boolean

      Returns void

    • Internal

      Parameters

      • kind: string
      • OptionalnumInstances: number

      Returns void

    • Internal

      Returns void

    • Internal

      Returns void

    • Internal

      Returns AbstractMesh

    • Internal

      Parameters

      • Optional_ignoreParentClass: boolean

      Returns void

    • Internal

      This method will also draw the instances if fillMode and effect are passed

      Parameters

      • subMesh: SubMesh
      • batch: _InstancesBatch
      • currentInstancesBufferSize: number
      • engine: AbstractEngine
      • OptionalfillMode: number
      • Optionaleffect: Effect

      Returns void

    • Internal

      Parameters

      • value: boolean

      Returns boolean

    • Internal

      Parameters

      • matrix: DeepImmutableObject<Matrix>

      Returns AbstractMesh

    • Attach a behavior to the node

      Parameters

      • behavior: Behavior<Node>

        defines the behavior to attach

      • OptionalattachImmediately: boolean

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

      Returns Node

      the current Node

    • 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

      • OptionalpreserveScalingSign: boolean

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

      Returns this

      the current mesh

    • Internal

      Parameters

      • instance: InstancedMesh

      Returns void

    • Add a mesh as LOD level triggered at the given distance.

      Parameters

      • distanceOrScreenCoverage: number

        Either distance from the center of the object to show this level or the screen coverage if useScreenCoverage is set to true. If screen coverage, value is a fraction of the screen's total surface, between 0 and 1. Example Playground for distance https://playground.babylonjs.com/#QE7KM#197 Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196

      • mesh: Nullable<Mesh>

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

      Returns Mesh

      This mesh (for chaining)

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

    • Align the mesh with a normal

      Parameters

      • normal: Vector3

        defines the normal to use

      • OptionalupDirection: Vector3

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

      Returns AbstractMesh

      the current mesh

    • Apply a physic angular impulse to the mesh

      Parameters

      • angularImpulse: Vector3

        defines the torque to apply

      Returns TransformNode

      the current mesh

    • Modifies the mesh geometry according to a displacement map. A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.

      Parameters

      • url: string

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

      • minHeight: number

        is the lower limit of the displacement.

      • maxHeight: number

        is the upper limit of the displacement.

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

      • OptionalforceUpdate: boolean

        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.

      • OptionalforceUpdate: boolean

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

      Returns Mesh

      the Mesh.

    • Apply a physic impulse to the mesh

      Parameters

      • force: Vector3

        defines the force to apply

      • contactPoint: Vector3

        defines where to apply the force

      Returns AbstractMesh

      the current mesh

    • Updates the vertex buffer by applying transformation from the bones

      Parameters

      • skeleton: Skeleton

        defines the skeleton to apply to current mesh

      Returns Mesh

      the current mesh

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

      Parameters

      • bone: Bone

        Bone affecting the TransformNode

      • affectedTransformNode: TransformNode

        TransformNode associated with the bone

      Returns TransformNode

      this object

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

      Parameters

      • OptionalbakeIndependentlyOfChildren: boolean

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

      • OptionalforceUnique: boolean

        indicates whether to force the mesh geometry to be unique

      Returns Mesh

      the current mesh

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

      Parameters

      • transform: Matrix

        defines the transform matrix to use

      Returns Mesh

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

    • Creates a new bounding info for the mesh

      Parameters

      • minimum: DeepImmutableObject<Vector3>

        min vector of the bounding box/sphere

      • maximum: DeepImmutableObject<Vector3>

        max vector of the bounding box/sphere

      • OptionalworldMatrix: DeepImmutableObject<Matrix>

        defines the new world matrix

      Returns BoundingInfo

      the new bounding info

    • 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

    • Returns a new Mesh object generated from the current mesh properties. This method must not get confused with createInstance()

      Parameters

      • Optionalname: string

        is a string, the name given to the new mesh

      • OptionalnewParent: MeshCloneOptions | Nullable<Node>

        can be any Node object (default null) or an instance of MeshCloneOptions. If the latter, doNotCloneChildren and clonePhysicsImpostor are unused.

      • OptionaldoNotCloneChildren: boolean

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

      • OptionalclonePhysicsImpostor: boolean

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

      Returns Mesh

      a new mesh

    • Computes the world matrix of the node

      Parameters

      • Optionalforce: boolean

        defines if the cache version should be invalidated forcing the world matrix to be created from scratch

      • Optionalcamera: Nullable<Camera>

        defines the camera used if different from the scene active camera (This is used with modes like Billboard or infinite distance)

      Returns Matrix

      the world matrix

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

      Returns Mesh

      current mesh

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

      Returns Mesh

      current mesh

    • 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

    • Creates an animation range for this node

      Parameters

      • name: string

        defines the name of the range

      • from: number

        defines the starting key

      • to: number

        defines the end key

      Returns void

    • Parameters

      • item: Mesh | Cloner
      • useInstances: boolean
      • name: string
      • isPickable: boolean

      Returns void | Mesh | InstancedMesh

    • Creates a new InstancedMesh object from the mesh model.

      Parameters

      • name: string

        defines the name of the new instance

      Returns InstancedMesh

      a new InstancedMesh

    • Creates new normals data for the mesh

      Parameters

      • updatable: boolean

        defines if the normal vertex buffer must be flagged as updatable

      Returns AbstractMesh

      the current mesh

    • This function will create an octree to help to select the right submeshes for rendering, picking and collision computations. Please note that you must have a decent number of submeshes to get performance improvements when using an octree

      Parameters

      • OptionalmaxCapacity: number

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

      • OptionalmaxDepth: number

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

      Returns Octree<SubMesh>

      the new octree

    • Delete a specific animation range

      Parameters

      • name: string

        defines the name of the range to delete

      • OptionaldeleteFrames: boolean

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

      Returns void

    • Detach the transform node if its associated with a bone

      Parameters

      • OptionalresetToPreviousParent: boolean

        Indicates if the parent that was in effect when attachToBone was called should be set back or if we should set parent to null instead (defaults to the latter)

      Returns TransformNode

      this object

    • Render a complete mesh by going through all submeshes

      Returns Mesh

      the current mesh

    • Disables the mesh edge rendering mode

      Returns AbstractMesh

      the currentAbstractMesh

    • Releases resources associated with this mesh.

      Parameters

      • OptionaldoNotRecurse: boolean

        Set to true to not recurse into each children (recurse into each children by default)

      • OptionaldisposeMaterialAndTextures: boolean

        Set to true to also dispose referenced materials and textures (false by default)

      Returns void

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

      Parameters

      • Optionalepsilon: number

        defines the maximal distance between two angles to detect a face

      • OptionalcheckVerticesInsteadOfIndices: boolean

        indicates that we should check vertex list directly instead of faces

      • Optionaloptions: IEdgesRendererOptions

        options to the edge renderer

      Returns AbstractMesh

      the currentAbstractMesh

    • Inverses facet orientations. Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.

      Parameters

      • OptionalflipNormals: boolean

        will also inverts the normals

      Returns Mesh

      current mesh

    • 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

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

      Returns Mesh

      the current mesh

    • Prevents the World matrix to be computed any longer

      Parameters

      • OptionalnewWorldMatrix: Nullable<Matrix>

        defines an optional matrix to use as world matrix

      • Optionaldecompose: boolean

        defines whether to decompose the given newWorldMatrix or directly assign

      Returns TransformNode

      the TransformNode.

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

      Returns Vector3

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

    • Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.

      Parameters

      • result: Vector3

        vector3 to store the result

      Returns TransformNode

      this TransformNode.

    • Returns the mesh absolute position in the World.

      Returns Vector3

      a Vector3.

    • Returns as a new array populated with the mesh material and/or skeleton, if any.

      Returns IAnimatable[]

      an array of IAnimatable

    • Get an animation by name

      Parameters

      • name: string

        defines the name of the animation to look for

      Returns Nullable<Animation>

      null if not found else the requested animation

    • Get an animation range by name

      Parameters

      • name: string

        defines the name of the animation range to look for

      Returns Nullable<AnimationRange>

      null if not found else the requested animation range

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

      Returns Nullable<AnimationRange>[]

      an array

    • Gets an attached behavior by name

      Parameters

      • name: string

        defines the name of the behavior to look for

      Returns Nullable<Behavior<Node>>

      null if behavior was not found else the requested behavior

    • 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

      • T extends AbstractMesh

      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

      • T extends Node

      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

    • Gets the class name

      Returns string

      the string "Mesh".

    • 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

      • OptionalcheckFace: boolean

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

      • Optionalfacing: boolean

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

      Returns Nullable<number>

      the face index if found (or null instead)

    • 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

      • OptionalcheckFace: boolean

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

      • Optionalfacing: boolean

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

      Returns Nullable<number>

      the face index if found (or null instead)

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

      Returns IParticleSystem[]

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

    • Will return all nodes that have this node as ascendant

      Type Parameters

      • T extends 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) => 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

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

      Parameters

      • localAxis: Vector3

        axis to rotate

      Returns Vector3

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

    • Sets the Vector3 "result" as the rotated Vector3 "localAxis" in the same rotation than the mesh. localAxis is expressed in the mesh local space. result is computed in the World space from the mesh World matrix.

      Parameters

      • localAxis: Vector3

        axis to rotate

      • result: Vector3

        the resulting transformnode

      Returns TransformNode

      this TransformNode.

    • Returns the distance from the mesh to the active camera

      Parameters

      • Optionalcamera: Nullable<Camera>

        defines the camera to use

      Returns number

      the distance

    • Returns an array populated with IParticleSystem objects whose the mesh is the emitter

      Returns IParticleSystem[]

      an array of IParticleSystem

    • Gets the engine of the node

      Returns AbstractEngine

      a Engine

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

      Returns any

      the parameters

    • Returns the facetLocalNormals array. The normals are expressed in the mesh local spac

      Returns Vector3[]

      an array of Vector3

    • Returns the facetLocalPositions array. The facet positions are expressed in the mesh local space

      Returns Vector3[]

      an array of Vector3

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

      Parameters

      • i: number

        defines the facet index

      Returns Vector3

      a new Vector3

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

      Parameters

      • i: number

        defines the facet index

      • ref: Vector3

        defines the target vector

      Returns this

      the current mesh

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

      Parameters

      • i: number

        defines the facet index

      Returns Vector3

      a new Vector3

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

      Parameters

      • i: number

        defines the facet index

      • ref: Vector3

        defines the target vector

      Returns AbstractMesh

      the current mesh

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

      Parameters

      • x: number

        defines x coordinate

      • y: number

        defines y coordinate

      • z: number

        defines z coordinate

      Returns Nullable<number[]>

      the array of facet indexes

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

      Parameters

      • OptionalincludeDescendants: boolean

        Include bounding info from descendants as well (true by default)

      • Optionalpredicate: Nullable<(abstractMesh: AbstractMesh) => boolean>

        defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors

      Returns { max: Vector3; min: Vector3 }

      the new bounding vectors

    • Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter

      Returns IParticleSystem[]

      an array of IParticleSystem

    • 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 registered LOD mesh distant from the parameter camera position if any, else returns the current mesh.

      Parameters

      • camera: Camera

        defines the camera to use to compute distance

      • OptionalboundingSphere: BoundingSphere

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

      Returns Nullable<AbstractMesh>

      This mesh (for chaining)

    • Returns the LOD level mesh at the passed distance or null if not found.

      Parameters

      • distance: number

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

      Returns Nullable<Mesh>

      a Mesh or null

    • Gets the list of MeshLODLevel associated with the current mesh

      Returns MeshLODLevel[]

      an array of MeshLODLevel

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

      Parameters

      • renderPassId: number

        render pass id

      Returns undefined | Material

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

    • Gets the mesh uniform buffer.

      Returns UniformBuffer

      the uniform buffer of the mesh.

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

      Parameters

      • OptionalapplySkeleton: boolean

        defines whether to apply the skeleton

      • OptionalapplyMorph: boolean

        defines whether to apply the morph target

      Returns Nullable<FloatArray>

      the normals data

    • Returns Nullable<PhysicsBody>

    • Gets the current physics impostor

      Returns Nullable<PhysicsImpostor>

      a physics impostor or null

    • Returns the mesh pivot matrix. Default : Identity.

      Returns Matrix

      the matrix

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

      Returns Vector3

      the pivot point

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

      Parameters

      • result: Vector3

        the vector3 to store the result

      Returns TransformNode

      this TransformNode.

    • Returns the mesh Pose matrix.

      Returns Matrix

      the pose matrix

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

      Parameters

      • OptionalapplySkeleton: boolean

        defines whether to apply the skeleton

      • OptionalapplyMorph: boolean

        defines whether to apply the morph target

      • Optionaldata: Nullable<FloatArray>

        defines the position data to apply the skeleton and morph to

      Returns Nullable<FloatArray>

      the position data

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

      Returns Vector3

      a new Vector3.

    • Gets the position of the current mesh in camera space

      Parameters

      • Optionalcamera: Nullable<Camera>

        defines the camera to use

      Returns Vector3

      a position

    • Returns the bounding info unnafected by instance data.

      Returns BoundingInfo

      the bounding info of the mesh unaffected by instance data.

    • Gets the scene of the node

      Returns Scene

      a scene

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

      Returns number

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

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

      Returns number

      the total number of vertices

    • 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

    • Gets the current world matrix

      Returns Matrix

      a Matrix

    • 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

      • OptionalnumberPerEdge: number

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

      Returns void

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

      Parameters

      • OptionalnewParent: Nullable<TransformNode>

        defines the new parent to use for the instance (or clone)

      • Optionaloptions: { doNotInstantiate: boolean | ((node: TransformNode) => boolean) }

        defines options to configure how copy is done

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

          defines if the model must be instantiated or just cloned

      • OptionalonNewNodeCreated: (source: TransformNode, clone: TransformNode) => void

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

      Returns Nullable<TransformNode>

      an instance (or a clone) of the current node with its hierarchy

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

      Parameters

      • ray: Ray

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

      • OptionalfastCheck: boolean

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

      • OptionaltrianglePredicate: TrianglePickingPredicate

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

      • OptionalonlyBoundingInfo: boolean

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

      • OptionalworldToUse: Matrix

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

      • OptionalskipBoundingInfo: boolean

        a boolean indicating if we should skip the bounding info check

      Returns PickingInfo

      the picking info

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

      Parameters

      • mesh: AbstractMesh | SolidParticle

        defines a target mesh or SolidParticle to test

      • Optionalprecise: boolean

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

      • 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

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

      Parameters

      • point: Vector3

        defines the point to test

      Returns boolean

      true if there is an intersection

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

      Parameters

      • frustumPlanes: Plane[]

        defines the frustum to test

      Returns boolean

      true if the mesh is completely in the frustum planes

    • 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

    • Gets a boolean indicating if the node has been disposed

      Returns boolean

      true if the node was disposed

    • 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

      • OptionalcheckAncestors: boolean

        indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors

      Returns boolean

      whether this node (and its parent) is enabled

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

      Parameters

      • frustumPlanes: Plane[]

        defines the frustum to test

      Returns boolean

      true if the mesh is in the frustum planes

    • Determine if the current mesh is ready to be rendered

      Parameters

      • OptionalcompleteCheck: boolean

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

      • OptionalforceInstanceSupport: boolean

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

      Returns boolean

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

    • Internal

      Returns boolean

    • Internal

      Returns boolean

    • return true if a pivot has been set

      Returns boolean

      true if a pivot matrix is used

    • Returns boolean

      true if pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect.

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

    • Returns whether the transform node world matrix computation needs the camera information to be computed. This is the case when the node is a billboard or has an infinite distance for instance.

      Returns boolean

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

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

      Parameters

      • vector3: Vector3

        the distance to translate in localspace

      Returns TransformNode

      the TransformNode.

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

      Parameters

      • targetPoint: Vector3

        the position (must be in same space as current mesh) to look at

      • OptionalyawCor: number

        optional yaw (y-axis) correction in radians

      • OptionalpitchCor: number

        optional pitch (x-axis) correction in radians

      • OptionalrollCor: number

        optional roll (z-axis) correction in radians

      • Optionalspace: Space

        the chosen space of the target

      Returns TransformNode

      the TransformNode.

    • Creates a un-shared specific occurence of the geometry for the mesh.

      Returns Mesh

      the current mesh

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

      Parameters

      • Optionalproperty: string

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

      Returns AbstractMesh

      this AbstractMesh

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

        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

    • Move the mesh using collision engine

      Parameters

      • displacement: Vector3

        defines the requested displacement vector

      Returns AbstractMesh

      the current mesh

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

      Parameters

      • OptionalincludeDescendants: boolean

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

      • OptionalignoreRotation: boolean

        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

    • Optimize the indices order so that we keep the faces with similar indices together

      Returns Promise<AbstractMesh>

      the current mesh

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

      Parameters

      • OptionalapplySkeletonOrOptions: boolean | IMeshDataOptions

        defines whether to apply the skeleton before computing the bounding info or a set of options

      • OptionalapplyMorph: boolean

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

      Returns Mesh

      the current mesh

    • Registers for this mesh a javascript function called just after the rendering is complete

      Parameters

      • func: (mesh: AbstractMesh) => void

        defines the function to call after rendering this mesh

      Returns Mesh

      the current mesh

    • If you'd like to be called back after the mesh position, rotation or scaling has been updated.

      Parameters

      • func: (mesh: TransformNode) => void

        callback function to add

      Returns TransformNode

      the TransformNode.

    • Registers for this mesh a javascript function called just before the rendering process

      Parameters

      • func: (mesh: AbstractMesh) => void

        defines the function to call before rendering this mesh

      Returns Mesh

      the current mesh

    • Disposes all the submeshes of the current mesh

      Parameters

      • Optionalimmediate: boolean

        should dispose the effects immediately or not

      Returns AbstractMesh

      the current mesh

    • Remove an attached behavior

      Parameters

      • behavior: Behavior<Node>

        defines the behavior to attach

      Returns Node

      the current Node

    • Removes the passed mesh from the current mesh children list

      Parameters

      • mesh: TransformNode

        defines the child mesh

      • OptionalpreserveScalingSign: boolean

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

      Returns this

      the current mesh

    • Internal

      Parameters

      • instance: InstancedMesh

      Returns void

    • Remove a mesh from the LOD array

      Parameters

      • mesh: Nullable<Mesh>

        defines the mesh to be removed

      Returns Mesh

      This mesh (for chaining)

    • 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. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager

      Parameters

      • subMesh: SubMesh

        defines the subMesh to render

      • enableAlphaMode: boolean

        defines if alpha mode can be changed

      • OptionaleffectiveMeshReplacement: AbstractMesh

        defines an optional mesh used to provide info for the rendering

      Returns Mesh

      the current mesh

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

      • OptionalcheckFrustumCulling: boolean

        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 this

      the current mesh

    • 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

      • Optionalimmediate: boolean

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

      Returns void

    • Resets this nodeTransform's local matrix to Matrix.Identity().

      Parameters

      • OptionalindependentOfChildren: boolean

        indicates if all child nodeTransform's world-space transform should be preserved.

      Returns void

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

      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.

    • Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space. Note that the property rotationQuaternion is then automatically updated and the property rotation is set to (0,0,0) and no longer used. The passed axis is also normalized. . Method is based on http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htm

      Parameters

      • point: Vector3

        the point to rotate around

      • axis: Vector3

        the axis to rotate around

      • amount: number

        the amount to rotate in radians

      Returns TransformNode

      the TransformNode

    • 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

    • Serialize current mesh

      Parameters

      • OptionalserializationObject: any

        defines the object which will receive the serialization data

      Returns any

      the serialized object

    • Serialize animation ranges into a JSON compatible object

      Returns any

      serialization object

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

      Parameters

      • absolutePosition: Vector3

        the absolute position to set

      Returns TransformNode

      the TransformNode.

    • Overwrite the current bounding info

      Parameters

      • boundingInfo: BoundingInfo

        defines the new bounding info

      Returns AbstractMesh

      the current mesh

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

      Parameters

      • localAxis: Vector3

        the axis in local space

      • OptionalyawCor: number

        optional yaw (y-axis) correction in radians

      • OptionalpitchCor: number

        optional pitch (x-axis) correction in radians

      • OptionalrollCor: number

        optional roll (z-axis) correction in radians

      Returns TransformNode

      this TransformNode

    • Set the enabled state of this node

      Parameters

      • value: boolean

        defines the new enabled state

      Returns void

    • 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

      • Optionalis32Bits: Nullable<boolean>

        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

      • OptionaltotalVertices: Nullable<number>

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

      • Optionalupdatable: boolean

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

      • OptionaldontForceSubMeshRecreation: boolean

        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

    • Sets the mesh material by the material or multiMaterial id property

      Parameters

      • id: string

        is a string identifying the material or the multiMaterial

      Returns Mesh

      the current mesh

    • Sets the mesh material by the material or multiMaterial id property

      Parameters

      • id: string

        is a string identifying the material or the multiMaterial

      Returns Mesh

      the current mesh

      Please use MeshBuilder instead Please use setMaterialById instead

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

      Parameters

      • renderPassId: number

        render pass id

      • Optionalmaterial: Material

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

      Returns void

    • Prepare internal normal array for software CPU skinning

      Returns Nullable<Float32Array<ArrayBufferLike>>

      original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same 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

      • OptionalpreserveScalingSign: boolean

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

      • OptionalupdatePivot: boolean

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

      Returns TransformNode

      this TransformNode.

    • Creates a physic joint between two meshes

      Parameters

      • otherMesh: Mesh

        defines the other mesh to use

      • pivot1: Vector3

        defines the pivot to use on this mesh

      • pivot2: Vector3

        defines the pivot to use on the other mesh

      • Optionaloptions: any

        defines additional options (can be plugin dependent)

      Returns AbstractMesh

      the current mesh

    • Sets a new pivot matrix to the current node

      Parameters

      • matrix: DeepImmutableObject<Matrix>

        defines the new pivot matrix to use

      • OptionalpostMultiplyPivotMatrix: boolean

        defines if the pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect

      Returns TransformNode

      the current TransformNode

    • Sets a new pivot point to the current node

      Parameters

      • point: Vector3

        defines the new pivot point to use

      • Optionalspace: Space

        defines if the point is in world or local space (local by default)

      Returns TransformNode

      the current TransformNode

    • Prepare internal position array for software CPU skinning

      Returns Nullable<Float32Array<ArrayBufferLike>>

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

    • Sets the mesh position in its local space.

      Parameters

      • vector3: Vector3

        the position to set in localspace

      Returns TransformNode

      the TransformNode.

    • Sets a new matrix to apply before all other transformation

      Parameters

      • matrix: Matrix

        defines the transform matrix

      Returns TransformNode

      the current TransformNode

    • Sets the mesh global Vertex Buffer

      Parameters

      • buffer: VertexBuffer

        defines the buffer to use

      • OptionaldisposeExistingBuffer: boolean

        disposes the existing buffer, if any (default: true)

      Returns Mesh

      the current mesh

    • 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

      • Optionalupdatable: boolean

        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

    • Simplify the mesh according to the given array of settings. Function will return immediately and will simplify async

      Parameters

      • settings: ISimplificationSettings[]

        a collection of simplification settings

      • OptionalparallelProcessing: boolean

        should all levels calculate parallel or one after the other

      • OptionalsimplificationType: SimplificationType

        the type of simplification to run

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

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

      Returns Mesh

      the current mesh

    • This function will subdivide the mesh into multiple submeshes

      Parameters

      • count: number

        defines the expected number of submeshes

      Returns void

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

      Returns Mesh

      the current mesh

    • Creates a new thin instance

      Parameters

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

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

      • 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. If you pass an array of matrices, other instance indexes are index+1, index+2, etc

    • 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

    • Synchronize the gpu buffers with a thin instance buffer. Call this method if you update later on the buffers passed to thinInstanceSetBuffer

      Parameters

      • kind: string

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

      Returns void

    • Gets the list of world matrices

      Returns Matrix[]

      an array containing all the world matrices from the thin instances

    • Applies a partial update to a buffer directly on the GPU Note that the buffer located on the CPU is NOT updated! It's up to you to update it (or not) with the same data you pass to this method

      Parameters

      • kind: string

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

      • data: Float32Array

        the data to set in the GPU buffer

      • offset: number

        the offset in the GPU buffer where to update the data

      Returns void

    • 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

      Returns void

    • Registers a custom attribute to be used with thin instances

      Parameters

      • kind: string

        name of the attribute

      • stride: number

        size in floats of the attribute

      Returns void

    • 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

    • Sets the matrix of a thin instance

      Parameters

      • index: number

        index of the thin instance

      • matrix: DeepImmutableObject<Matrix>

        matrix 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

    • Invert the geometry to move from a right handed system to a left handed one.

      Returns Mesh

      the current mesh

    • Returns a description of this mesh

      Parameters

      • OptionalfullDetails: boolean

        define if full details about this mesh must be used

      Returns string

      a descriptive string representing this mesh

    • Transfer the mesh values to its UBO.

      Parameters

      • world: Matrix

        The world matrix associated with the mesh

      Returns void

    • Translates the mesh along the axis vector for the passed distance in the given space. space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.

      Parameters

      • axis: Vector3

        the axis to translate in

      • distance: number

        the distance to translate

      • Optionalspace: Space

        Space to rotate in (Default: local)

      Returns TransformNode

      the TransformNode.

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

      Returns Mesh

      the current mesh

    • Allows back the World matrix computation.

      Returns this

      the TransformNode.

    • Disposes a previously registered javascript function called after the rendering.

      Parameters

      • func: (mesh: AbstractMesh) => void

        defines the function to remove

      Returns Mesh

      the current mesh

    • Removes a registered callback function.

      Parameters

      • func: (mesh: TransformNode) => void

        callback function to remove

      Returns TransformNode

      the TransformNode.

    • Disposes a previously registered javascript function called before the rendering

      Parameters

      • func: (mesh: AbstractMesh) => void

        defines the function to remove

      Returns Mesh

      the current mesh

    • Internal

      Parameters

      • Optionalforce: boolean

      Returns void

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

      Returns AbstractMesh

      the current mesh

    • Update the current index buffer

      Parameters

      • indices: IndicesArray

        defines the source data

      • Optionaloffset: number

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

      • OptionalgpuMemoryOnly: boolean

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

      Returns AbstractMesh

      the current mesh

    • This method updates the vertex positions of an updatable mesh according to the positionFunction returned values.

      Parameters

      • positionFunction: (data: FloatArray) => void

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

      • OptionalcomputeNormals: boolean

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

      Returns Mesh

      the current mesh

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

      Parameters

      • matrix: Matrix

        the matrix to copy the pose from

      Returns TransformNode

      this TransformNode.

    • 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

    • Internal

      Gets the default side orientation.

      Parameters

      • Optionalorientation: number

        the orientation to value to attempt to get

      Returns number

      the default orientation

    • Internal

      Parameters

      • name: string
      • mesh: Mesh

      Returns InstancedMesh

    • Internal

      Parameters

      • scene: Scene
      • physicObject: IPhysicsEnabledObject
      • jsonObject: any

      Returns PhysicsImpostor

    • Add a new node constructor

      Parameters

      • type: string

        defines the type name of the node to construct

      • constructorFunc: NodeConstructor

        defines the constructor function

      Returns void

    • Returns the center of the {min: Vector3, max: Vector3} or the center of MinMax vector3 computed from a mesh array

      Parameters

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

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

      Returns Vector3

      a vector3

    • 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

    • Creates a box mesh.

      Parameters

      Returns Mesh

      a new Mesh

      Please use MeshBuilder instead

    • Creates a Capsule Mesh

      Parameters

      • name: string

        defines the name of the mesh.

      • options: ICreateCapsuleOptions

        the constructors options used to shape the mesh.

      • scene: Scene

        defines the scene the mesh is scoped to.

      Returns Mesh

      the capsule mesh

      Please use MeshBuilder instead

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

      • Optionalscene: Scene

        defines the hosting scene

      • Optionalupdatable: any

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number

      Returns Mesh

      a new Mesh

      Please use MeshBuilder instead

    • Creates a dashed line mesh.

      Parameters

      • name: string

        defines the name of the mesh to create

      • points: Vector3[]

        is an array successive Vector3

      • dashSize: number

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

      • gapSize: number

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

      • dashNb: number

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

      • scene: Nullable<Scene>

        defines the hosting scene

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • Optionalinstance: LinesMesh

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

      Returns LinesMesh

      a new Mesh

      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

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

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

      • Optionalscene: Scene

        defines the hosting scene

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

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalonReady: (mesh: GroundMesh) => void

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

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

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

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number

      Returns Mesh

      a new Mesh

      Please use MeshBuilder instead

    • Creates a line mesh..

      Parameters

      • name: string

        defines the name of the mesh to create

      • points: Vector3[]

        is an array successive Vector3

      • scene: Nullable<Scene>

        defines the hosting scene

      • updatable: boolean

        defines if the mesh must be flagged as updatable

      • Optionalinstance: Nullable<LinesMesh>

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

      Returns LinesMesh

      a new Mesh

      Please use MeshBuilder instead

    • Creates a plane mesh.

      Parameters

      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

      • Optionalholes: Vector3[][]

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

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number
      • OptionalearcutInjection: 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 ribbon mesh.

      Parameters

      • name: string

        defines the name of the mesh to create

      • pathArray: Vector3[][]

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

      • closeArray: boolean

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

      • closePath: boolean

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

      • offset: number

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

      • Optionalscene: Scene

        defines the hosting scene

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number
      • Optionalinstance: Mesh

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

      Returns Mesh

      a new Mesh

    • Creates a sphere 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)

      • Optionalscene: Scene

        defines the hosting scene

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number

      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

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

      • Optionalscene: Scene

        defines the hosting scene

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

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

      • Optionalscene: Scene

        defines the hosting scene

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

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

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number
      • Optionalinstance: 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

    • Extends a mesh to a Goldberg mesh Warning the mesh to convert MUST be an import of a perviously exported Goldberg mesh

      Parameters

      • mesh: Mesh

        the mesh to convert

      Returns Mesh

      the extended mesh

      Please use ExtendMeshToGoldberg instead

    • Creates an extruded polygon mesh, with depth in the Y direction..

      Parameters

      • name: string

        defines the name of the mesh to create

      • shape: Vector3[]

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

      • depth: number

        defines the height of extrusion

      • scene: Scene

        defines the hosting scene

      • Optionalholes: Vector3[][]

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

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number
      • OptionalearcutInjection: any

        can be used to inject your own earcut reference

      Returns Mesh

      a new Mesh

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

      Parameters

      • name: string

        defines the name of the mesh to create

      • shape: Vector3[]

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

      • path: Vector3[]

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

      • scale: number

        is the value to scale the shape

      • rotation: number

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

      • cap: number

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

      • scene: Nullable<Scene>

        defines the hosting scene

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number
      • Optionalinstance: Mesh

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

      Returns Mesh

      a new Mesh

    • 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

      • Optionalupdatable: boolean

        defines if the mesh must be flagged as updatable

      • OptionalsideOrientation: number
      • Optionalinstance: 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.

      • OptionaldisposeSource: boolean

        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.

      • OptionaldisposeSource: boolean

        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

    • Returns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates

      Parameters

      • meshes: AbstractMesh[]

        defines the list of meshes to scan

      Returns { max: Vector3; min: Vector3 }

      an object {min: Vector3, max: Vector3}

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

      Parameters

      • parsedMesh: any

        is the source

      • scene: Scene

        defines the hosting scene

      • rootUrl: string

        is the root URL to prefix the delayLoadingFile property with

      Returns Mesh

      a new Mesh

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

      Parameters

      • node: Node

        defines where to store the animation ranges

      • parsedNode: any

        defines the serialization object to read data from

      • _scene: Scene

        defines the hosting scene

      Returns void