GroundMesh

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

absolutePosition

absolutePosition: Vector3

Returns the current mesh absolute position. Returns a Vector3.

actionManager

actionManager: Nullable<ActionManager>

Gets or sets the current action manager

see

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

alphaIndex

alphaIndex: number

Gets or sets the alpha index used to sort transparent meshes

see

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

alwaysSelectAsActiveMesh

alwaysSelectAsActiveMesh: boolean

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

animationPropertiesOverride

animationPropertiesOverride: Nullable<AnimationPropertiesOverride>

Gets or sets the animation properties override

animations

animations: Animation[]

Gets a list of Animations associated with the node

applyFog

applyFog: boolean

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

areNormalsFrozen

areNormalsFrozen: boolean

Boolean : true if the normals aren't to be recomputed on next mesh positions array update. This property is pertinent only for updatable parametric shapes.

behaviors

behaviors: Behavior<Node>[]

Gets the list of attached behaviors

see

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

billboardMode

billboardMode: number

Set the billboard mode. Default is 0.

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

checkCollisions

checkCollisions: boolean

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

see

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

collider

collider: Collider

Gets Collider object used to compute collisions (not physics)

see

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

collisionGroup

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

collisionMask

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

computeBonesUsingShaders

computeBonesUsingShaders: boolean

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

definedFacingForward

definedFacingForward: boolean

Gets or sets the orientation for POV movement & rotation

delayLoadState

delayLoadState: number

delayLoadingFile

delayLoadingFile: string

doNotSerialize

doNotSerialize: boolean

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

edgesColor

edgesColor: Color4

Defines edge color used when edgesRenderer is enabled

see

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

edgesRenderer

edgesRenderer: Nullable<EdgesRenderer>

Gets the edgesRenderer associated with the mesh

edgesWidth

edgesWidth: number

Defines edge width used when edgesRenderer is enabled

see

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

ellipsoid

ellipsoid: Vector3

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

see

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

ellipsoidOffset

ellipsoidOffset: Vector3

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

see

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

enablePointerMoveEvents

enablePointerMoveEvents: boolean

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

facetDepthSortFrom

facetDepthSortFrom: Vector3

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

see

http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort

facetNb

facetNb: number

forward

forward: Vector3

The forward direction of that transform in world space.

generateOctree

generateOctree: boolean

geometry

geometry: Nullable<Geometry>

Returns the mesh internal Geometry object.

hasLODLevels

hasLODLevels: boolean

True if the mesh has some Levels Of Details (LOD). Returns a boolean.

hasVertexAlpha

hasVertexAlpha: boolean

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

id

id: string

Gets or sets the id of the node

ignoreNonUniformScaling

ignoreNonUniformScaling: boolean

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

infiniteDistance

infiniteDistance: boolean

instances

instances: InstancedMesh[]

isBlocked

isBlocked: boolean

isBlocker

isBlocker: boolean

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

see

http://doc.babylonjs.com/how_to/how_to_use_lens_flares

isFacetDataEnabled

isFacetDataEnabled: boolean

gets a boolean indicating if facetData is enabled

see

http://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet

isOccluded

isOccluded: boolean

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

see

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

isOcclusionQueryInProgress

isOcclusionQueryInProgress: boolean

Flag to check the progress status of the query

see

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

isPickable

isPickable: boolean

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

isUnIndexed

isUnIndexed: boolean

isVisible

isVisible: boolean

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

isWorldMatrixFrozen

isWorldMatrixFrozen: boolean

True if the World matrix has been frozen. Returns a boolean.

layerMask

layerMask: number

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

see

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

material

material: Nullable<Material>

Gets or sets current material

metadata

metadata: any

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

morphTargetManager

morphTargetManager: Nullable<MorphTargetManager>

mustDepthSortFacets

mustDepthSortFacets: boolean

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

see

http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort

name

name: string

Gets or sets the name of the node

nonUniformScaling

nonUniformScaling: boolean

numBoneInfluencers

numBoneInfluencers: number

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

occlusionQueryAlgorithmType

occlusionQueryAlgorithmType: number

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

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

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

occlusionRetryCount

occlusionRetryCount: number

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

see

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

occlusionType

occlusionType: number

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

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

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

onAfterRenderObservable

onAfterRenderObservable: Observable<Mesh>

An event triggered after rendering the mesh

onAfterWorldMatrixUpdateObservable

onAfterWorldMatrixUpdateObservable: Observable<TransformNode>

An event triggered after the world matrix is updated

onBeforeDraw

onBeforeDraw: function

Type declaration

    • (): void
    • Returns void

onBeforeDrawObservable

onBeforeDrawObservable: Observable<Mesh>

An event triggered before drawing the mesh

onBeforeRenderObservable

onBeforeRenderObservable: Observable<Mesh>

An event triggered before rendering the mesh

onCollide

onCollide: function

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

Type declaration

    • (): void
    • Returns void

onCollideObservable

onCollideObservable: Observable<AbstractMesh>

An event triggered when this mesh collides with another one

onCollisionPositionChange

onCollisionPositionChange: function

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

Type declaration

    • (): void
    • Returns void

onCollisionPositionChangeObservable

onCollisionPositionChangeObservable: Observable<Vector3>

An event triggered when the collision's position changes

onDispose

onDispose: function

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

Type declaration

    • (): void
    • Returns void

onDisposeObservable

onDisposeObservable: Observable<Node>

An event triggered when the mesh is disposed

onLODLevelSelection

onLODLevelSelection: function

Type declaration

onMaterialChangedObservable

onMaterialChangedObservable: Observable<AbstractMesh>

An event triggered when material is changed

onReady

onReady: function

Callback raised when the node is ready to be used

Type declaration

    • (node: Node): void
    • Parameters

      Returns void

outlineColor

outlineColor: Color3

Defines color to use when rendering outline

outlineWidth

