Trevor Baron 6 yıl önce
ebeveyn
işleme
0cc6d19905

+ 1 - 0
dist/preview release/what's new.md

@@ -145,6 +145,7 @@
 - Fix case sensitive paths ([mrdunk](https://github.com))
 - Attaching a BoundingBoxGizmo on a child should not remove its parent ([TrevorDev](https://github.com/TrevorDev)))
 - AmmoJS fix include issue caused after modules update and use world contact point to be consistent with oimo and cannon ([TrevorDev](https://github.com/TrevorDev)))
+- Oimo disable motor maxForce, cannonJS support no impostor, cannonJS cylinder axis ([TrevorDev](https://github.com/TrevorDev)))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

+ 7 - 7
src/Physics/Plugins/cannonJSPlugin.ts

@@ -271,7 +271,7 @@ export class CannonJSPlugin implements IPhysicsEnginePlugin {
             //TMP also for cylinder - TODO Cannon supports cylinder natively.
             case PhysicsImpostor.CylinderImpostor:
                 let nativeParams = impostor.getParam("nativeOptions");
-                if(!nativeParams){
+                if (!nativeParams) {
                     nativeParams = {};
                 }
                 let radiusTop = nativeParams.radiusTop !== undefined ? nativeParams.radiusTop : this._checkWithEpsilon(extendSize.x) / 2;
@@ -279,12 +279,12 @@ export class CannonJSPlugin implements IPhysicsEnginePlugin {
                 let height = nativeParams.height !== undefined ? nativeParams.height : this._checkWithEpsilon(extendSize.y);
                 let numSegments = nativeParams.numSegments !== undefined ? nativeParams.numSegments : 16;
                 returnValue = new this.BJSCANNON.Cylinder(radiusTop, radiusBottom, height, numSegments);
-                
-                // Rotate 90 degrees as this shape is horizontal in cannon                
+
+                // Rotate 90 degrees as this shape is horizontal in cannon
                 var quat = new this.BJSCANNON.Quaternion();
-                quat.setFromAxisAngle(new this.BJSCANNON.Vec3(1,0,0),-Math.PI/2);
-                var translation = new this.BJSCANNON.Vec3(0,0,0);
-                returnValue.transformAllPoints(translation,quat);
+                quat.setFromAxisAngle(new this.BJSCANNON.Vec3(1, 0, 0), -Math.PI / 2);
+                var translation = new this.BJSCANNON.Vec3(0, 0, 0);
+                returnValue.transformAllPoints(translation, quat);
                 break;
             case PhysicsImpostor.BoxImpostor:
                 var box = extendSize.scale(0.5);
@@ -344,7 +344,7 @@ export class CannonJSPlugin implements IPhysicsEnginePlugin {
                 returnValue = new this.BJSCANNON.Particle();
                 break;
             case PhysicsImpostor.NoImpostor:
-                returnValue = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0,0,0));
+                returnValue = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0, 0, 0));
                 break;
         }
 

+ 2 - 2
src/Physics/Plugins/oimoJSPlugin.ts

@@ -424,12 +424,12 @@ export class OimoJSPlugin implements IPhysicsEnginePlugin {
 
     public setMotor(joint: IMotorEnabledJoint, speed: number, maxForce?: number, motorIndex?: number) {
         // Keep defaults consistant with other physics plugins
-        if(maxForce !== undefined){
+        if (maxForce !== undefined) {
             Logger.Warn("OimoJS plugin does not support setMotor with maxForce");
         }
         maxForce = 1e6;
         speed *= -1;
-        
+
         //TODO separate rotational and transational motors.
         var motor = motorIndex ? joint.physicsJoint.rotationalLimitMotor2 : joint.physicsJoint.rotationalLimitMotor1 || joint.physicsJoint.rotationalLimitMotor || joint.physicsJoint.limitMotor;
         if (motor) {