Model
class Model
Data class for loaded 3d model
Properties
Methods
constructor
new Model()
Create new Model instance
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
{src: string, scenes: THREE.Object3D[], center?: typeof AUTO | Array<number | string>, parser?: GLTFParser | null, animations?: THREE.AnimationClip[], annotations?: Annotation[], variants?: Array<{name: string}>, fixSkinnedBbox?: boolean, castShadow?: boolean, receiveShadow?: boolean} |
Properties
src
Source URL of this model
Type: string
scene
Scene of the model, see THREE.Group
animations
THREE.AnimationClips inside model
annotations
Annotations included inside the model
meshes
THREE.Meshes inside model if there's any.
bbox
Get a copy of model's current bounding box
Type: THREE#Box3
See:
center
Center of the model
Type: THREE#Vector3
See:
castShadow
Whether the model's meshes gets rendered into shadow map
Type: boolean
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
val | boolean |
model.castShadow = true;
receiveShadow
Whether the model's mesh materials receive shadows
Type: boolean
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
val | boolean |
model.receiveShadow = true;
Methods
reduceVertices
Executes a user-supplied "reducer" callback function on each vertex of the model, in order, passing in the return value from the calculation on the preceding element.
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
callbackfn | (previousVal: T, currentVal: THREE.Vector3) => T | |||
initialVal | T |
_getAllMeshes
Get all THREE.Meshes inside model if there's any.
Returns: THREE.Mesh[]
- Meshes found at model's scene