LinesMesh

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Find examples in Playground
  • new LinesMesh(name: string, scene?: Nullable<Scene>, parent?: Nullable<Node>, source?: LinesMesh, doNotCloneChildren?: boolean, useVertexColor?: boolean | undefined, useVertexAlpha?: boolean | undefined): LinesMesh
  • Creates a new LinesMesh

    Parameters

    • name: string

      defines the name

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional parent: Nullable<Node>

      defines the parent mesh if any

    • Optional source: LinesMesh

      defines the optional source LinesMesh used to clone data from

    • Optional doNotCloneChildren: boolean

      When cloning, skip cloning child meshes of source, default False. When false, achieved by calling a clone(), also passing False. This will make creation of children, recursive.

    • Optional useVertexColor: boolean | undefined

      defines if this LinesMesh supports vertex color

    • Optional useVertexAlpha: boolean | undefined

      defines if this LinesMesh supports vertex alpha

    Returns LinesMesh

Properties

absolutePosition

Find examples in Playground
absolutePosition: Vector3

Returns the current mesh absolute position. Returns a Vector3.

actionManager

Find examples in Playground
actionManager: Nullable<ActionManager>

Gets or sets the current action manager

see

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

alpha

Find examples in Playground
alpha: number

Alpha of the line (Default: 1)

alphaIndex

Find examples in Playground
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

Find examples in Playground
alwaysSelectAsActiveMesh: boolean

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

animationPropertiesOverride

Find examples in Playground
animationPropertiesOverride: Nullable<AnimationPropertiesOverride>

Gets or sets the animation properties override

animations

Find examples in Playground
animations: Animation[]

Gets a list of Animations associated with the node

applyFog

Find examples in Playground
applyFog: boolean

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

areNormalsFrozen

Find examples in Playground
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.

behaviors

Find examples in Playground
behaviors: Behavior<Node>[]

Gets the list of attached behaviors

see

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

billboardMode

Find examples in Playground
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

collider

Find examples in Playground
collider: Collider

Gets Collider object used to compute collisions (not physics)

see

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

collisionGroup

Find examples in Playground
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

Find examples in Playground
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

color

Find examples in Playground
color: Color3

Color of the line (Default: White)

computeBonesUsingShaders

Find examples in Playground
computeBonesUsingShaders: boolean

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

cullingStrategy

Find examples in Playground
cullingStrategy: number

Gets ot sets the culling strategy to use to find visible meshes

definedFacingForward

Find examples in Playground
definedFacingForward: boolean

Gets or sets the orientation for POV movement & rotation

delayLoadState

Find examples in Playground
delayLoadState: number

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

see

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

delayLoadingFile

Find examples in Playground
delayLoadingFile: string

Gets the file containing delay loading data for this mesh

doNotSerialize

Find examples in Playground
doNotSerialize: boolean

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

edgesColor

Find examples in Playground
edgesColor: Color4

Defines edge color used when edgesRenderer is enabled

see

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

edgesWidth

Find examples in Playground
edgesWidth: number

Defines edge width used when edgesRenderer is enabled

see

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

ellipsoid

Find examples in Playground
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

Find examples in Playground
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

Find examples in Playground
enablePointerMoveEvents: boolean

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

facetDepthSortFrom

Find examples in Playground
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

Find examples in Playground
facetNb: number

forward

Find examples in Playground
forward: Vector3

The forward direction of that transform in world space.

geometry

Find examples in Playground
geometry: Nullable<Geometry>

Gets the mesh internal Geometry object

hasLODLevels

Find examples in Playground
hasLODLevels: boolean

Gets a boolean indicating if this mesh has LOD

hasVertexAlpha

Find examples in Playground
hasVertexAlpha: boolean

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

id

Find examples in Playground
id: string

Gets or sets the id of the node

ignoreNonUniformScaling

Find examples in Playground
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

Find examples in Playground
infiniteDistance: boolean

Sets the distance of the object to max, often used by skybox

instances

Find examples in Playground
instances: InstancedMesh[]

Gets the list of instances created from this mesh

see

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

intersectionThreshold

