|
@@ -355,7 +355,7 @@
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
- public attachToMesh(mesh:AbstractMesh, meshSpaceDirection:Vector3, meshSpaceOrigin:Vector3, length?:number): void{
|
|
|
|
|
|
+ public attachToMesh(mesh:AbstractMesh, meshSpaceDirection?:Vector3, meshSpaceOrigin?:Vector3, length?:number): void{
|
|
|
|
|
|
this._attachedToMesh = mesh;
|
|
this._attachedToMesh = mesh;
|
|
|
|
|
|
@@ -371,6 +371,15 @@
|
|
this.length = length;
|
|
this.length = length;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(!meshSpaceOrigin){
|
|
|
|
+ meshSpaceOrigin = Vector3.Zero();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(!meshSpaceDirection){
|
|
|
|
+ // -1 so that this will work with Mesh.lookAt
|
|
|
|
+ meshSpaceDirection = new Vector3(0, 0, -1);
|
|
|
|
+ }
|
|
|
|
+
|
|
if(!this._meshSpaceDirection){
|
|
if(!this._meshSpaceDirection){
|
|
this._meshSpaceDirection = meshSpaceDirection.clone();
|
|
this._meshSpaceDirection = meshSpaceDirection.clone();
|
|
this._meshSpaceOrigin = meshSpaceOrigin.clone();
|
|
this._meshSpaceOrigin = meshSpaceOrigin.clone();
|