فهرست منبع

oimo disable maxForce

Trevor Baron 6 سال پیش
والد
کامیت
5009fcb8dd
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      src/Physics/Plugins/oimoJSPlugin.ts

+ 7 - 0
src/Physics/Plugins/oimoJSPlugin.ts

@@ -423,6 +423,13 @@ 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){
+            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) {