Find examples in Playground
intersectionThreshold: number

The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray. This margin is expressed in world space coordinates, so its value may vary.

isBlocked

Find examples in Playground
isBlocked: boolean

isBlocker

Find examples in Playground
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

Find examples in Playground
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

isPickable

Find examples in Playground
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

Find examples in Playground
isUnIndexed: boolean

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

isVisible

Find examples in Playground
isVisible: boolean

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

isWorldMatrixFrozen

Find examples in Playground
isWorldMatrixFrozen: boolean

True if the World matrix has been frozen.

layerMask

Find examples in Playground
layerMask: number

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

see

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

metadata

Find examples in Playground
metadata: any

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

morphTargetManager

Find examples in Playground
morphTargetManager: Nullable<MorphTargetManager>

Gets or sets the morph target manager

see

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

mustDepthSortFacets

Find examples in Playground
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

Find examples in Playground
name: string

Gets or sets the name of the node

nonUniformScaling

Find examples in Playground
nonUniformScaling: boolean

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

numBoneInfluencers

Find examples in Playground
numBoneInfluencers: number

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

onAfterRenderObservable

Find examples in Playground
onAfterRenderObservable: Observable<Mesh>

An event triggered after rendering the mesh

onAfterWorldMatrixUpdateObservable

Find examples in Playground
onAfterWorldMatrixUpdateObservable: Observable<TransformNode>

An event triggered after the world matrix is updated

onBeforeDraw

Find examples in Playground
onBeforeDraw: function

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

Type declaration

    • (): void
    • Returns void

onBeforeDrawObservable

Find examples in Playground
onBeforeDrawObservable: Observable<Mesh>

An event triggered before drawing the mesh

onBeforeRenderObservable

Find examples in Playground
onBeforeRenderObservable: Observable<Mesh>

An event triggered before rendering the mesh

onCollide

Find examples in Playground
onCollide: function

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

Type declaration

    • (): void
    • Returns void

onCollideObservable

Find examples in Playground
onCollideObservable: Observable<AbstractMesh>

An event triggered when this mesh collides with another one

onCollisionPositionChange

Find examples in Playground
onCollisionPositionChange: function

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

Type declaration

    • (): void
    • Returns void

onCollisionPositionChangeObservable

Find examples in Playground
onCollisionPositionChangeObservable: Observable<Vector3>

An event triggered when the collision's position changes

onDispose

Find examples in Playground
onDispose: function

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

Type declaration

    • (): void
    • Returns void

onDisposeObservable

Find examples in Playground
onDisposeObservable: Observable<Node>

An event triggered when the mesh is disposed

onLODLevelSelection

Find examples in Playground
onLODLevelSelection: function

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

see

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

Type declaration

onMaterialChangedObservable

Find examples in Playground
onMaterialChangedObservable: Observable<AbstractMesh>

An event triggered when material is changed

onReady

Find examples in Playground
onReady: function

Callback raised when the node is ready to be used

Type declaration

    • (node: Node): void
    • Parameters

      Returns void

onRebuildObservable

Find examples in Playground
onRebuildObservable: Observable<AbstractMesh>

An event triggered when the mesh is rebuilt.

outlineColor

Find examples in Playground
outlineColor: Color3

Defines color to use when rendering outline

outlineWidth

Find examples in Playground
outlineWidth: number

Define width to use when rendering outline

overlayAlpha

Find examples in Playground
overlayAlpha: number

Defines alpha to use when rendering overlay

overlayColor

Find examples in Playground
overlayColor: Color3

Defines color to use when rendering overlay

overrideMaterialSideOrientation

Find examples in Playground
overrideMaterialSideOrientation: Nullable<number>

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

overridenInstanceCount

Find examples in Playground
overridenInstanceCount: number

Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs

parent

Find examples in Playground
parent: Nullable<Node>

Gets or sets the parent of the node

partitioningBBoxRatio

Find examples in Playground
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

Find examples in Playground
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

position

Find examples in Playground
position: Vector3

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

receiveShadows

Find examples in Playground
receiveShadows: boolean

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

see

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

renderingGroupId

Find examples in Playground
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

