CLASSES
TagsA - Z

InstancedMesh

NodeMesh

Description

class InstancedMesh extends AbstractMesh

Creates an instance based on a source mesh.

Constructor

new InstancedMesh(name, source)

The InstancedMesh constructor

Parameters

Name Type Description
name string The given name
source Mesh @param source

Members

receiveShadows : boolean

True if the Instanced Mesh got shadows, false if is not

material : Material

The material

visibility : number

The visibility of the Instanced Mesh

skeleton : Skeleton

The skeleton

renderingGroupId : number

sourceMesh : Mesh

The sourceMesh

Float32Array : undefined

Methods

getClassName() → string

Returns the string "InstancedMesh".

getTotalVertices() → number

Returns the total number of vertices (integer).

getVerticesData(kind, copyWhenShared) → number[]

Returns a float array or a Float32Array of the requested kind of data : positons, normals, uvs, etc.

Parameters

Name Type Description
kind string @param kind
optional copyWhenShared boolean

setVerticesData(kind, data, Float32Array, updatable, stride) → Mesh

Sets the vertex data of the mesh geometry for the requested kind.

If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.

The data are either a numeric array either a Float32Array.

The parameter updatable is passed as is to the underlying Geometry object constructor (if initianilly none) or updater.

The parameter stride is an optional positive integer, it is usually automatically deducted from the kind (3 for positions or normals, 2 for UV, etc).

Note that a new underlying VertexBuffer object is created each call.

If the kind is the PositionKind, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.

     * Possible `kind` values :

Parameters

Name Type Description
kind string @param kind
data number[] or Float32Array
optional updatable boolean

updateVerticesData(kind, data, Float32Array, updateExtends, makeItUnique) → Mesh

Updates the existing vertex data of the mesh geometry for the requested kind.

If the mesh has no geometry, it is simply returned as it is.

The data are either a numeric array either a Float32Array.

No new underlying VertexBuffer object is created.

If the kind is the PositionKind and if updateExtends is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.

If the parameter makeItUnique is true, a new global geometry is created from this positions and is set to the mesh.

     * Possible `kind` values :

Parameters

Name Type Description
kind string @param kind
data number[] or Float32Array
optional updateExtends boolean

setIndices(indices, totalVertices) → Mesh

Sets the mesh indices.

Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array).

If the mesh has no geometry, a new Geometry object is created and set to the mesh.

This method creates a new index buffer each call.

Returns the Mesh.

Parameters

Name Type Description
indices IndicesArray
optional totalVertices number

isVerticesDataPresent(kind) → boolean

Boolean : True if the mesh owns the requested kind of data.

Parameters

Name Type Description
kind string @param kind

getIndices() → IndicesArray

Returns an array of indices (IndicesArray).

refreshBoundingInfo() → InstancedMesh

Sets a new updated BoundingInfo to the mesh.

Returns the mesh.

getLOD(camera) → AbstractMesh

Returns the current associated LOD AbstractMesh.

Parameters

Name Type Description
camera Camera

clone(name, newParent, doNotCloneChildren) → InstancedMesh

Creates a new InstancedMesh from the current mesh.

Parameters

Name Type Description
name string The given name
newParent Node The parent
optional doNotCloneChildren boolean True if you want to clone children, false if you don't want to.

dispose(doNotRecurse) → void

Disposes the InstancedMesh.

Returns nothing.

Parameters

Name Type Description
optional doNotRecurse boolean @param doNotRecurse