outlineWidth: number

Define width to use when rendering outline

overlayAlpha

overlayAlpha: number

Defines alpha to use when rendering overlay

overlayColor

overlayColor: Color3

Defines color to use when rendering overlay

overrideMaterialSideOrientation

overrideMaterialSideOrientation: Nullable<number>

overridenInstanceCount

overridenInstanceCount: number

Overrides instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs

parent

parent: Nullable<Node>

Gets or sets the parent of the node

partitioningBBoxRatio

partitioningBBoxRatio: number

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

see

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

partitioningSubdivisions

partitioningSubdivisions: number

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

see

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

physicsImpostor

physicsImpostor: Nullable<PhysicsImpostor>

Gets or sets impostor used for physic simulation

see

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

position

position: Vector3

receiveShadows

receiveShadows: boolean

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

see

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

renderOutline

renderOutline: boolean

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

see

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

renderOverlay

renderOverlay: boolean

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

see

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

renderingGroupId

renderingGroupId: number

Specifies the rendering group id for this mesh (0 by default)

see

http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups

right

right: Vector3

The right direction of that transform in world space.

rotation

rotation: Vector3

Rotation property : a Vector3 depicting the rotation value in radians around each local axis X, Y, Z. If rotation quaternion is set, this Vector3 will (almost always) be the Zero vector! Default : (0.0, 0.0, 0.0)

rotationQuaternion

rotationQuaternion: Nullable<Quaternion>

Rotation Quaternion property : this a Quaternion object depicting the mesh rotation by using a unit quaternion. It's null by default. If set, only the rotationQuaternion is then used to compute the mesh rotation and its property `.rotation\ is then ignored and set to (0.0, 0.0, 0.0)

scaling

scaling: Vector3

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

scalingDeterminant

scalingDeterminant: number

showSubMeshesBoundingBox

showSubMeshesBoundingBox: boolean

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

skeleton

skeleton: Nullable<Skeleton>

Gets or sets a skeleton to apply skining transformations

see

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

source

source: Nullable<Mesh>

state

state: string

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

subMeshes

subMeshes: SubMesh[]

Gets or sets the list of subMeshes

see

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

subdivisions

subdivisions: number

subdivisionsX

subdivisionsX: number

subdivisionsY

subdivisionsY: number

uniqueId

uniqueId: number

Gets or sets the unique id of the node

up

The up direction of that transform in world space.

useBones

useBones: boolean

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

useOctreeForCollisions

useOctreeForCollisions: boolean

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

useOctreeForPicking

useOctreeForPicking: boolean

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

useOctreeForRenderingSelection

useOctreeForRenderingSelection: boolean

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

useVertexColors

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)

visibility

visibility: number

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

worldMatrixFromCache

worldMatrixFromCache: Matrix

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

Static BACKSIDE

BACKSIDE: number

Mesh side orientation : usually the internal or back surface

Static BILLBOARDMODE_ALL

BILLBOARDMODE_ALL: number

Billboard on all axes

Static BILLBOARDMODE_NONE

BILLBOARDMODE_NONE: number

No billboard

Static BILLBOARDMODE_X

BILLBOARDMODE_X: number

Billboard on X axis

Static BILLBOARDMODE_Y

BILLBOARDMODE_Y: number

Billboard on Y axis

Static BILLBOARDMODE_Z

BILLBOARDMODE_Z: number

Billboard on Z axis

Static CAP_ALL

CAP_ALL: number

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

Static CAP_END

CAP_END: number

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

Static CAP_START

CAP_START: number

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

Static DEFAULTSIDE

DEFAULTSIDE: number

Mesh side orientation : by default, FRONTSIDE

Static DOUBLESIDE

DOUBLESIDE: number

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

Static FRONTSIDE

FRONTSIDE: number

Mesh side orientation : usually the external or front surface

Static NO_CAP

NO_CAP: number

Mesh cap setting : no cap

Static OCCLUSION_ALGORITHM_TYPE_ACCURATE

OCCLUSION_ALGORITHM_TYPE_ACCURATE: number

Use an accurante occlusion algorithm

Static OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE

OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE: number

Use a conservative occlusion algorithm

Static OCCLUSION_TYPE_NONE

OCCLUSION_TYPE_NONE: number

No occlusion

Static OCCLUSION_TYPE_OPTIMISTIC

OCCLUSION_TYPE_OPTIMISTIC: number

Occlusion set to optimisitic

Static OCCLUSION_TYPE_STRICT

OCCLUSION_TYPE_STRICT: number

Occlusion set to strict

Methods

addBehavior

addChild

addLODLevel

addRotation

  • Adds a rotation step to the mesh current rotation. x, y, z are Euler angles expressed in radians. This methods updates the current mesh rotation, either mesh.rotation, either mesh.rotationQuaternion if it's set. This means this rotation is made in the mesh local space only. It's useful to set a custom rotation order different from the BJS standard one YXZ. Example : this rotates the mesh first around its local X axis, then around its local Z axis, finally around its local Y axis.

    mesh.addRotation(x1, 0, 0).addRotation(0, 0, z2).addRotation(0, 0, y3);
    

    Note that addRotation() accumulates the passed rotation values to the current ones and computes the .rotation or .rotationQuaternion updated values. Under the hood, only quaternions are used. So it's a little faster is you use .rotationQuaternion because it doesn't need to translate them back to Euler angles. Returns the TransformNode.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns TransformNode

alignWithNormal

  • Align the mesh with a normal

    Parameters

    • normal: Vector3

      defines the normal to use

    • Optional upDirection: Vector3

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

    Returns AbstractMesh

    the current mesh