Find examples in Playground
right: Vector3

The right direction of that transform in world space.

rotation

Find examples in Playground
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

rotationQuaternion

Find examples in Playground
rotationQuaternion: Nullable<Quaternion>

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

scaling

Find examples in Playground
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

Find examples in Playground
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

showSubMeshesBoundingBox

Find examples in Playground
showSubMeshesBoundingBox: boolean

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

skeleton

Find examples in Playground
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

Find examples in Playground
source: Nullable<Mesh>

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

state

Find examples in Playground
state: string

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

subMeshes

Find examples in Playground
subMeshes: SubMesh[]

Gets or sets the list of subMeshes

see

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

uniqueId

Find examples in Playground
uniqueId: number

Gets or sets the unique id of the node

up

Find examples in Playground

The up direction of that transform in world space.

useBones

Find examples in Playground
useBones: boolean

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

useOctreeForCollisions

Find examples in Playground
useOctreeForCollisions: boolean

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

useOctreeForPicking

Find examples in Playground
useOctreeForPicking: boolean

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

useOctreeForRenderingSelection

Find examples in Playground
useOctreeForRenderingSelection: boolean

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

Optional useVertexAlpha

Find examples in Playground
useVertexAlpha: boolean | undefined

If vertex alpha should be applied to the mesh

Optional useVertexColor

Find examples in Playground
useVertexColor: boolean | undefined

If vertex color should be applied to the mesh

useVertexColors

Find examples in Playground
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

Find examples in Playground
visibility: number

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

worldMatrixFromCache

Find examples in Playground
worldMatrixFromCache: Matrix

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

Static BACKSIDE

Find examples in Playground
BACKSIDE: number

Mesh side orientation : usually the internal or back surface

Static BILLBOARDMODE_ALL

Find examples in Playground
BILLBOARDMODE_ALL: number

Billboard on all axes

Static BILLBOARDMODE_NONE

Find examples in Playground
BILLBOARDMODE_NONE: number

No billboard

Static BILLBOARDMODE_X

Find examples in Playground
BILLBOARDMODE_X: number

Billboard on X axis

Static BILLBOARDMODE_Y

Find examples in Playground
BILLBOARDMODE_Y: number

Billboard on Y axis

Static BILLBOARDMODE_Z

Find examples in Playground
BILLBOARDMODE_Z: number

Billboard on Z axis

Static CAP_ALL

Find examples in Playground
CAP_ALL: number

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

Static CAP_END

Find examples in Playground
CAP_END: number

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

Static CAP_START

Find examples in Playground
CAP_START: number

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

Static CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY

Find examples in Playground
CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY: number

Culling strategy with bounding sphere only and then frustum culling

Static CULLINGSTRATEGY_STANDARD

Find examples in Playground
CULLINGSTRATEGY_STANDARD: number

Default culling strategy with bounding box and bounding sphere and then frustum culling

Static DEFAULTSIDE

Find examples in Playground
DEFAULTSIDE: number

Mesh side orientation : by default, FRONTSIDE

Static DOUBLESIDE

Find examples in Playground
DOUBLESIDE: number

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

Static FRONTSIDE

Find examples in Playground
FRONTSIDE: number

Mesh side orientation : usually the external or front surface

Static NO_CAP

Find examples in Playground
NO_CAP: number

Mesh cap setting : no cap

Static OCCLUSION_ALGORITHM_TYPE_ACCURATE

Find examples in Playground
OCCLUSION_ALGORITHM_TYPE_ACCURATE: number

Use an accurante occlusion algorithm

Static OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE

Find examples in Playground
OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE: number

Use a conservative occlusion algorithm

Static OCCLUSION_TYPE_NONE

Find examples in Playground
OCCLUSION_TYPE_NONE: number

No occlusion

Static OCCLUSION_TYPE_OPTIMISTIC

Find examples in Playground
OCCLUSION_TYPE_OPTIMISTIC: number

Occlusion set to optimisitic

Static OCCLUSION_TYPE_STRICT

Find examples in Playground
OCCLUSION_TYPE_STRICT: number

Occlusion set to strict

Methods

