Преглед изворни кода

Gravity is optional

The Scene's "enablePhysics" does not require the gravity, there is a
default value at the setGravity function of the physics engine.
Raanan Weber пре 9 година
родитељ
комит
fcfe56c944
1 измењених фајлова са 7 додато и 1 уклоњено
  1. 7 1
      src/babylon.scene.ts

+ 7 - 1
src/babylon.scene.ts

@@ -2272,7 +2272,13 @@
             return this._physicsEngine;
         }
 
-        public enablePhysics(gravity: Vector3, plugin?: IPhysicsEnginePlugin): boolean {
+        /**
+         * Enables physics to the current scene
+         * @param {BABYLON.Vector3} [gravity] - the scene's gravity for the physics engine
+         * @param {BABYLON.IPhysicsEnginePlugin} [plugin] - The physics engine to be used. defaults to OimoJS.
+         * @return {boolean} was the physics engine initialized
+         */
+        public enablePhysics(gravity?: Vector3, plugin?: IPhysicsEnginePlugin): boolean {
             if (this._physicsEngine) {
                 return true;
             }