CLASSES
TagsA - Z

SubMesh

Mesh

Description

class SubMesh

Constructor

new SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox)

SubMesh constructor

Parameters

Name Type Description
materialIndex number The index of the material to use (this index is used to find the correct material Inside the subMaterials collection of a multi-material)
verticesStart number
verticesCount number The count of vertices used
indexStart any Index of the first indice to use
indexCount number The indices count
mesh AbstractMesh @param mesh
optional renderingMesh Mesh If defined, is used instead of the mesh parameter.

Members

materialIndex : number

The material Index

verticesStart : number

The vertice sStart

verticesCount : number

The vertices Count

indexStart : any

The index Start

indexCount : number

The index Count

linesIndexCount : number

The lines Index Count

effect : Effect

IsGlobal : boolean

Methods

setEffect(effect, defines) → void

Parameters

Name Type Description
effect Effect
optional defines MaterialDefines

getBoundingInfo() → BoundingInfo

Returns the submesh BoudingInfo object.

setBoundingInfo(boundingInfo) → SubMesh

Sets the submesh BoundingInfo.

Return the SubMesh.

Parameters

Name Type Description
boundingInfo BoundingInfo

getMesh() → AbstractMesh

Returns the mesh of the current submesh.

getRenderingMesh() → Mesh

Returns the rendering mesh of the submesh.

getMaterial() → Material

Returns the submesh material.

refreshBoundingInfo() → SubMesh

Sets a new updated BoundingInfo object to the submesh.

Returns the SubMesh.

updateBoundingInfo(world) → SubMesh

Updates the submesh BoundingInfo.

Returns the Submesh.

Parameters

Name Type Description
world Matrix @param world

isInFrustum(frustumPlanes) → boolean

True is the submesh bounding box intersects the frustum defined by the passed array of planes.

Boolean returned.

Parameters

Name Type Description
frustumPlanes Plane[] @param frustumPlanes

isCompletelyInFrustum(frustumPlanes) → boolean

True is the submesh bounding box is completely inside the frustum defined by the passed array of planes.

Boolean returned.

Parameters

Name Type Description
frustumPlanes Plane[] @param frustumPlanes

render(enableAlphaMode) → SubMesh

Renders the submesh.

Returns it.

Parameters

Name Type Description
enableAlphaMode boolean

getLinesIndexBuffer(indices, engine) → WebGLBuffer

Returns a new Index Buffer.

Type returned : WebGLBuffer.

Parameters

Name Type Description
indices IndicesArray @param indices
engine Engine @param engine

canIntersects(ray) → boolean

True is the passed Ray intersects the submesh bounding box.

Boolean returned.

Parameters

Name Type Description
ray Ray The ray

intersects(ray, positions, indices, fastCheck) → IntersectionInfo

Returns an object IntersectionInfo.

Parameters

Name Type Description
ray Ray The ray
positions Vector3[] @param positions
indices IndicesArray @param indices

clone(newMesh, newRenderingMesh) → SubMesh

Creates a new Submesh from the passed Mesh.

Parameters

Name Type Description
newMesh AbstractMesh @param newMesh
optional newRenderingMesh Mesh @param newRenderingMesh

dispose() → void

Disposes the Submesh.

Returns nothing.

static CreateFromIndices(materialIndex, startIndex, indexCount, mesh, renderingMesh) → SubMesh

Creates a new Submesh from the passed parameters :

Parameters

Name Type Description
materialIndex number The index of the material to use (this index is used to find the correct material Inside the subMaterials collection of a multi-material)
startIndex number Index of the first indice to use
indexCount number The indices count
mesh AbstractMesh @param mesh