addBehavior

Find examples in Playground

addChild

Find examples in Playground

addLODLevel

Find examples in Playground

addRotation

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

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

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

    Parameters

    • x: number

      Rotation to add

    • y: number

      Rotation to add

    • z: number

      Rotation to add

    Returns TransformNode

    the TransformNode.

alignWithNormal

Find examples in Playground
  • 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

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

    Parameters

    • url: string

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

    • minHeight: number

      is the lower limit of the displacement.

    • maxHeight: number

      is the upper limit of the displacement.

    • Optional onSuccess: function

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

        • (mesh: Mesh): void
        • Parameters

          Returns void

    • Optional uvOffset: Vector2

      is an optional vector2 used to offset UV.

    • Optional uvScale: Vector2

      is an optional vector2 used to scale UV.

    • Optional forceUpdate: boolean

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

    Returns Mesh

    the Mesh.

applyDisplacementMapFromBuffer

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

    Parameters

    • buffer: Uint8Array

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

    • heightMapWidth: number

      is the width of the buffer image.

    • heightMapHeight: number

      is the height of the buffer image.

    • minHeight: number

      is the lower limit of the displacement.

    • maxHeight: number

      is the upper limit of the displacement.

    • Optional uvOffset: Vector2

      is an optional vector2 used to offset UV.

    • Optional uvScale: Vector2

      is an optional vector2 used to scale UV.

    • Optional forceUpdate: boolean

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

    Returns Mesh

    the Mesh.

applySkeleton

Find examples in Playground
  • Updates the vertex buffer by applying transformation from the bones

    Parameters

    • skeleton: Skeleton

      defines the skeleton to apply to current mesh

    Returns Mesh

    the current mesh

attachToBone

Find examples in Playground
  • Attach the current TransformNode to another TransformNode associated with a bone

    Parameters

    • bone: Bone

      Bone affecting the TransformNode

    • affectedTransformNode: TransformNode

      TransformNode associated with the bone

    Returns TransformNode

    this object

bakeCurrentTransformIntoVertices

Find examples in Playground
  • bakeCurrentTransformIntoVertices(): Mesh

bakeTransformIntoVertices

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

    see

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

    Parameters

    • transform: Matrix

      defines the transform matrix to use

    Returns Mesh

    the current mesh

beginAnimation

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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

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

    Returns void

clone

Find examples in Playground
  • clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): LinesMesh
  • Returns a new LineMesh object cloned from the current one.

    Parameters

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

    Returns LinesMesh

computeWorldMatrix

Find examples in Playground
  • computeWorldMatrix(force?: boolean): Matrix

convertToFlatShadedMesh

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

    Returns Mesh

    current mesh

convertToUnIndexedMesh

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

    Returns Mesh

    current mesh

createAnimationRange

Find examples in Playground
  • 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

Find examples in Playground

createNormals

Find examples in Playground
  • 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

deleteAnimationRange

Find examples in Playground
  • 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

Find examples in Playground

disableFacetData

Find examples in Playground

dispose

Find examples in Playground
  • dispose(doNotRecurse?: boolean): void
  • Disposes of the line mesh

    Parameters

    • Optional doNotRecurse: boolean

      If children should be disposed

    Returns void

enableEdgesRendering

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

    see

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

    Parameters

    • Optional epsilon: number

      defines the maximal distance between two angles to detect a face

    • Optional checkVerticesInsteadOfIndices: boolean

      indicates that we should check vertex list directly instead of faces

    Returns AbstractMesh

    the currentAbstractMesh

flipFaces

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

    Parameters

    • Optional flipNormals: boolean

      will also inverts the normals

    Returns Mesh

    current mesh

freezeNormals

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

    Returns Mesh

    the current mesh

freezeWorldMatrix

Find examples in Playground

getAbsolutePivotPoint

Find examples in Playground

getAbsolutePivotPointToRef

Find examples in Playground

getAbsolutePosition

Find examples in Playground

getAnimatables

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

    Returns IAnimatable[]

    an array of IAnimatable

getAnimationByName

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground

getBoundingInfo

Find examples in Playground

getChildMeshes