applyDisplacementMap

  • applyDisplacementMap(url: string, minHeight: number, maxHeight: number, onSuccess?: function, uvOffset?: Vector2, uvScale?: Vector2): 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. This method returns nothing. The parameter url is a string, the URL from the image file is to be downloaded. The parameters minHeight and maxHeight are the lower and upper limits of the displacement. The parameter onSuccess is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing. The parameter uvOffset is an optional vector2 used to offset UV. The parameter uvScale is an optional vector2 used to scale UV.

    Returns the Mesh.

    Parameters

    • url: string
    • minHeight: number
    • maxHeight: number
    • Optional onSuccess: function
        • (mesh: Mesh): void
        • Parameters

          Returns void

    • Optional uvOffset: Vector2
    • Optional uvScale: Vector2

    Returns Mesh

applyDisplacementMapFromBuffer

  • applyDisplacementMapFromBuffer(buffer: Uint8Array, heightMapWidth: number, heightMapHeight: number, minHeight: number, maxHeight: number, uvOffset?: Vector2, uvScale?: Vector2): 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. This method returns nothing. The parameter buffer is a Uint8Array buffer containing series of Uint8 lower than 255, the red, green, blue and alpha values of each successive pixel. The parameters heightMapWidth and heightMapHeight are positive integers to set the width and height of the buffer image. The parameters minHeight and maxHeight are the lower and upper limits of the displacement. The parameter uvOffset is an optional vector2 used to offset UV. The parameter uvScale is an optional vector2 used to scale UV.

    Returns the Mesh.

    Parameters

    • buffer: Uint8Array
    • heightMapWidth: number
    • heightMapHeight: number
    • minHeight: number
    • maxHeight: number
    • Optional uvOffset: Vector2
    • Optional uvScale: Vector2

    Returns Mesh

applyImpulse

applySkeleton

  • Updates the vertex buffer by applying transformation from the bones. Returns the Mesh.

    Parameters

    Returns Mesh

attachToBone

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

    Parameters

    • bone: Bone

      Bone affecting the TransformNode

    • affectedTransformNode: TransformNode

      TransformNode associated with the bone

    Returns TransformNode

bakeCurrentTransformIntoVertices

  • bakeCurrentTransformIntoVertices(): Mesh

bakeTransformIntoVertices

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

    Parameters

    Returns Mesh

beginAnimation

  • beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: function): Nullable<Animatable>
  • Will start the animation sequence

    Parameters

    • name: string

      defines the range frames for animation sequence

    • Optional loop: boolean

      defines if the animation should loop (false by default)

    • Optional speedRatio: number

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

    • Optional onAnimationEnd: function

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

        • (): void
        • Returns void

    Returns Nullable<Animatable>

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

calcMovePOV

  • calcMovePOV(amountRight: number, amountUp: number, amountForward: number): Vector3
  • Calculate relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward

    Parameters

    • amountRight: number

      defines the distance on the right axis

    • amountUp: number

      defines the distance on the up axis

    • amountForward: number

      defines the distance on the forward axis

    Returns Vector3

    the new displacement vector

calcRotatePOV

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

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns Vector3

    the new rotation vector

cleanMatrixWeights

  • cleanMatrixWeights(): void
  • Normalize matrix weights so that all vertices have a total weight set to 1

    Returns void

clone

  • clone(name: string, newParent?: Node, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean): Mesh
  • Returns a new Mesh object generated from the current mesh properties. This method must not get confused with createInstance(). The parameter name is a string, the name given to the new mesh. The optional parameter newParent can be any Node object (default null). The optional parameter doNotCloneChildren (default false) allows/denies the recursive cloning of the original mesh children if any. The parameter clonePhysicsImpostor (default true) allows/denies the cloning in the same time of the original mesh body used by the physics engine, if any.

    Parameters

    • name: string
    • Optional newParent: Node
    • Optional doNotCloneChildren: boolean
    • Optional clonePhysicsImpostor: boolean

    Returns Mesh

computeWorldMatrix

  • computeWorldMatrix(force?: boolean): Matrix
  • Computes the mesh World matrix and returns it. If the mesh world matrix is frozen, this computation does nothing more than returning the last frozen values. If the parameter force is let to false (default), the current cached World matrix is returned. If the parameter forceis set to true, the actual computation is done. Returns the mesh World Matrix.

    Parameters

    • Optional force: boolean

    Returns Matrix

convertToFlatShadedMesh

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

    Returns Mesh

convertToUnIndexedMesh

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

    Returns Mesh

createAnimationRange

  • createAnimationRange(name: string, from: number, to: number): void
  • Creates an animation range for this node

    Parameters

    • name: string

      defines the name of the range

    • from: number

      defines the starting key

    • to: number

      defines the end key

    Returns void

createInstance

  • Creates a new InstancedMesh object from the mesh model. An instance shares the same properties and the same material than its model. Only these properties of each instance can then be set individually :

    Parameters

    • name: string

    Returns InstancedMesh

createNormals

  • Creates new normals data for the mesh

    Parameters

    • updatable: boolean

      defines if the normal vertex buffer must be flagged as updatable

    Returns AbstractMesh

    the current mesh

createOrUpdateSubmeshesOctree

  • createOrUpdateSubmeshesOctree(maxCapacity?: number, maxDepth?: number): Octree<SubMesh>

deleteAnimationRange

  • deleteAnimationRange(name: string, deleteFrames?: boolean): void
  • Delete a specific animation range

    Parameters

    • name: string

      defines the name of the range to delete

    • Optional deleteFrames: boolean

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

    Returns void

detachFromBone

disableEdgesRendering

disableFacetData

dispose

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

    Parameters

    • Optional doNotRecurse: boolean

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

    • Optional disposeMaterialAndTextures: boolean

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

    Returns void

enableEdgesRendering

  • enableEdgesRendering(epsilon?: number, checkVerticesInsteadOfIndices?: boolean): AbstractMesh

