|
@@ -3282,7 +3282,9 @@
|
|
private _binormals = new Array<Vector3>();
|
|
private _binormals = new Array<Vector3>();
|
|
|
|
|
|
constructor(public path: Vector3[], firstNormal?: Vector3) {
|
|
constructor(public path: Vector3[], firstNormal?: Vector3) {
|
|
- this._copyPath(path);
|
|
|
|
|
|
+ for (var p = 0; p < path.length; p++) {
|
|
|
|
+ this._curve[p] = path[p].clone(); // hard copy
|
|
|
|
+ }
|
|
this._compute(firstNormal);
|
|
this._compute(firstNormal);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3307,17 +3309,15 @@
|
|
}
|
|
}
|
|
|
|
|
|
public update(path: Vector3[], firstNormal?: Vector3): Path3D {
|
|
public update(path: Vector3[], firstNormal?: Vector3): Path3D {
|
|
- this._copyPath(path);
|
|
|
|
|
|
+ for (var p = 0; p < path.length; p++) {
|
|
|
|
+ this._curve[p].x = path[p].x;
|
|
|
|
+ this._curve[p].y = path[p].y;
|
|
|
|
+ this._curve[p].z = path[p].z;
|
|
|
|
+ }
|
|
this._compute(firstNormal);
|
|
this._compute(firstNormal);
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
- private _copyPath(path: Vector3[]) {
|
|
|
|
- for (var p = 0; p < path.length; p++) {
|
|
|
|
- this._curve[p] = path[p].clone(); // hard copy
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// private function compute() : computes tangents, normals and binormals
|
|
// private function compute() : computes tangents, normals and binormals
|
|
private _compute(firstNormal) {
|
|
private _compute(firstNormal) {
|
|
var l = this._curve.length;
|
|
var l = this._curve.length;
|