Find examples in Playground
  • 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 AbstractMesh

getChildTransformNodes

Find examples in Playground
  • 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 TransformNode

getChildren

Find examples in Playground
  • 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 Node

getClassName

Find examples in Playground
  • getClassName(): string

getClosestFacetAtCoordinates

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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

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

    Parameters

    • localAxis: Vector3

      axis to rotate

    Returns Vector3

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

getDirectionToRef

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

    Parameters

    • localAxis: Vector3

      axis to rotate

    • result: Vector3

      the resulting transformnode

    Returns TransformNode

    this TransformNode.

getDistanceToCamera

Find examples in Playground

getEmittedParticleSystems

Find examples in Playground

getEngine

Find examples in Playground

getFacetDataParameters

Find examples in Playground
  • getFacetDataParameters(): any

getFacetLocalNormals

Find examples in Playground
  • getFacetLocalNormals(): Vector3[]

getFacetLocalPartitioning

Find examples in Playground
  • getFacetLocalPartitioning(): number[][]

getFacetLocalPositions

Find examples in Playground
  • getFacetLocalPositions(): Vector3[]

getFacetNormal

Find examples in Playground
  • getFacetNormal(i: number): Vector3

getFacetNormalToRef

Find examples in Playground
  • getFacetNormalToRef(i: number, ref: Vector3): this

getFacetPosition

Find examples in Playground
  • getFacetPosition(i: number): Vector3

getFacetPositionToRef

Find examples in Playground

getFacetsAtLocalCoordinates

Find examples in Playground
  • getFacetsAtLocalCoordinates(x: number, y: number, z: number): Nullable<number[]>

getHierarchyBoundingVectors

Find examples in Playground
  • 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

Find examples in Playground

getIndices

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

    Parameters

    • Optional copyWhenShared: boolean

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

    • Optional forceCopy: boolean

      defines a boolean indicating that the returned array must be cloned upon returning it

    Returns Nullable<IndicesArray>

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

getLOD

Find examples in Playground

getLODLevelAtDistance

Find examples in Playground

getLODLevels

Find examples in Playground
  • Gets the list of MeshLODLevel associated with the current mesh

    Returns MeshLODLevel[]

    an array of MeshLODLevel

getPivotMatrix

Find examples in Playground

getPivotPoint

Find examples in Playground

getPivotPointToRef

Find examples in Playground

getPoseMatrix

Find examples in Playground

getPositionExpressedInLocalSpace

Find examples in Playground
  • getPositionExpressedInLocalSpace(): Vector3

getPositionInCameraSpace

Find examples in Playground

getScene

Find examples in Playground

getTotalIndices

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

    Returns number

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

getTotalVertices

Find examples in Playground
  • getTotalVertices(): number

getVertexBuffer

Find examples in Playground
  • 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 :

      • 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 Nullable<VertexBuffer>

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

getVerticesData

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

    Parameters

    • kind: string

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

      • 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
    • Optional copyWhenShared: boolean

      defines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one

    • Optional forceCopy: boolean

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

    Returns Nullable<FloatArray>

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

getVerticesDataKinds

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

    Returns string[]

    an array of strings

getWorldMatrix

Find examples in Playground

intersects

Find examples in Playground

intersectsMesh

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • isDisposed(): boolean
  • Gets a boolean indicating if the node has been disposed

    Returns boolean

    true if the node was disposed

isEnabled

Find examples in Playground
  • 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

Find examples in Playground
  • isInFrustum(frustumPlanes: Plane[]): boolean
  • Returns true if the mesh is within the frustum defined by the passed array of planes. A mesh is in the frustum if its bounding box intersects the frustum

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum to test

    Returns boolean

    true if the mesh is in the frustum planes

isReady

Find examples in Playground
  • 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

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

    Parameters

    • kind: string

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

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

    a boolean

isVerticesDataPresent

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

    Parameters

    • kind: string

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

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

    a boolean

locallyTranslate

Find examples in Playground

lookAt

Find examples in Playground
  • 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

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

    Returns Mesh

    the current mesh

markAsDirty

