|
@@ -64,6 +64,7 @@
|
|
|
|
|
|
private _getLinesForBonesWithLength(bones: Bone[], meshMat: Matrix): void {
|
|
private _getLinesForBonesWithLength(bones: Bone[], meshMat: Matrix): void {
|
|
var len = bones.length;
|
|
var len = bones.length;
|
|
|
|
+ var meshPos = this.mesh.position;
|
|
for (var i = 0; i < len; i++) {
|
|
for (var i = 0; i < len; i++) {
|
|
var bone = bones[i];
|
|
var bone = bones[i];
|
|
var points = this._debugLines[i];
|
|
var points = this._debugLines[i];
|
|
@@ -73,12 +74,15 @@
|
|
}
|
|
}
|
|
this._getBonePosition(points[0], bone, meshMat);
|
|
this._getBonePosition(points[0], bone, meshMat);
|
|
this._getBonePosition(points[1], bone, meshMat, 0, bone.length, 0);
|
|
this._getBonePosition(points[1], bone, meshMat, 0, bone.length, 0);
|
|
|
|
+ points[0].subtractInPlace(meshPos);
|
|
|
|
+ points[1].subtractInPlace(meshPos);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
private _getLinesForBonesNoLength(bones: Bone[], meshMat: Matrix): void {
|
|
private _getLinesForBonesNoLength(bones: Bone[], meshMat: Matrix): void {
|
|
var len = bones.length;
|
|
var len = bones.length;
|
|
var boneNum = 0;
|
|
var boneNum = 0;
|
|
|
|
+ var meshPos = this.mesh.position;
|
|
for (var i = len - 1; i >= 0; i--) {
|
|
for (var i = len - 1; i >= 0; i--) {
|
|
var childBone = bones[i];
|
|
var childBone = bones[i];
|
|
var parentBone = childBone.getParent();
|
|
var parentBone = childBone.getParent();
|
|
@@ -92,6 +96,8 @@
|
|
}
|
|
}
|
|
childBone.getAbsolutePositionToRef(this.mesh, points[0]);
|
|
childBone.getAbsolutePositionToRef(this.mesh, points[0]);
|
|
parentBone.getAbsolutePositionToRef(this.mesh, points[1]);
|
|
parentBone.getAbsolutePositionToRef(this.mesh, points[1]);
|
|
|
|
+ points[0].subtractInPlace(meshPos);
|
|
|
|
+ points[1].subtractInPlace(meshPos);
|
|
boneNum++;
|
|
boneNum++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -113,6 +119,7 @@
|
|
} else {
|
|
} else {
|
|
BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene);
|
|
BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene);
|
|
}
|
|
}
|
|
|
|
+ this._debugMesh.position.copyFrom(this.mesh.position);
|
|
this._debugMesh.color = this.color;
|
|
this._debugMesh.color = this.color;
|
|
}
|
|
}
|
|
|
|
|