|
@@ -1,7 +1,9 @@
|
|
module BABYLON {
|
|
module BABYLON {
|
|
export interface IPhysicsEnginePlugin {
|
|
export interface IPhysicsEnginePlugin {
|
|
|
|
+ name: string;
|
|
initialize(iterations?: number);
|
|
initialize(iterations?: number);
|
|
setGravity(gravity: Vector3): void;
|
|
setGravity(gravity: Vector3): void;
|
|
|
|
+ getGravity() : Vector3;
|
|
runOneStep(delta: number): void;
|
|
runOneStep(delta: number): void;
|
|
registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
@@ -54,6 +56,10 @@
|
|
this.gravity = gravity || new Vector3(0, -9.807, 0);
|
|
this.gravity = gravity || new Vector3(0, -9.807, 0);
|
|
this._currentPlugin.setGravity(this.gravity);
|
|
this._currentPlugin.setGravity(this.gravity);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public _getGravity() : Vector3 {
|
|
|
|
+ return this._currentPlugin.getGravity();
|
|
|
|
+ }
|
|
|
|
|
|
public _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any {
|
|
public _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any {
|
|
return this._currentPlugin.registerMesh(mesh, impostor, options);
|
|
return this._currentPlugin.registerMesh(mesh, impostor, options);
|
|
@@ -90,6 +96,10 @@
|
|
public getPhysicsBodyOfMesh(mesh: AbstractMesh) {
|
|
public getPhysicsBodyOfMesh(mesh: AbstractMesh) {
|
|
return this._currentPlugin.getPhysicsBodyOfMesh(mesh);
|
|
return this._currentPlugin.getPhysicsBodyOfMesh(mesh);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public getPhysicsPluginName() : string {
|
|
|
|
+ return this._currentPlugin.name;
|
|
|
|
+ }
|
|
|
|
|
|
// Statics
|
|
// Statics
|
|
public static NoImpostor = 0;
|
|
public static NoImpostor = 0;
|