Find examples in Playground
  • Flag the transform node as dirty (Forcing it to update everything)

    Parameters

    • property: string

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

    Returns TransformNode

    this transform node

markVerticesDataAsUpdatable

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

    Parameters

    • kind: string

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

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

      defines if the updated vertex buffer must be flagged as updatable

    Returns void

movePOV

Find examples in Playground
  • 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

Find examples in Playground

normalizeToUnitCube

Find examples in Playground
  • 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

optimizeIndices

Find examples in Playground
  • 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.

    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

    the current mesh

refreshBoundingInfo

Find examples in Playground
  • 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 Mesh

    the current mesh

registerAfterRender

Find examples in Playground
  • registerAfterRender(func: function): Mesh
  • Registers for this mesh a javascript function called just after the rendering is complete

    Parameters

    • func: function

      defines the function to call after rendering this mesh

    Returns Mesh

    the current mesh

registerAfterWorldMatrixUpdate

Find examples in Playground

registerBeforeRender

Find examples in Playground
  • registerBeforeRender(func: function): Mesh
  • Registers for this mesh a javascript function called just before the rendering process

    Parameters

    • func: function

      defines the function to call before rendering this mesh

    Returns Mesh

    the current mesh

releaseSubMeshes

Find examples in Playground

removeBehavior

Find examples in Playground

removeChild

Find examples in Playground

removeLODLevel

Find examples in Playground

render

Find examples in Playground
  • 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

Find examples in Playground
  • 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.

    Parameters

    • axis: Vector3

      the axis to rotate around

    • amount: number

      the amount to rotate in radians

    • Optional space: Space

      Space to rotate in (Default: local)

    Returns TransformNode

    the TransformNode.

rotateAround

Find examples in Playground

rotatePOV

Find examples in Playground
  • 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

Find examples in Playground
  • serialize(serializationObject: any): void
  • Serialize current mesh

    Parameters

    • serializationObject: any

      defines the object which will receive the serialization data

    Returns void

serializeAnimationRanges

Find examples in Playground
  • serializeAnimationRanges(): any

setAbsolutePosition

Find examples in Playground

setBoundingInfo

Find examples in Playground

setEnabled

Find examples in Playground
  • setEnabled(value: boolean): void
  • Set the enabled state of this node

    Parameters

    • value: boolean

      defines the new enabled state

    Returns void

setIndices

Find examples in Playground
  • Set the index buffer of this mesh

    Parameters

    • indices: IndicesArray

      defines the source data

    • Optional totalVertices: Nullable<number>

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

    • Optional updatable: boolean

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

    Returns Mesh

    the current mesh

setMaterialByID

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

    Parameters

    • id: string

      is a string identifying the material or the multiMaterial

    Returns Mesh

    the current mesh

setNormalsForCPUSkinning

Find examples in Playground
  • setNormalsForCPUSkinning(): Float32Array
  • Prepare internal normal array for software CPU skinning

    Returns Float32Array

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

setParent

Find examples in Playground
  • 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

    Parameters

    Returns TransformNode

    this TransformNode.

setPivotMatrix

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground

setPositionsForCPUSkinning

Find examples in Playground
  • setPositionsForCPUSkinning(): Float32Array
  • Prepare internal position array for software CPU skinning

    Returns Float32Array

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

setPreTransformMatrix

Find examples in Playground

setVerticesBuffer

Find examples in Playground

setVerticesData

Find examples in Playground
  • setVerticesData(kind: string, data: FloatArray, updatable?: boolean, stride?: number): 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 :

      • 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
    • data: FloatArray

      defines the data source

    • Optional updatable: boolean

      defines if the updated vertex buffer must be flagged as updatable

    • Optional stride: number

      defines the data stride size (can be null)

    Returns Mesh

    the current mesh

simplify

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

    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

      the type of simplification to run

    • 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

    the current mesh

subdivide

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

    Parameters

    • count: number

      defines the expected number of submeshes

    Returns void

synchronizeInstances

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

    Returns Mesh

    the current mesh

toLeftHanded

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

    Returns Mesh

    the current mesh

toString

