Package eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.scale()


      body1.adjustAngularVelocity(-body1.getInvI() * MathUtil.cross(r1,impulse));
    }

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


      Vector2f vec = MathUtil.scale(contacts[i].getNormal(),-1);
      contacts[i].setNormal(vec);
     
      Vector2f pt = MathUtil.sub(contacts[i].getPosition(), circleBody.getPosition());
      pt.normalise();
      pt.scale(((Circle) circleBody.getBodyShape()).getRadius());
      pt.add(circleBody.getPosition());
      contacts[i].setPosition(pt);
    }
   
    return count;
View Full Code Here

    float ju = -dv.dot(dp) + bias;
    float p = ju / sc;

    Vector2f impulse = new Vector2f(dp);
    impulse.scale(p);

    if (!body1.isStatic()) {
      Vector2f accum1 = new Vector2f(impulse);
      accum1.scale(-body1.getInvMass());
      body1.adjustVelocity(accum1);
View Full Code Here

    Vector2f impulse = new Vector2f(dp);
    impulse.scale(p);

    if (!body1.isStatic()) {
      Vector2f accum1 = new Vector2f(impulse);
      accum1.scale(-body1.getInvMass());
      body1.adjustVelocity(accum1);
      body1.adjustAngularVelocity(-(body1.getInvI() * MathUtil.cross(r1,
          impulse)));
    }

 
View Full Code Here

          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

    dp.normalise();

    sc = MathUtil.mul(K, dp).dot(dp);

    Vector2f impulse = new Vector2f(dp);
    impulse.scale(accumulatedImpulse);

    if (!body1.isStatic()) {
      Vector2f accum1 = new Vector2f(impulse);
      accum1.scale(-body1.getInvMass());
      body1.adjustVelocity(accum1);
View Full Code Here

    Vector2f impulse = new Vector2f(dp);
    impulse.scale(accumulatedImpulse);

    if (!body1.isStatic()) {
      Vector2f accum1 = new Vector2f(impulse);
      accum1.scale(-body1.getInvMass());
      body1.adjustVelocity(accum1);
      body1.adjustAngularVelocity(-(body1.getInvI() * MathUtil.cross(r1,
          impulse)));
    }

 
View Full Code Here

          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

    if (centre < linePos) {
      if (!line.blocksInnerEdge()) {
        return 0;
      }
     
      normal.scale(-1);
      for (int i=0;i<4;i++) {
        if (tangent[i] > linePos) {
          if (proj[i] < 0) {
            Vector2f onAxis = new Vector2f();
            Line leftLine = new Line(getPt(pts,i-1),pts[i]);
View Full Code Here

    // Apply accumulated impulse.
    accumulatedImpulse.scale(relaxation);
   
    Vector2f accum1 = new Vector2f(accumulatedImpulse);
    accum1.scale(-body1.getInvMass());
    body1.adjustVelocity(accum1);
    body1.adjustAngularVelocity(-(body1.getInvI() * MathUtil.cross(r1, accumulatedImpulse)));

    Vector2f accum2 = new Vector2f(accumulatedImpulse);
    accum2.scale(body2.getInvMass());
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.