示例#1
0
 /// <summary>
 ///     Set the joint limits, usually in meters.
 /// </summary>
 public void SetLimits(float lower, float upper)
 {
     Box2DxDebug.Assert(lower <= upper);
     Body1.WakeUp();
     Body2.WakeUp();
     LowerLimit = lower;
     UpperLimit = upper;
 }
示例#2
0
        /// <summary>
        ///     Use this to update the target point.
        /// </summary>
        public void SetTarget(Vec2 target)
        {
            if (Body2.IsSleeping())
            {
                Body2.WakeUp();
            }

            Target = target;
        }
示例#3
0
 /// <summary>
 ///     Set the maximum motor force, usually in N.
 /// </summary>
 public void SetMaxMotorForce(float force)
 {
     Body1.WakeUp();
     Body2.WakeUp();
     MaxMotorForce = Settings.FORCE_SCALE(1.0f) * force;
 }
示例#4
0
 /// <summary>
 ///     Enable/disable the joint motor.
 /// </summary>
 public void EnableMotor(bool flag)
 {
     Body1.WakeUp();
     Body2.WakeUp();
     IsMotorEnabled = flag;
 }
示例#5
0
 /// <summary>
 ///     Enable/disable the joint limit.
 /// </summary>
 public void EnableLimit(bool flag)
 {
     Body1.WakeUp();
     Body2.WakeUp();
     IsLimitEnabled = flag;
 }
示例#6
0
 /// <summary>
 ///     Set the motor speed, usually in meters per second.
 /// </summary>
 public void SetMotorSpeed(float speed)
 {
     Body1.WakeUp();
     Body2.WakeUp();
     MotorSpeed = speed;
 }
示例#7
0
 /// <summary>
 ///     Enable/disable the joint motor.
 /// </summary>
 public void EnableMotor(bool flag)
 {
     Body1.WakeUp();
     Body2.WakeUp();
     EnableMotorx = flag;
 }
示例#8
0
 /// <summary>
 ///     Enable/disable the joint limit.
 /// </summary>
 public void EnableLimit(bool flag)
 {
     Body1.WakeUp();
     Body2.WakeUp();
     EnableLimitx = flag;
 }
示例#9
0
 /// <summary>
 ///     Set the maximum motor torque, usually in N-m.
 /// </summary>
 public void SetMaxMotorTorque(float torque)
 {
     Body1.WakeUp();
     Body2.WakeUp();
     MaxMotorTorque = torque;
 }