Find examples in Playground
  • toString(fullDetails?: boolean): string
  • Returns a description of this mesh

    Parameters

    • Optional fullDetails: boolean

      define if full details about this mesh must be used

    Returns string

    a descriptive string representing this mesh

translate

Find examples in Playground
  • 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.

    Parameters

    • axis: Vector3

      the axis to translate in

    • distance: number

      the distance to translate

    • Optional space: Space

      Space to rotate in (Default: local)

    Returns TransformNode

    the TransformNode.

unfreezeNormals

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

    Returns Mesh

    the current mesh

unfreezeWorldMatrix

Find examples in Playground
  • unfreezeWorldMatrix(): this

unregisterAfterRender

Find examples in Playground
  • unregisterAfterRender(func: function): Mesh
  • Disposes a previously registered javascript function called after the rendering.

    Parameters

    Returns Mesh

    the current mesh

unregisterAfterWorldMatrixUpdate

Find examples in Playground
  • unregisterAfterWorldMatrixUpdate(func: function): TransformNode

unregisterBeforeRender

Find examples in Playground
  • unregisterBeforeRender(func: function): Mesh
  • Disposes a previously registered javascript function called before the rendering

    Parameters

    Returns Mesh

    the current mesh

updateFacetData

Find examples in Playground
  • 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

Find examples in Playground
  • Update the current index buffer

    Parameters

    • indices: IndicesArray

      defines the source data

    • Optional offset: number

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

    Returns Mesh

    the current mesh

updateMeshPositions

Find examples in Playground
  • updateMeshPositions(positionFunction: function, computeNormals?: boolean): Mesh

updatePoseMatrix

Find examples in Playground

updateVerticesData

Find examples in Playground
  • updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean, makeItUnique?: boolean): Mesh
  • Update a specific associated vertex buffer

    Parameters

    • kind: string

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

      defines the data source

    • Optional updateExtends: boolean

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

    • Optional makeItUnique: boolean

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

    Returns Mesh

    the current mesh

validateSkinning

Find examples in Playground
  • validateSkinning(): object
  • 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 object

    a validation object with skinned, valid and report string

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

Static AddNodeConstructor

Find examples in Playground
  • 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

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

    Parameters

    • meshesOrMinMaxVector: object | AbstractMesh[]

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

    Returns Vector3

    a vector3

Static Construct

Find examples in Playground
  • 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

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

    Parameters

    Returns Mesh

    a new Mesh

Static CreateCylinder

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • height: number

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

    • diameterTop: number

      set the top cap diameter (floats, default 1)

    • diameterBottom: number

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

    • tessellation: number

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

    • subdivisions: any

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

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: any

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateDashedLines

Find examples in Playground
  • Creates a dashed line mesh. Please consider using the same method from the MeshBuilder class instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • points: Vector3[]

      is an array successive Vector3

    • dashSize: number

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

    • gapSize: number

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

    • dashNb: number

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

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional instance: LinesMesh

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

    Returns LinesMesh

    a new Mesh

Static CreateDecal

Find examples in Playground
  • Creates a decal mesh. Please consider using the same method from the MeshBuilder class instead. A decal is a mesh usually applied as a model onto the surface of another mesh

    Parameters

    • name: string

      defines the name of the mesh

    • sourceMesh: AbstractMesh

      defines the mesh receiving the decal

    • position: Vector3

      sets the position of the decal in world coordinates

    • normal: Vector3

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

    • size: Vector3

      sets the decal scaling

    • angle: number

      sets the angle to rotate the decal

    Returns Mesh

    a new Mesh

Static CreateDisc

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • radius: number

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

    • tessellation: number

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

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateGround

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • width: number

      set the width of the ground

    • height: number

      set the height of the ground

    • subdivisions: number

      sets the number of subdivisions per side

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    Returns Mesh

    a new Mesh

Static CreateGroundFromHeightMap

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

    see

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • url: string

      sets the URL of the height map image resource

    • width: number

      set the ground width size

    • height: number

      set the ground height size

    • subdivisions: number

      sets the number of subdivision per side

    • minHeight: number

      is the minimum altitude on the ground

    • maxHeight: number

      is the maximum altitude on the ground

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional onReady: function

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

    • Optional alphaFilter: number

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

    Returns GroundMesh

    a new Mesh

