Capítulo 13 de 859
A mesh that has a Skeleton that can then be used to animate the vertices of the geometry with skinning/skeleton animation.
Next to a valid skeleton, the skinned mesh requires skin indices and weights as buffer attributes in its geometry. These attribute define which bones affect a single vertex to a certain extend.
Typically skinned meshes are not created manually but loaders like GLTFLoader or FBXLoader import respective models.
AttachedBindMode means the skinned mesh shares the same world space as the skeleton. This is not true when using DetachedBindMode which…Constructor
| Signature |
|---|
| `new SkinnedMesh( geometry : BufferGeometry, material : Material |
Properties
| Property | Description |
|---|---|
.bindMatrix : Matrix4 | The base matrix that is used for the bound bone transforms. |
.bindMatrixInverse : Matrix4 | The base matrix that is used for resetting the bound bone transforms. |
| `.bindMode : AttachedBindMode | DetachedBindMode` |
.boundingBox : Box3 | The bounding box of the skinned mesh. Can be computed via SkinnedMesh#computeBoundingBox. |
.boundingSphere : Sphere | The bounding sphere of the skinned mesh. Can be computed via SkinnedMesh#computeBoundingSphere. |
.isSkinnedMesh : boolean (readonly) | This flag can be used for type testing. |
Methods
| Method | Description |
|---|---|
| `.applyBoneTransform( index : number, target : Vector3 | Vector4 ) : Vector3 |
.bind( skeleton : Skeleton, bindMatrix : Matrix4 ) | Binds the given skeleton to the skinned mesh. |
.computeBoundingBox() | Computes the bounding box of the skinned mesh, and updates SkinnedMesh#boundingBox. The bounding box is not automatically computed by the engine; this method must be c… |
.computeBoundingSphere() | Computes the bounding sphere of the skinned mesh, and updates SkinnedMesh#boundingSphere. The bounding sphere is automatically computed by the engine once when it i… |
.normalizeSkinWeights() | Normalizes the skin weights which are defined as a buffer attribute in the skinned mesh's geometry. |
.pose() | This method sets the skinned mesh in the rest pose). |