|
@@ -4,6 +4,7 @@ var BABYLON;
|
|
function CannonJSPlugin() {
|
|
function CannonJSPlugin() {
|
|
this._registeredMeshes = [];
|
|
this._registeredMeshes = [];
|
|
this._physicsMaterials = [];
|
|
this._physicsMaterials = [];
|
|
|
|
+ this.name = "cannon";
|
|
this.updateBodyPosition = function (mesh) {
|
|
this.updateBodyPosition = function (mesh) {
|
|
for (var index = 0; index < this._registeredMeshes.length; index++) {
|
|
for (var index = 0; index < this._registeredMeshes.length; index++) {
|
|
var registeredMesh = this._registeredMeshes[index];
|
|
var registeredMesh = this._registeredMeshes[index];
|
|
@@ -89,8 +90,12 @@ var BABYLON;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
CannonJSPlugin.prototype.setGravity = function (gravity) {
|
|
CannonJSPlugin.prototype.setGravity = function (gravity) {
|
|
|
|
+ this._gravity = gravity;
|
|
this._world.gravity.set(gravity.x, gravity.y, gravity.z);
|
|
this._world.gravity.set(gravity.x, gravity.y, gravity.z);
|
|
};
|
|
};
|
|
|
|
+ CannonJSPlugin.prototype.getGravity = function () {
|
|
|
|
+ return this._gravity;
|
|
|
|
+ };
|
|
CannonJSPlugin.prototype.registerMesh = function (mesh, impostor, options) {
|
|
CannonJSPlugin.prototype.registerMesh = function (mesh, impostor, options) {
|
|
this.unregisterMesh(mesh);
|
|
this.unregisterMesh(mesh);
|
|
if (!mesh.rotationQuaternion) {
|
|
if (!mesh.rotationQuaternion) {
|