flipFaces

  • flipFaces(flipNormals?: boolean): Mesh
  • Inverses facet orientations and inverts also the normals with flipNormals (default false) if true. This method returns the Mesh. Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.

    Parameters

    • Optional flipNormals: boolean

    Returns Mesh

freezeNormals

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

    Returns Mesh

freezeWorldMatrix

getAbsolutePivotPoint

getAbsolutePivotPointToRef

getAbsolutePosition

getAnimatables

getAnimationByName

  • Get an animation by name

    Parameters

    • name: string

      defines the name of the animation to look for

    Returns Nullable<Animation>

    null if not found else the requested animation

getAnimationRange

  • 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

getBehaviorByName

getBoundingInfo

getChildMeshes

  • getChildMeshes(directDescendantsOnly?: boolean, predicate?: function): AbstractMesh[]
  • Get all child-meshes of this node

    Parameters

    • Optional directDescendantsOnly: boolean

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

    • Optional predicate: function

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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns AbstractMesh[]

    an array of {BABYLON.AbstractMesh}

getChildTransformNodes

  • getChildTransformNodes(directDescendantsOnly?: boolean, predicate?: function): TransformNode[]
  • Get all child-transformNodes of this node

    Parameters

    • Optional directDescendantsOnly: boolean

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

    • Optional predicate: function

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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns TransformNode[]

    an array of {BABYLON.TransformNode}

getChildren

  • getChildren(predicate?: function): Node[]
  • Get all direct children of this node

    Parameters

    • Optional predicate: function

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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns Node[]

    an array of {BABYLON.Node}

getClassName

  • getClassName(): string

getClosestFacetAtCoordinates

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

    see

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

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    • Optional projected: Vector3

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

    • Optional checkFace: boolean

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

    • Optional facing: boolean

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

    Returns Nullable<number>

    the face index if found (or null instead)

getClosestFacetAtLocalCoordinates

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

    see

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

    Parameters

    • x: number

      defines x coordinate

    • y: number

      defines y coordinate

    • z: number

      defines z coordinate

    • Optional projected: Vector3

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

    • Optional checkFace: boolean

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

    • Optional facing: boolean

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

    Returns Nullable<number>

    the face index if found (or null instead)

getDescendants

  • getDescendants(directDescendantsOnly?: boolean, predicate?: function): Node[]
  • Will return all nodes that have this node as ascendant

    Parameters

    • Optional directDescendantsOnly: boolean

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

    • Optional predicate: function

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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns Node[]

    all children nodes of all types

getDirection

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

    Parameters

    Returns Vector3

getDirectionToRef

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

    Parameters

    Returns TransformNode

getDistanceToCamera

getEmittedParticleSystems

getEngine

getFacetDataParameters

  • getFacetDataParameters(): any

getFacetLocalNormals

  • getFacetLocalNormals(): Vector3[]

getFacetLocalPartitioning

  • getFacetLocalPartitioning(): number[][]

getFacetLocalPositions

  • getFacetLocalPositions(): Vector3[]

getFacetNormal

  • getFacetNormal(i: number): Vector3

getFacetNormalToRef

  • getFacetNormalToRef(i: number, ref: Vector3): this

getFacetPosition

  • getFacetPosition(i: number): Vector3

getFacetPositionToRef

getFacetsAtLocalCoordinates

  • getFacetsAtLocalCoordinates(x: number, y: number, z: number): Nullable<number[]>

getHeightAtCoordinates

  • getHeightAtCoordinates(x: number, z: number): number
  • Returns a height (y) value in the Worl system : the ground altitude at the coordinates (x, z) expressed in the World system. Returns the ground y position if (x, z) are outside the ground surface.

    Parameters

    • x: number
    • z: number

    Returns number

getHierarchyBoundingVectors

  • getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<function>): object
  • Return the minimum and maximum world vectors of the entire hierarchy under current mesh

    Parameters

    • Optional includeDescendants: boolean

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

    • Optional predicate: Nullable<function>

      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 object

    the new bounding vectors

getHierarchyEmittedParticleSystems

getIndices

  • Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices. If the parameter copyWhenShared is 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. Returns an empty array if the mesh has no geometry.

    Parameters

    • Optional copyWhenShared: boolean

    Returns Nullable<IndicesArray>

getLOD

getLODLevelAtDistance

getLODLevels

  • Gets the list of {BABYLON.MeshLODLevel} associated with the current mesh

    Returns MeshLODLevel[]

    an array of {BABYLON.MeshLODLevel}

getNormalAtCoordinates

  • getNormalAtCoordinates(x: number, z: number): Vector3
  • Returns a normalized vector (Vector3) orthogonal to the ground at the ground coordinates (x, z) expressed in the World system. Returns Vector3(0.0, 1.0, 0.0) if (x, z) are outside the ground surface.

    Parameters

    • x: number
    • z: number

    Returns Vector3

getNormalAtCoordinatesToRef

  • Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground at the ground coordinates (x, z) expressed in the World system. Doesn't uptade the reference Vector3 if (x, z) are outside the ground surface. Returns the GroundMesh.

    Parameters

    Returns GroundMesh

getPhysicsImpostor

getPivotMatrix

getPivotPoint

getPivotPointToRef

getPoseMatrix

getPositionExpressedInLocalSpace

  • getPositionExpressedInLocalSpace(): Vector3

getPositionInCameraSpace

getScene

  • Gets the scene of the node

    Returns Scene

    a {BABYLON.Scene}

getTotalIndices

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

    Returns number

getTotalVertices

  • getTotalVertices(): number

getVertexBuffer

  • Returns the mesh VertexBuffer object from the requested kind : positions, indices, normals, etc. Returns null if the mesh has no geometry. Possible kind values :

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

    Parameters

    • kind: string

    Returns Nullable<VertexBuffer>