Static CreateIcoSphere

Find examples in Playground
  • CreateIcoSphere(name: string, options: object, scene: Scene): Mesh
  • Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided

    • The parameter radius sets the radius size (float) of the icosphere (default 1)
    • You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters radiusX, radiusY and radiusZ (all by default have the same value than radius)
    • The parameter subdivisions sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
    • The parameter flat (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
    • You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.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 : 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
    see

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

    Parameters

    • name: string

      defines the name of the mesh

    • options: object

      defines the options used to create the mesh

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

      defines the hosting scene

    Returns Mesh

    a new Mesh

Static CreateLathe

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

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

    • radius: number

      is the radius value of the lathe

    • tessellation: number

      is the side number of the lathe.

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateLines

Find examples in Playground

Static CreatePlane

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

    Parameters

    Returns Mesh

    a new Mesh

Static CreatePolygon

Find examples in Playground
  • CreatePolygon(name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number): Mesh

Static CreatePolyhedron

Find examples in Playground
  • 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
    • 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 : 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

      defines the name of the mesh to create

    • options: object

      defines the options used to create the mesh

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

      defines the hosting scene

    Returns Mesh

    a new Mesh

Static CreateRibbon

Find examples in Playground
  • 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

    see

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • pathArray: Vector3[][]

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

    • closeArray: boolean | undefined

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

    • closePath: boolean

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

    • offset: number

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

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

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

    Returns Mesh

    a new Mesh

Static CreateSphere

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • segments: number

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

    • diameter: number

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

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateTiledGround

Find examples in Playground
  • 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

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

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

      • h: number
      • w: number
    • precision: object

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

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

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    Returns Mesh

    a new Mesh

Static CreateTorus

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • diameter: number

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

    • thickness: number

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

    • tessellation: number

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

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateTorusKnot

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • radius: number

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

    • tube: number

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

    • radialSegments: number

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

    • tubularSegments: number

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

    • p: number

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

    • q: number

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

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

Static CreateTube

Find examples in Playground
  • 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. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead

    see

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • path: Vector3[]

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

    • radius: number

      sets the tube radius size

    • tessellation: number

      is the number of sides on the tubular surface

    • radiusFunction: function

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

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

          • i: number
          • distance: number

          Returns number

    • cap: number

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

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

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

    Returns Mesh

    a new Mesh

Static ExtrudePolygon

Find examples in Playground
  • ExtrudePolygon(name: string, shape: Vector3[], depth: number, scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number): Mesh

Static ExtrudeShape

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

    see

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

    see

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

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

    • path: Vector3[]

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

    • scale: number

      is the value to scale the shape

    • rotation: number

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

    • cap: number

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

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

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

    Returns Mesh

    a new Mesh

Static ExtrudeShapeCustom

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

    see

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

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

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

    • path: Vector3[]

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

    • scaleFunction: Function

      is a custom Javascript function called on each path point

    • rotationFunction: Function

      is a custom Javascript function called on each path point

    • ribbonCloseArray: boolean

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

    • ribbonClosePath: boolean

      forces the extrusion underlying ribbon to close its pathArray

    • cap: number

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

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

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

    Returns Mesh

    a new Mesh

Static MergeMeshes

Find examples in Playground
  • 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>

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

    • Optional disposeSource: boolean

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

    • Optional allow32BitsIndices: boolean

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

    • Optional meshSubclass: Mesh

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

    • Optional subdivideWithSubMeshes: boolean

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

    Returns Nullable<Mesh>

    a new mesh

Static MinMax

Find examples in Playground
  • 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

    Returns object

    an object {min: Vector3, max: Vector3}

Static Parse

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

    Parameters

    • parsedMesh: any

      is the source

    • scene: Scene

      defines the hosting scene

    • rootUrl: string

      is the root URL to prefix the delayLoadingFile property with

    Returns Mesh

    a new Mesh

Static ParseAnimationRanges

Find examples in Playground
  • 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