Examples of dot()


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

    // Due to roundoff, it is possible that clipping removes all points.

    int numContacts = 0;
    for (int i = 0; i < 2; ++i)
    {
      float separation2 = frontNormal.dot(clipPoints2[i].v) - front;

      if (separation2 <= 0)
      {
        contacts[numContacts].setSeparation(separation2);
        contacts[numContacts].setNormal(normal);
View Full Code Here

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

      relativeVelocity.add(MathUtil.cross(body2.getAngularVelocity(), r2));
      relativeVelocity.sub(body1.getVelocity());
      relativeVelocity.sub(MathUtil.cross(body1.getAngularVelocity(), r1));
     
      // project the relative velocity onto the spring vector and apply the mass normal
      float normalImpulse = massNormal * relativeVelocity.dot(spring);
     
//      // TODO: Clamp the accumulated impulse?
//      float oldNormalImpulse = accumulatedNormalImpulse;
//      accumulatedNormalImpulse = Math.max(oldNormalImpulse + normalImpulse, 0.0f);
//      normalImpulse = accumulatedNormalImpulse - oldNormalImpulse;
View Full Code Here

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

    Vector2f dv = new Vector2f(body2.getVelocity());
    dv.add(MathUtil.cross(body2.getAngularVelocity(), r2));
    dv.sub(body1.getVelocity());
    dv.sub(MathUtil.cross(body1.getAngularVelocity(), r1));

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

    Vector2f impulse = new Vector2f(dp);
    impulse.scale(p);
View Full Code Here

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

      Vector2f r2 = new Vector2f(c.position);
      r2.sub(body2.getPosition());

      // Precompute normal mass, tangent mass, and bias.
      float rn1 = r1.dot(c.normal);
      float rn2 = r2.dot(c.normal);
      float kNormal = body1.getInvMass() + body2.getInvMass();
      kNormal += body1.getInvI() * (r1.dot(r1) - rn1 * rn1) + body2.getInvI() * (r2.dot(r2) - rn2 * rn2);
      c.massNormal = damping / kNormal;
     
      Vector2f tangent = MathUtil.cross(c.normal, 1.0f);
View Full Code Here

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

      // Precompute normal mass, tangent mass, and bias.
      float rn1 = r1.dot(c.normal);
      float rn2 = r2.dot(c.normal);
      float kNormal = body1.getInvMass() + body2.getInvMass();
      kNormal += body1.getInvI() * (r1.dot(r1) - rn1 * rn1) + body2.getInvI() * (r2.dot(r2) - rn2 * rn2);
      c.massNormal = damping / kNormal;
     
      Vector2f tangent = MathUtil.cross(c.normal, 1.0f);
      float rt1 = r1.dot(tangent);
      float rt2 = r2.dot(tangent);
View Full Code Here

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

      relativeVelocity.add(MathUtil.cross(b2.getAngularVelocity(), r2));
      relativeVelocity.sub(b1.getVelocity());
      relativeVelocity.sub(MathUtil.cross(b1.getAngularVelocity(), r1));
     
      // Compute normal impulse with bias.
      float vn = relativeVelocity.dot(c.normal);
     
      // bias caculations are now handled seperately hence we only
      // handle the real impulse caculations here
      //float normalImpulse = c.massNormal * ((c.restitution - vn) + c.bias);
      float normalImpulse = c.massNormal * (c.restitution - vn);
View Full Code Here

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

   
    Vector2f dv = new Vector2f(body2.getVelocity());
    dv.add(MathUtil.cross(body2.getAngularVelocity(),r2));
    dv.sub(body1.getVelocity());
    dv.sub(MathUtil.cross(body1.getAngularVelocity(),r1));
    float reln = dv.dot(ndp);
    reln = restitute-reln;
    float P = reln/K;
    float newImpulse;
    if(collideSide==COLLIDE_MIN){
      newImpulse = accumulateImpulse+P<0.0f?accumulateImpulse+P:0.0f;
View Full Code Here

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

    dv.sub(MathUtil.cross(body1.getAngularVelocity(),r1));
     
    ndp = new Vector2f(dp);
    ndp.normalise();
   
    restitute = -restitutionConstant*dv.dot(ndp);
   
    Vector2f v1 = new Vector2f(ndp);
    v1.scale(-body2.getInvMass() - body1.getInvMass());

    Vector2f v2 = MathUtil.cross(MathUtil.cross(r2, ndp), r2);
View Full Code Here

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

   
    Vector2f K1 = new Vector2f(v1);
    K1.add(v2);
    K1.add(v3);
   
    K = K1.dot(ndp);
    float length=dp.lengthSquared();
    if(length<minDistance){
      if(collideSide!=COLLIDE_MIN)
        accumulateImpulse=0;
      collideSide=COLLIDE_MIN;     
View Full Code Here

Examples of net.yacy.visualization.RasterPlotter.dot()

        final RasterPlotter img = new RasterPlotter(800, 600, RasterPlotter.DrawMode.MODE_SUB, "FFFFFF");
        img.setColor(RasterPlotter.GREY);
        for (int y = 0; y < 600; y = y + 50) PrintTool.print(img, 0, 6 + y, 0, Integer.toString(y), -1);
        for (int x = 0; x < 800; x = x + 50) PrintTool.print(img, x, 6    , 0, Integer.toString(x), -1);
        img.setColor(RasterPlotter.RED);
        img.dot(550, 110, 90, true, 100);
        img.setColor(RasterPlotter.GREEN);
        img.dot(480, 200, 90, true, 100);
        img.setColor(RasterPlotter.BLUE);
        img.dot(620, 200, 90, true, 100);
        img.setColor(RasterPlotter.RED);
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.