getVerticesData

  • getVerticesData(kind: string, copyWhenShared?: boolean, forceCopy?: boolean): Nullable<FloatArray>
  • Returns an array of integers or floats, or a Float32Array, depending on the requested kind (positions, indices, normals, etc). If copywhenShared is true (default false) and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one. You can force the copy with forceCopy === true Returns null if the mesh has no geometry or no vertex buffer. Possible kind values :

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

    Parameters

    • kind: string
    • Optional copyWhenShared: boolean
    • Optional forceCopy: boolean

    Returns Nullable<FloatArray>

getVerticesDataKinds

  • getVerticesDataKinds(): string[]
  • Returns a string : the list of existing kinds of Vertex Data for this mesh. Possible kind values :

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

    Returns string[]

getWorldMatrix

intersects

intersectsMesh

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

    Parameters

    • mesh: AbstractMesh | SolidParticle

      defines a target mesh or SolidParticle to test

    • Optional precise: boolean

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

    • Optional includeDescendants: boolean

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

    Returns boolean

    true if there is an intersection

intersectsPoint

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

    Parameters

    • point: Vector3

      defines the point to test

    Returns boolean

    true if there is an intersection

isCompletelyInFrustum

  • isCompletelyInFrustum(frustumPlanes: Plane[]): boolean
  • Returns true if the mesh is completely in the frustum defined be the passed array of planes. A mesh is completely in the frustum if its bounding box it completely inside the frustum.

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum to test

    Returns boolean

    true if the mesh is completely in the frustum planes

isDescendantOf

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

    Parameters

    • ancestor: Node

      defines the parent node to inspect

    Returns boolean

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

isDisposed

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

    Returns boolean

    true if the node was disposed

isEnabled

  • isEnabled(checkAncestors?: boolean): boolean
  • Is this node enabled? If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true

    Parameters

    • Optional checkAncestors: boolean

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

    Returns boolean

    whether this node (and its parent) is enabled

isInFrustum

  • isInFrustum(frustumPlanes: Plane[]): boolean

isReady

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

    Parameters

    • Optional completeCheck: boolean

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

    • Optional forceInstanceSupport: boolean

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

    Returns boolean

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

isVertexBufferUpdatable

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

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

    Parameters

    • kind: string

    Returns boolean

isVerticesDataPresent

  • isVerticesDataPresent(kind: string): boolean

locallyTranslate

lookAt

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

    Parameters

    • targetPoint: Vector3

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

    • Optional yawCor: number

      optional yaw (y-axis) correction in radians

    • Optional pitchCor: number

      optional pitch (x-axis) correction in radians

    • Optional rollCor: number

      optional roll (z-axis) correction in radians

    • Optional space: Space

      the choosen space of the target

    Returns TransformNode

    the TransformNode.

makeGeometryUnique

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

    Returns Mesh

markAsDirty

markVerticesDataAsUpdatable

  • markVerticesDataAsUpdatable(kind: string, updatable?: boolean): void

movePOV

  • movePOV(amountRight: number, amountUp: number, amountForward: number): AbstractMesh
  • Perform relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward

    Parameters

    • amountRight: number

      defines the distance on the right axis

    • amountUp: number

      defines the distance on the up axis

    • amountForward: number

      defines the distance on the forward axis

    Returns AbstractMesh

    the current mesh

moveWithCollisions

normalizeToUnitCube

  • normalizeToUnitCube(includeDescendants?: boolean): AbstractMesh
  • Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)

    Parameters

    • Optional includeDescendants: boolean

      Use the hierarchy's bounding box instead of the mesh's bounding box

    Returns AbstractMesh

    the current mesh

optimize

  • optimize(chunksCount: number, octreeBlocksSize?: number): void
  • Parameters

    • chunksCount: number
    • Optional octreeBlocksSize: number

    Returns void

optimizeIndices

  • optimizeIndices(successCallback?: function): 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. Returns the Mesh.

    Parameters

    • Optional successCallback: function

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

        • (mesh?: Mesh): void
        • Parameters

          • Optional mesh: Mesh

          Returns void

    Returns Mesh

refreshBoundingInfo

  • refreshBoundingInfo(): 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. Returns the Mesh.

    Returns Mesh

registerAfterRender

  • registerAfterRender(func: function): Mesh
  • Registers for this mesh a javascript function called just after the rendering is complete. This function is passed the current mesh. Returns the Mesh.

    Parameters

    Returns Mesh

registerAfterWorldMatrixUpdate

registerBeforeRender

  • registerBeforeRender(func: function): Mesh
  • Registers for this mesh a javascript function called just before the rendering process. This function is passed the current mesh. Return the Mesh.

    Parameters

    Returns Mesh

releaseSubMeshes

removeBehavior

removeChild

removeLODLevel

render

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

    Parameters

    • subMesh: SubMesh

      defines the subMesh to render

    • enableAlphaMode: boolean

      defines if alpha mode can be changed

    Returns Mesh

    the current mesh

rotate

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

    Parameters

    Returns TransformNode

rotateAround

rotatePOV

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

    Parameters

    • flipBack: number

      defines the flip

    • twirlClockwise: number

      defines the twirl

    • tiltRight: number

      defines the tilt

    Returns AbstractMesh

    the current mesh

serialize

  • serialize(serializationObject: any): void
  • Parameters

    • serializationObject: any

    Returns void

serializeAnimationRanges

  • serializeAnimationRanges(): any

setAbsolutePosition

setBoundingInfo

setEnabled

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

    Parameters

    • value: boolean

      defines the new enabled state

    Returns void

setIndices

setMaterialByID

  • setMaterialByID(id: string): Mesh
  • Sets the mesh material by the material or multiMaterial id property. The material id is a string identifying the material or the multiMaterial. This method returns the Mesh.

    Parameters

    • id: string

    Returns Mesh

setNormalsForCPUSkinning

  • setNormalsForCPUSkinning(): Float32Array
  • Returns Float32Array

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

