SubMesh

Mesh

Description

class SubMesh extends BaseSubMesh

Constructor

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

Parameters

Name Type Description
materialIndex number
verticesStart number
verticesCount number
indexStart number
indexCount number
mesh AbstractMesh
optional renderingMesh Mesh

Members

materialIndex : number

verticesStart : number

verticesCount : number

indexStart : number

indexCount : number

linesIndexCount : number

IsGlobal : boolean

Methods

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

Parameters

Name Type Description
materialIndex number
verticesStart number
verticesCount number
indexStart number
indexCount number
mesh AbstractMesh
optional renderingMesh Mesh

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() Nullable<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

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[]

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[]

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
engine Engine

canIntersects(ray) boolean

True is the passed Ray intersects the submesh bounding box.

Boolean returned.

Parameters

Name Type Description
ray Ray

intersects(ray, positions, indices, fastCheck) Nullable<IntersectionInfo>

Returns an object IntersectionInfo.

Parameters

Name Type Description
ray Ray
positions Vector3[]
indices IndicesArray

clone(newMesh, newRenderingMesh) SubMesh

Creates a new Submesh from the passed Mesh.

Parameters

Name Type Description
newMesh AbstractMesh
optional newRenderingMesh Mesh

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
startIndex number
indexCount number
mesh AbstractMesh