@@ -34,19 +34,20 @@ <h2>Example</h2>
3434 }
3535
3636 var mesh = THREE.SkinnedMesh( geometry, material );
37-
37+
3838 // See example from THREE.Skeleton for the armSkeleton
39+ var rootBone = armSkeleton.bones[0];
40+ mesh.add( rootBone );
41+
42+ // Bind the skeleton to the mesh
3943 mesh.bind( armSkeleton );
4044
41- // Add the root bone, then recalculate the skeleton inverses
42- mesh.add( armSkeleton.bones[0] );
43- mesh.updateMatrixWorld( true ); // ensure the bones matrices are already recomputed
45+ // Update the inverse matrices in the skeleton to reflect the newly bound skeleton
4446 skeleton.calculateInverses();
4547
4648 // Move the bones and manipulate the model
4749 armSkeleton.bones[0].rotation.x = -0.1;
4850 armSkeleton.bones[1].rotation.x = 0.2;
49-
5051 </ code >
5152
5253
@@ -55,16 +56,15 @@ <h2>Constructor</h2>
5556
5657 < h3 > [name]([page:Geometry geometry], [page:Material material], [page:boolean useVertexTexture])</ h3 >
5758 < div >
58- geometry —- An instance of [page:Geometry]. [page:Geometry.skinIndices] and [page:Geometry.skinWeights] should be set.< br />
59- material —- An instance of [page:Material] (optional).< br />
59+ geometry — An instance of [page:Geometry]. [page:Geometry.skinIndices] and [page:Geometry.skinWeights] should be set.< br />
60+ material — An instance of [page:Material] (optional).< br />
6061 useVertexTexture -- Defines whether a vertex texture can be used (optional).
6162 </ div >
6263
6364
6465 < h2 > Properties</ h2 >
6566
6667
67-
6868 < h3 > [property:array bones]</ h3 >
6969 < div >
7070 This contains the array of bones for this mesh. These should be set in the constructor.
@@ -85,19 +85,50 @@ <h3>[property:array boneMatrices]</h3>
8585 This array of matrices contains the matrices of the bones. These get calculated in the constructor.
8686 </ div >
8787
88+ < h3 > [property:string bindMode]</ h3 >
89+ < div >
90+ Either "attached" or "detached". "attached" uses the [page:SkinnedMesh.matrixWorld] property for the base transform
91+ matrix of the bones. "detached" uses the [page:SkinnedMesh.bindMatrix].
92+ </ div >
93+
94+ < h3 > [property:Matrix4 bindMatrix]</ h3 >
95+ < div >
96+ The base matrix that is used for the bound bone transforms.
97+ </ div >
98+
99+ < h3 > [property:Matrix4 inverseBindMatrix]</ h3 >
100+ < div >
101+ The inverse of the bindMatrix.
102+ </ div >
103+
88104 < h2 > Methods</ h2 >
89105
106+ < h3 > [method:null bind]([page:Skeleton skeleton], [page:Matrix4 bindMatrix])</ h3 >
107+ < div >
108+ skeleton — [page:Skeleton]< br />
109+ bindMatrix — [page:Matrix4] that represents the base transform of the skeleton
110+ </ div >
111+ < div >
112+ Bind a skeleton to the skinned mesh. The bindMatrix gets saved to .bindMatrix property and the .bindMatrixInverse
113+ gets calculated.
114+ </ div >
115+
116+ < h3 > [method:null normalizeSkinWeights]()</ h3 >
117+ < div >
118+ Normalizes the [page:Geometry.skinWeights] vectors. Does not affect [page:BufferGeometry].
119+ </ div >
120+
90121 < h3 > [method:null pose]()</ h3 >
91122 < div >
92- This method sets the skinnedmesh in the rest pose.
123+ This method sets the skinned mesh in the rest pose.
93124 </ div >
94125
95126 < h3 > [method:Bone addBone]([page:Bone bone])</ h3 >
96127 < div >
97- bone -- This is the bone that needs to be added. (optional)
128+ bone — This is the bone that needs to be added. (optional)
98129 </ div >
99130 < div >
100- This method adds the bone to the skinnedmesh when it is provided. It creates a new bone and adds that when no bone is given.
131+ This method adds the bone to the skinned mesh when it is provided. It creates a new bone and adds that when no bone is given.
101132 </ div >
102133
103134 < h2 > Source</ h2 >
0 commit comments