setParent

  • Defines the passed node as the parent of the current node. The node will remain exactly where it is and its position / rotation will be updated accordingly Returns the TransformNode.

    Parameters

    Returns TransformNode

setPhysicsLinkWith

setPivotMatrix

  • Sets a new pivot matrix to the current node

    Parameters

    • matrix: Matrix

      defines the new pivot matrix to use

    • Optional postMultiplyPivotMatrix: boolean

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

    Returns TransformNode

    the current TransformNode

setPivotPoint

  • Sets a new pivot point to the current node

    Parameters

    • point: Vector3

      defines the new pivot point to use

    • Optional space: Space

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

    Returns TransformNode

    the current TransformNode

setPositionWithLocalVector

setPositionsForCPUSkinning

  • setPositionsForCPUSkinning(): Float32Array
  • Returns Float32Array

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

setPreTransformMatrix

setVerticesBuffer

setVerticesData

  • setVerticesData(kind: string, data: FloatArray, updatable?: boolean, stride?: number): Mesh

simplify

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

    Parameters

    • settings: Array<ISimplificationSettings>

      a collection of simplification settings.

    • Optional parallelProcessing: boolean

      should all levels calculate parallel or one after the other.

    • Optional simplificationType: SimplificationType
    • Optional successCallback: function

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

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

          • Optional mesh: Mesh
          • Optional submeshIndex: number

          Returns void

    Returns Mesh

subdivide

  • subdivide(count: number): void
  • Parameters

    • count: number

    Returns void

synchronizeInstances

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

    Returns Mesh

toLeftHanded

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

    Returns Mesh

toString

  • toString(fullDetails?: boolean): string
  • Returns a string.

    Parameters

    • Optional fullDetails: boolean

      support for multiple levels of logging within scene loading

    Returns string

translate

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

    Parameters

    Returns TransformNode

unfreezeNormals

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

    Returns Mesh

unfreezeWorldMatrix

  • unfreezeWorldMatrix(): this

unregisterAfterRender

  • unregisterAfterRender(func: function): Mesh
  • Disposes a previously registered javascript function called after the rendering. This function is passed the current mesh. Return the Mesh.

    Parameters

    Returns Mesh

unregisterAfterWorldMatrixUpdate

  • unregisterAfterWorldMatrixUpdate(func: function): TransformNode

unregisterBeforeRender

  • unregisterBeforeRender(func: function): Mesh
  • Disposes a previously registered javascript function called before the rendering. This function is passed the current mesh. Returns the Mesh.

    Parameters

    Returns Mesh

updateCoordinateHeights

  • Force the heights to be recomputed for getHeightAtCoordinates() or getNormalAtCoordinates() if the ground has been updated. This can be used in the render loop. Returns the GroundMesh.

    Returns GroundMesh

updateFacetData

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

    see

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

    Returns AbstractMesh

    the current mesh

updateIndices

updateMeshPositions

  • updateMeshPositions(positionFunction: function, computeNormals?: boolean): Mesh

updatePoseMatrix

updateVerticesData

  • updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean, makeItUnique?: boolean): Mesh

Static AddNodeConstructor

  • Add a new node constructor

    Parameters

    • type: string

      defines the type name of the node to construct

    • constructorFunc: NodeConstructor

      defines the constructor function

    Returns void

Static Center

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

    Parameters

    Returns Vector3

Static Construct

  • Construct(type: string, name: string, scene: Scene, options?: any): Nullable<function>
  • Returns a node constructor based on type name

    Parameters

    • type: string

      defines the type name

    • name: string

      defines the new node name

    • scene: Scene

      defines the hosting scene

    • Optional options: any

      defines optional options to transmit to constructors

    Returns Nullable<function>

    the new constructor or null

Static CreateBox

  • CreateBox(name: string, size: number, scene?: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a box mesh. Please consider using the same method from the MeshBuilder class instead. The parameter size sets the size (float) of each box side (default 1). You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • size: number
    • Optional scene: Nullable<Scene>
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreateCylinder

  • CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene?: Scene, updatable?: any, sideOrientation?: number): Mesh
  • Creates a cylinder or a cone mesh. Please consider using the same method from the MeshBuilder class instead. The parameter height sets the height size (float) of the cylinder/cone (float, default 2). The parameter diameter sets the diameter of the top and bottom cap at once (float, default 1). The parameters diameterTop and diameterBottom overwrite the parameter diameter and set respectively the top cap and bottom cap diameter (floats, default 1). The parameter "diameterBottom" can't be zero. The parameter tessellation sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance. The parameter subdivisions sets the number of rings along the cylinder height (positive integer, default 1). You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • height: number
    • diameterTop: number
    • diameterBottom: number
    • tessellation: number
    • subdivisions: any
    • Optional scene: Scene
    • Optional updatable: any
    • Optional sideOrientation: number

    Returns Mesh

Static CreateDashedLines

  • Creates a dashed line mesh. Please consider using the same method from the MeshBuilder class instead. A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter. Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function. The parameter points is an array successive Vector3. The parameter dashNb is the intended total number of dashes (positive integer, default 200). The parameter dashSize is the size of the dashes relatively the dash number (positive float, default 3). The parameter gapSize is the size of the gap between two successive dashes relatively the dash number (positive float, default 1). The optional parameter instance is an instance of an existing LineMesh object to be updated with the passed points parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines When updating an instance, remember that only point positions can change, not the number of points. 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
    • points: Vector3[]
    • dashSize: number
    • gapSize: number
    • dashNb: number
    • Optional scene: Nullable<Scene>
    • Optional updatable: boolean
    • Optional instance: LinesMesh

    Returns LinesMesh

