SubMesh

Defines a subdivision inside a mesh

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground
  • new SubMesh(materialIndex: number, verticesStart: number, verticesCount: number, indexStart: number, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh, createBoundingBox?: boolean): SubMesh
  • Creates a new submesh

    Parameters

    • materialIndex: number

      defines the material index to use

    • verticesStart: number

      defines vertex index start

    • verticesCount: number

      defines vertices count

    • indexStart: number

      defines index start

    • indexCount: number

      defines indices count

    • mesh: AbstractMesh

      defines the parent mesh

    • Optional renderingMesh: Mesh

      defines an optional rendering mesh

    • Optional createBoundingBox: boolean

      defines if bounding box should be created for this submesh

    Returns SubMesh

Properties

IsGlobal

Find examples in Playground
IsGlobal: boolean

Returns true if this submesh covers the entire parent mesh

ignorenaming

effect

Find examples in Playground
effect: Nullable<Effect>

Gets associated effect

indexCount

Find examples in Playground
indexCount: number

indices count

indexStart

Find examples in Playground
indexStart: number

index start

materialIndex

Find examples in Playground
materialIndex: number

the material index to use

verticesCount

Find examples in Playground
verticesCount: number

vertices count

verticesStart

Find examples in Playground
verticesStart: number

vertex index start

Methods

canIntersects

Find examples in Playground
  • canIntersects(ray: Ray): boolean
  • Checks if the submesh intersects with a ray

    Parameters

    • ray: Ray

      defines the ray to test

    Returns boolean

    true is the passed ray intersects the submesh bounding box

clone

Find examples in Playground
  • Creates a new submesh from the passed mesh

    Parameters

    • newMesh: AbstractMesh

      defines the new hosting mesh

    • Optional newRenderingMesh: Mesh

      defines an optional rendering mesh

    Returns SubMesh

    the new submesh

dispose

Find examples in Playground
  • dispose(): void
  • Release associated resources

    Returns void

getBoundingInfo

Find examples in Playground
  • Returns the submesh BoudingInfo object

    Returns BoundingInfo

    current bounding info (or mesh's one if the submesh is global)

getMaterial

Find examples in Playground
  • Returns the submesh material

    Returns Nullable<Material>

    null or the current material

getMesh

Find examples in Playground
  • Returns the mesh of the current submesh

    Returns AbstractMesh

    the parent mesh

getRenderingMesh

Find examples in Playground
  • getRenderingMesh(): Mesh
  • Returns the rendering mesh of the submesh

    Returns Mesh

    the rendering mesh (could be different from parent mesh)

intersects

Find examples in Playground
  • Intersects current submesh with a ray

    Parameters

    • ray: Ray

      defines the ray to test

    • positions: Vector3[]

      defines mesh's positions array

    • indices: IndicesArray

      defines mesh's indices array

    • Optional fastCheck: boolean

      defines if only bounding info should be used

    Returns Nullable<IntersectionInfo>

    intersection info or null if no intersection

isCompletelyInFrustum

Find examples in Playground
  • isCompletelyInFrustum(frustumPlanes: Plane[]): boolean
  • True is the submesh bounding box is completely inside the frustum defined by the passed array of planes

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum planes

    Returns boolean

    true if the submesh is inside the frustum

isInFrustum

Find examples in Playground
  • isInFrustum(frustumPlanes: Plane[]): boolean
  • True is the submesh bounding box intersects the frustum defined by the passed array of planes.

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum planes

    Returns boolean

    true if the submesh is intersecting with the frustum

refreshBoundingInfo

Find examples in Playground
  • Sets a new updated BoundingInfo object to the submesh

    Returns SubMesh

    the SubMesh

render

Find examples in Playground
  • render(enableAlphaMode: boolean): SubMesh
  • Renders the submesh

    Parameters

    • enableAlphaMode: boolean

      defines if alpha needs to be used

    Returns SubMesh

    the submesh

setBoundingInfo

Find examples in Playground
  • Sets the submesh BoundingInfo

    Parameters

    • boundingInfo: BoundingInfo

      defines the new bounding info to use

    Returns SubMesh

    the SubMesh

setEffect

Find examples in Playground

updateBoundingInfo

Find examples in Playground
  • Updates the submesh BoundingInfo

    Parameters

    Returns SubMesh

    the submesh

Static AddToMesh

Find examples in Playground
  • AddToMesh(materialIndex: number, verticesStart: number, verticesCount: number, indexStart: number, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh, createBoundingBox?: boolean): SubMesh
  • Add a new submesh to a mesh

    Parameters

    • materialIndex: number

      defines the material index to use

    • verticesStart: number

      defines vertex index start

    • verticesCount: number

      defines vertices count

    • indexStart: number

      defines index start

    • indexCount: number

      defines indices count

    • mesh: AbstractMesh

      defines the parent mesh

    • Optional renderingMesh: Mesh

      defines an optional rendering mesh

    • Optional createBoundingBox: boolean

      defines if bounding box should be created for this submesh

    Returns SubMesh

    the new submesh

Static CreateFromIndices

Find examples in Playground
  • CreateFromIndices(materialIndex: number, startIndex: number, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh): SubMesh
  • Creates a new submesh from indices data

    Parameters

    • materialIndex: number

      the index of the main mesh material

    • startIndex: number

      the index where to start the copy in the mesh indices array

    • indexCount: number

      the number of indices to copy then from the startIndex

    • mesh: AbstractMesh

      the main mesh to create the submesh from

    • Optional renderingMesh: Mesh

      the optional rendering mesh

    Returns SubMesh

    a new submesh

Generated using TypeDoc