SkinnedMesh Class

Extends SkinnedMesh
Module: Meshes

SkinnedMesh is a Mesh that has a Skeleton attached.

A skeleton contains bones that are used to animate the vertices of the geometry.

Based on THREE.SkinnedMesh documentation for the object can be found at https://threejs.org/docs/index.html#Reference/Objects/SkinnedMesh

Constructor

SkinnedMesh

(
  • geometry
  • material
)

Parameters:

  • geometry Geometry

    Geometry used by this mesh

  • material Material

    Material used to shade the superficie of the geometry

Methods

bind

(
  • skeleton
  • bindMatrix
)

Bind a skeleton to this SkinnedMesh. The bindMatrix gets saved to .bindMatrix property and the .bindMatrixInverse gets calculated.

This is called automatically in the constructor, and the skeleton is created from the bones of the Geometry passed in the constructor.

Parameters:

dispose

()

Dispose mesh along with its material and geometry.

initialize

()

Initialize the skinned mesh object, play initial animation.

onBeforeRender

()

Update skinned mesh animation if there is some attached.

setAnimtion

(
  • index
  • loop
)

Play animation attached to this skinned mesh.

Animations rely on other objects, if some of these are missing the animation will have problems playing.

Parameters:

  • index Number

    Index of the animation to play.

  • loop Number

    Loop mode to use (LoopOnce, LoopRepeat, LoopPingPong)

stopAnimation

()

Stop all animations playback.

toJSON

(
  • meta
)

Serialize skinned mesh to json.

Parameters:

  • meta Object

    Metadata

Properties

animations

Array

Array with the animations available in this mesh.

The AnimationClip object has name, tracks, duration and uuid.

bones

Array

Array with the bones attached to this mesh.

drawMode

Unknown

Determines how the mesh triangles are constructed from the vertices.

Only works when the geometry is a BufferGeometry.

Default: TrianglesDrawMode

geometry

Geometry

Geometry defined the object structure.

material

Material

Material is used to define how the geometry surface is shaded.