Static CreateDecal

  • Creates a decal mesh. Please consider using the same method from the MeshBuilder class instead. A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter sourceMesh depicting the decal. The parameter position (Vector3, default (0, 0, 0)) sets the position of the decal in World coordinates. The parameter normal (Vector3, default Vector3.Up) sets the normal of the mesh where the decal is applied onto in World coordinates. The parameter size (Vector3, default (1, 1, 1)) sets the decal scaling. The parameter angle (float in radian, default 0) sets the angle to rotate the decal.

    Parameters

    Returns Mesh

Static CreateDisc

  • CreateDisc(name: string, radius: number, tessellation: number, scene?: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a plane polygonal mesh. By default, this is a disc. Please consider using the same method from the MeshBuilder class instead. The parameter radius sets the radius size (float) of the polygon (default 0.5). The parameter tessellation 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. You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • radius: number
    • tessellation: number
    • Optional scene: Nullable<Scene>
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreateGround

  • CreateGround(name: string, width: number, height: number, subdivisions: number, scene?: Scene, updatable?: boolean): Mesh
  • Creates a ground mesh. Please consider using the same method from the MeshBuilder class instead. The parameters width and height (floats, default 1) set the width and height sizes of the ground. The parameter subdivisions (positive integer) sets the number of subdivisions per side. 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
    • width: number
    • height: number
    • subdivisions: number
    • Optional scene: Scene
    • Optional updatable: boolean

    Returns Mesh

Static CreateGroundFromHeightMap

  • CreateGroundFromHeightMap(name: string, url: string, width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, scene: Scene, updatable?: boolean, onReady?: function): GroundMesh
  • Creates a ground mesh from a height map. tuto : http://doc.babylonjs.com/babylon101/height_map Please consider using the same method from the MeshBuilder class instead. The parameter url sets the URL of the height map image resource. The parameters width and height (positive floats, default 10) set the ground width and height sizes. The parameter subdivisions (positive integer, default 1) sets the number of subdivision per side. The parameter minHeight (float, default 0) is the minimum altitude on the ground. The parameter maxHeight (float, default 1) is the maximum altitude on the ground. The parameter onReady is a javascript callback function that will be called once the mesh is just built (the height map download can last some time). This function is passed the newly built mesh :

    function(mesh) { // do things
        return; }
    

    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
    • url: string
    • width: number
    • height: number
    • subdivisions: number
    • minHeight: number
    • maxHeight: number
    • scene: Scene
    • Optional updatable: boolean
    • Optional onReady: function

    Returns GroundMesh

Static CreateIcoSphere

  • CreateIcoSphere(name: string, options: object, scene: Scene): Mesh
  • Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided. Please consider using the same method from the MeshBuilder class instead. The parameter radius sets the radius size (float) of the icosphere (default 1). You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters radiusX, radiusY and radiusZ (all by default have the same value than radius). The parameter subdivisions sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size. The parameter flat (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface. You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • options: object
      • Optional flat?: boolean
      • Optional radius?: number
      • Optional sideOrientation?: number
      • Optional subdivisions?: number
      • Optional updatable?: boolean
    • scene: Scene

    Returns Mesh

Static CreateLathe

  • CreateLathe(name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates lathe mesh. The lathe is a shape with a symetry axis : a 2D model shape is rotated around this axis to design the lathe. Please consider using the same method from the MeshBuilder class instead. The parameter shape 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. The parameter radius (positive float, default 1) is the radius value of the lathe. The parameter tessellation (positive integer, default 64) is the side number of the lathe. You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • shape: Vector3[]
    • radius: number
    • tessellation: number
    • scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreateLines

  • Creates a line mesh. Please consider using the same method from the MeshBuilder class instead. A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter. Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function. The parameter points is an array successive Vector3. The optional parameter instance is an instance of an existing LineMesh object to be updated with the passed points parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines When updating an instance, remember that only point positions can change, not the number of points. 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

    Returns LinesMesh

Static CreatePlane

  • CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a plane mesh. Please consider using the same method from the MeshBuilder class instead. The parameter size sets the size (float) of both sides of the plane at once (default 1). You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • size: number
    • scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreatePolygon

  • CreatePolygon(name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a polygon mesh. Please consider using the same method from the MeshBuilder class instead. The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh. The parameter shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors. You can set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.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
    • shape: Vector3[]
    • scene: Scene
    • Optional holes: Vector3[][]
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreatePolyhedron

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

    Parameters

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

    Returns Mesh

Static CreateRibbon

  • CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean | undefined, closePath: boolean, offset: number, scene?: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates a ribbon mesh. Please consider using the same method from the MeshBuilder class instead. The ribbon is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters.

    Please read this full tutorial to understand how to design a ribbon : http://doc.babylonjs.com/tutorials/Ribbon_Tutorial The parameter pathArray is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry. The parameter closeArray (boolean, default false) creates a seam between the first and the last paths of the path array. The parameter closePath (boolean, default false) creates a seam between the first and the last points of each path of the path array. The parameter offset (positive integer, default : rounded half size of the pathArray length), is taken in account only if the pathArray is containing a single path. It's the offset to join together the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11. The optional parameter instance is an instance of an existing Ribbon object to be updated with the passed pathArray parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • pathArray: Vector3[][]
    • closeArray: boolean | undefined
    • closePath: boolean
    • offset: number
    • Optional scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number
    • Optional instance: Mesh

    Returns Mesh

Static CreateSphere

  • CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a sphere mesh. Please consider using the same method from the MeshBuilder class instead. The parameter diameter sets the diameter size (float) of the sphere (default 1). The parameter segments sets the sphere number of horizontal stripes (positive integer, default 32). You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • segments: number
    • diameter: number
    • Optional scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreateTiledGround

  • CreateTiledGround(name: string, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: object, precision: object, scene: Scene, updatable?: boolean): Mesh
  • Creates a tiled ground mesh. Please consider using the same method from the MeshBuilder class instead. The parameters xmin and xmax (floats, default -1 and 1) set the ground minimum and maximum X coordinates. The parameters zmin and zmax (floats, default -1 and 1) set the ground minimum and maximum Z coordinates. The parameter subdivisions is a javascript 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. The parameter precision is a javascript 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. 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
    • xmin: number
    • zmin: number
    • xmax: number
    • zmax: number
    • subdivisions: object
      • h: number
      • w: number
    • precision: object
      • h: number
      • w: number
    • scene: Scene
    • Optional updatable: boolean

    Returns Mesh

Static CreateTorus

  • CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a torus mesh. Please consider using the same method from the MeshBuilder class instead. The parameter diameter sets the diameter size (float) of the torus (default 1). The parameter thickness sets the diameter size of the tube of the torus (float, default 0.5). The parameter tessellation sets the number of torus sides (postive integer, default 16). You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • diameter: number
    • thickness: number
    • tessellation: number
    • Optional scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreateTorusKnot

  • CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a torus knot mesh. Please consider using the same method from the MeshBuilder class instead. The parameter radius sets the global radius size (float) of the torus knot (default 2). The parameter radialSegments sets the number of sides on each tube segments (positive integer, default 32). The parameter tubularSegments sets the number of tubes to decompose the knot into (positive integer, default 32). The parameters p and q are the number of windings on each axis (positive integers, default 2 and 3). You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • radius: number
    • tube: number
    • radialSegments: number
    • tubularSegments: number
    • p: number
    • q: number
    • Optional scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static CreateTube

  • CreateTube(name: string, path: Vector3[], radius: number, tessellation: number, radiusFunction: function, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates a tube mesh. The tube is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead. The parameter path is a required array of successive Vector3. It is the curve used as the axis of the tube. The parameter radius (positive float, default 1) sets the tube radius size. The parameter tessellation (positive float, default 64) is the number of sides on the tubular surface. The parameter radiusFunction (javascript function, default null) is a vanilla javascript function. If it is not null, it overwrittes the parameter radius. This function is called on each point of the tube path and is passed the index i of the i-th point and the distance of this point from the first point of the path. It must return a radius value (positive float) :

    var radiusFunction = function(i, distance) {
        // do things
        return radius; }
    

    The parameter cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL The optional parameter instance is an instance of an existing Tube object to be updated with the passed pathArray parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • path: Vector3[]
    • radius: number
    • tessellation: number
    • radiusFunction: function
        • (i: number, distance: number): number
        • Parameters

          • i: number
          • distance: number

          Returns number

    • cap: number
    • scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number
    • Optional instance: Mesh

    Returns Mesh

Static ExtrudePolygon

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

    Parameters

    • name: string
    • shape: Vector3[]
    • depth: number
    • scene: Scene
    • Optional holes: Vector3[][]
    • Optional updatable: boolean
    • Optional sideOrientation: number

    Returns Mesh

Static ExtrudeShape

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

    Please read this full tutorial to understand how to design an extruded shape : http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes The parameter shape 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. The parameter path is a required array of successive Vector3. This is the axis curve the shape is extruded along. The parameter rotation (float, default 0 radians) 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. The parameter scale (float, default 1) is the value to scale the shape. The parameter cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL The optional parameter instance is an instance of an existing ExtrudedShape object to be updated with the passed shape, path, scale or rotation parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape Remember you can only change the shape or path point positions, not their number when updating an extruded shape. You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • shape: Vector3[]
    • path: Vector3[]
    • scale: number
    • rotation: number
    • cap: number
    • Optional scene: Nullable<Scene>
    • Optional updatable: boolean
    • Optional sideOrientation: number
    • Optional instance: Mesh

    Returns Mesh

Static ExtrudeShapeCustom

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

    Please read this full tutorial to understand how to design a custom extruded shape : http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes The parameter shape 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. The parameter path is a required array of successive Vector3. This is the axis curve the shape is extruded along. The parameter rotationFunction (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the begining of the path :

    var rotationFunction = function(i, distance) {
        // do things
        return rotationValue; }
    

    It must returns a float value that will be the rotation in radians applied to the shape on each path point. The parameter scaleFunction (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the begining of the path :

    var scaleFunction = function(i, distance) {
        // do things
       return scaleValue;}
    

    It must returns a float value that will be the scale value applied to the shape on each path point. The parameter ribbonClosePath (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its pathArray. The parameter ribbonCloseArray (boolean, default false) forces the extrusion underlying ribbon to close its pathArray. The parameter cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL The optional parameter instance is an instance of an existing ExtrudedShape object to be updated with the passed shape, path, scale or rotation parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape Remember you can only change the shape or path point positions, not their number when updating an extruded shape. You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.

    Parameters

    • name: string
    • shape: Vector3[]
    • path: Vector3[]
    • scaleFunction: Function
    • rotationFunction: Function
    • ribbonCloseArray: boolean
    • ribbonClosePath: boolean
    • cap: number
    • scene: Scene
    • Optional updatable: boolean
    • Optional sideOrientation: number
    • Optional instance: Mesh

    Returns Mesh

Static MergeMeshes

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

    Parameters

    • meshes: Array<Mesh>

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

    • Optional disposeSource: boolean

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

    • Optional allow32BitsIndices: boolean

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

    • Optional meshSubclass: Mesh

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

    • Optional subdivideWithSubMeshes: boolean

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

    Returns Nullable<Mesh>

Static MinMax

  • Returns an object {min: Vector3, max: Vector3} This min and max Vector3 are the minimum and maximum vectors of each mesh bounding box from the passed array, in the World system

    Parameters

    Returns object

Static Parse

Static ParseAnimationRanges

  • ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void
  • Parse animation range data from a serialization object and store them into a given node

    Parameters

    • node: Node

      defines where to store the animation ranges

    • parsedNode: any

      defines the serialization object to read data from

    • scene: Scene

      defines the hosting scene

    Returns void

Generated using TypeDoc