|
@@ -90,15 +90,15 @@
|
|
points = [Vector3.Zero(), Vector3.Zero()];
|
|
points = [Vector3.Zero(), Vector3.Zero()];
|
|
this._debugLines[boneNum] = points;
|
|
this._debugLines[boneNum] = points;
|
|
}
|
|
}
|
|
- this._getBonePosition(points[0], childBone, meshMat);
|
|
|
|
- this._getBonePosition(points[1], parentBone, meshMat);
|
|
|
|
|
|
+ childBone.getAbsolutePositionToRef(this.mesh, points[0]);
|
|
|
|
+ parentBone.getAbsolutePositionToRef(this.mesh, points[1]);
|
|
boneNum++;
|
|
boneNum++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public update() {
|
|
public update() {
|
|
if (this.autoUpdateBonesMatrices) {
|
|
if (this.autoUpdateBonesMatrices) {
|
|
- this._updateBoneMatrix(this.skeleton.bones[0]);
|
|
|
|
|
|
+ this.skeleton.computeAbsoluteTransforms();
|
|
}
|
|
}
|
|
|
|
|
|
if (this.skeleton.bones[0].length === undefined) {
|
|
if (this.skeleton.bones[0].length === undefined) {
|
|
@@ -116,19 +116,6 @@
|
|
this._debugMesh.color = this.color;
|
|
this._debugMesh.color = this.color;
|
|
}
|
|
}
|
|
|
|
|
|
- private _updateBoneMatrix(bone: Bone) {
|
|
|
|
- if (bone.getParent()) {
|
|
|
|
- bone.getLocalMatrix().multiplyToRef(bone.getParent().getAbsoluteTransform(), bone.getAbsoluteTransform());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var children = bone.children;
|
|
|
|
- var len = children.length;
|
|
|
|
-
|
|
|
|
- for (var i = 0; i < len; i++) {
|
|
|
|
- this._updateBoneMatrix(children[i]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public dispose() {
|
|
public dispose() {
|
|
if (this._debugMesh) {
|
|
if (this._debugMesh) {
|
|
this.isEnabled = false;
|
|
this.isEnabled = false;
|