|
@@ -418,6 +418,8 @@ module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
this._tickCallback = this._tick.bind(this);
|
|
this._tickCallback = this._tick.bind(this);
|
|
|
|
+
|
|
|
|
+ this._prepareCylinder();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -452,6 +454,9 @@ module BABYLON {
|
|
* @param force Specifies if the updraft should be disposed by force
|
|
* @param force Specifies if the updraft should be disposed by force
|
|
*/
|
|
*/
|
|
public dispose(force: boolean = true) {
|
|
public dispose(force: boolean = true) {
|
|
|
|
+ if (!this._cylinder) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (force) {
|
|
if (force) {
|
|
this._cylinder.dispose();
|
|
this._cylinder.dispose();
|
|
} else {
|
|
} else {
|
|
@@ -513,8 +518,6 @@ module BABYLON {
|
|
private _intersectsWithCylinder(impostor: PhysicsImpostor): boolean {
|
|
private _intersectsWithCylinder(impostor: PhysicsImpostor): boolean {
|
|
var impostorObject = <AbstractMesh>impostor.object;
|
|
var impostorObject = <AbstractMesh>impostor.object;
|
|
|
|
|
|
- this._prepareCylinder();
|
|
|
|
-
|
|
|
|
this._cylinder.position = this._cylinderPosition;
|
|
this._cylinder.position = this._cylinderPosition;
|
|
|
|
|
|
return this._cylinder.intersectsMesh(impostorObject, true);
|
|
return this._cylinder.intersectsMesh(impostorObject, true);
|
|
@@ -552,6 +555,8 @@ module BABYLON {
|
|
this._origin.addToRef(new Vector3(0, this._height, 0), this._originTop);
|
|
this._origin.addToRef(new Vector3(0, this._height, 0), this._originTop);
|
|
|
|
|
|
this._tickCallback = this._tick.bind(this);
|
|
this._tickCallback = this._tick.bind(this);
|
|
|
|
+
|
|
|
|
+ this._prepareCylinder();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -671,8 +676,6 @@ module BABYLON {
|
|
private _intersectsWithCylinder(impostor: PhysicsImpostor): boolean {
|
|
private _intersectsWithCylinder(impostor: PhysicsImpostor): boolean {
|
|
var impostorObject = <AbstractMesh>impostor.object;
|
|
var impostorObject = <AbstractMesh>impostor.object;
|
|
|
|
|
|
- this._prepareCylinder();
|
|
|
|
-
|
|
|
|
this._cylinder.position = this._cylinderPosition;
|
|
this._cylinder.position = this._cylinderPosition;
|
|
|
|
|
|
return this._cylinder.intersectsMesh(impostorObject, true);
|
|
return this._cylinder.intersectsMesh(impostorObject, true);
|