|
@@ -39,7 +39,7 @@ export var _BabylonLoaderRegistered = true;
|
|
|
* Unfortunately in ES6, we need to manually inject them into the plugin.
|
|
|
* So you could set this variable to your engine import to make it work.
|
|
|
*/
|
|
|
-export var PhysicsEngine: any = undefined;
|
|
|
+export var LoaderInjectedPhysicsEngine: any = undefined;
|
|
|
|
|
|
var parseMaterialById = (id: string, parsedData: any, scene: Scene, rootUrl: string) => {
|
|
|
for (var index = 0, cache = parsedData.materials.length; index < cache; index++) {
|
|
@@ -710,11 +710,11 @@ SceneLoader.RegisterPlugin({
|
|
|
if (parsedData.physicsEnabled) {
|
|
|
var physicsPlugin;
|
|
|
if (parsedData.physicsEngine === "cannon") {
|
|
|
- physicsPlugin = new CannonJSPlugin(undefined, undefined, PhysicsEngine);
|
|
|
+ physicsPlugin = new CannonJSPlugin(undefined, undefined, LoaderInjectedPhysicsEngine);
|
|
|
} else if (parsedData.physicsEngine === "oimo") {
|
|
|
- physicsPlugin = new OimoJSPlugin(undefined, PhysicsEngine);
|
|
|
+ physicsPlugin = new OimoJSPlugin(undefined, LoaderInjectedPhysicsEngine);
|
|
|
} else if (parsedData.physicsEngine === "ammo") {
|
|
|
- physicsPlugin = new AmmoJSPlugin(undefined, PhysicsEngine, undefined);
|
|
|
+ physicsPlugin = new AmmoJSPlugin(undefined, LoaderInjectedPhysicsEngine, undefined);
|
|
|
}
|
|
|
log = "\tPhysics engine " + (parsedData.physicsEngine ? parsedData.physicsEngine : "oimo") + " enabled\n";
|
|
|
//else - default engine, which is currently oimo
|