Package net.phys2d.math

Examples of net.phys2d.math.Vector2f.scale()


      bounceSide = BOUNCE_NONE;
    }
    restituteAngular += biasImpulse;

    Vector2f impulse = new Vector2f(n);
    impulse.scale(accumulateImpulse);
    if (!body1.isStatic()) {
      Vector2f accum1 = new Vector2f(impulse);
      accum1.scale(body1.getInvMass());
      body1.adjustVelocity(accum1);
      body1.adjustAngularVelocity((body1.getInvI() * MathUtil.cross(R,
 
View Full Code Here


    Vector2f impulse = new Vector2f(n);
    impulse.scale(accumulateImpulse);
    if (!body1.isStatic()) {
      Vector2f accum1 = new Vector2f(impulse);
      accum1.scale(body1.getInvMass());
      body1.adjustVelocity(accum1);
      body1.adjustAngularVelocity((body1.getInvI() * MathUtil.cross(R,
          impulse)));
    }
    if (!body2.isStatic()) {
View Full Code Here

      body1.adjustAngularVelocity((body1.getInvI() * MathUtil.cross(R,
          impulse)));
    }
    if (!body2.isStatic()) {
      Vector2f accum2 = new Vector2f(impulse);
      accum2.scale(-body2.getInvMass());
      body2.adjustVelocity(accum2);
      body2.adjustAngularVelocity(-(body2.getInvI() * MathUtil.cross(r2,
          impulse)));
    }
  }
 
View Full Code Here

    p = newImpulse - oldImpulse;

    accumulateImpulse = newImpulse;

    Vector2f impulse = new Vector2f(n);
    impulse.scale(p);
    if (!body1.isStatic()) {
      Vector2f accum1 = new Vector2f(impulse);
      accum1.scale(body1.getInvMass());
      body1.adjustVelocity(accum1);
      body1.adjustAngularVelocity((body1.getInvI() * MathUtil.cross(R,
 
View Full Code Here

        if (((Body)localObject1).getGravityEffected())
          ((Vector2f)localObject2).add(this.gravity);
        ((Vector2f)localObject2).scale(paramFloat);
        ((Body)localObject1).adjustVelocity((Vector2f)localObject2);
        Vector2f localVector2f = new Vector2f(((Body)localObject1).getVelocity());
        localVector2f.scale(-((Body)localObject1).getDamping() * ((Body)localObject1).getInvMass());
        ((Body)localObject1).adjustVelocity(localVector2f);
        ((Body)localObject1).adjustAngularVelocity(paramFloat * ((Body)localObject1).getInvI() * ((Body)localObject1).getTorque());
        ((Body)localObject1).adjustAngularVelocity(-((Body)localObject1).getAngularVelocity() * ((Body)localObject1).getInvI() * ((Body)localObject1).getRotDamping());
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.