new ModelInstance(model, materials)
Parameters:
Name | Type | Description |
---|---|---|
model |
The |
|
materials |
Either a single |
Properties:
Name | Type | Description |
---|---|---|
model |
Model | The model to use as the geometry |
castShadows |
boolean | Defines whether or not this ModelInstance should cast shadows. |
numMeshInstances |
number | The amount of MeshInstance objects. |
skeleton |
Skeleton | The skeleton used for skinning animations. |
skeletonPose |
SkeletonPose | The SkeletonPose object defining the current local skeleton state. |
morphPose |
MorphPose | The MorphPose object defining the current morph target state. |
Extends
Methods
-
addComponent()
-
Adds a single
Component
object to the Entity.- Inherited From:
-
addComponents(components)
-
Adds multiple
Component
objects to the Entity.Parameters:
Name Type Description components
Array An array of components to add.
- Inherited From:
-
assignMaterial()
-
Forces all MeshInstances in the ModelInstance to use the material.
-
destroy()
-
- Inherited From:
-
getComponentsByType()
-
Returns an array of all Components with a given type.
- Inherited From:
-
getMeshInstance()
-
Gets the
MeshInstance
at the given index. -
hasComponentType()
-
Returns whether or not the Entity has a component of a given type assigned to it.
- Inherited From:
-
init(model, materials)
-
Init allows us to leave the constructor empty and initialize the model lazily.
Parameters:
Name Type Description model
The
Model
to use as the geometrymaterials
Either a single
Material
to link to all Meshes in the Model, or an array of materials to link to the meshes in respective order. -
removeComponent()
-
Removes a single Component from the Entity.
- Inherited From:
-
removeComponents(components)
-
Removes multiple
Component
objects from the Entity.Parameters:
Name Type Description components
Array A list of components to remove.
- Inherited From: