Package org.jbox2d.common

Examples of org.jbox2d.common.Rot


    // Vec2 cD = data.positions[m_indexD].c;
    float aD = data.positions[m_indexD].a;
    Vec2 vD = data.velocities[m_indexD].v;
    float wD = data.velocities[m_indexD].w;

    Rot qA = pool.popRot(), qB = pool.popRot(), qC = pool.popRot(), qD = pool.popRot();
    qA.set(aA);
    qB.set(aB);
    qC.set(aC);
    qD.set(aD);

    m_mass = 0.0f;
View Full Code Here


    Vec2 cC = data.positions[m_indexC].c;
    float aC = data.positions[m_indexC].a;
    Vec2 cD = data.positions[m_indexD].c;
    float aD = data.positions[m_indexD].a;

    Rot qA = pool.popRot(), qB = pool.popRot(), qC = pool.popRot(), qD = pool.popRot();
    qA.set(aA);
    qB.set(aB);
    qC.set(aC);
    qD.set(aD);

    float linearError = 0.0f;
View Full Code Here

    // Transform.mulTransToOut(xfA, c, cLocal);
    // final float cLocalx = cLocal.x;
    // final float cLocaly = cLocal.y;
    // after inline:
    final Vec2 circlep = circle.m_p;
    final Rot xfBq = xfB.q;
    final Rot xfAq = xfA.q;
    final float cx = (xfBq.c * circlep.x - xfBq.s * circlep.y) + xfB.p.x;
    final float cy = (xfBq.s * circlep.x + xfBq.c * circlep.y) + xfB.p.y;
    final float px = cx - xfA.p.x;
    final float py = cy - xfA.p.y;
    final float cLocalx = (xfAq.c * px + xfAq.s * py);
 
View Full Code Here

    // final float normal1x = normal1.x;
    // final float normal1y = normal1.y;
    // final float normal1Worldx = normal1World.x;
    // final float normal1Worldy = normal1World.y;
    // after inline:
    final Rot xf1q = xf1.q;
    final Rot xf2q = xf2.q;
    Rot q = xf1q;
    Vec2 v = normals1[edge1];
    final float normal1Worldx = q.c * v.x - q.s * v.y;
    final float normal1Worldy = q.s * v.x + q.c * v.y;
    Rot q1 = xf2q;
    final float normal1x = q1.c * normal1Worldx + q1.s * normal1Worldy;
    final float normal1y = -q1.s * normal1Worldx + q1.c * normal1Worldy;
    // end inline

    // Find support vertex on poly2 for -normal.
View Full Code Here

    int count1 = poly1.m_count;
    final Vec2[] normals1 = poly1.m_normals;

    final Vec2 poly1centroid = poly1.m_centroid;
    final Vec2 poly2centroid = poly2.m_centroid;
    final Rot xf2q = xf2.q;
    final Rot xf1q = xf1.q;
    // Vector pointing from the centroid of poly1 to the centroid of poly2.
    // before inline:
    // Transform.mulToOutUnsafe(xf2, poly2centroid, d);
    // Transform.mulToOutUnsafe(xf1, poly1centroid, temp);
    // d.subLocal(temp);
View Full Code Here

    assert (0 <= edge1 && edge1 < count1);

    final ClipVertex c0 = c[0];
    final ClipVertex c1 = c[1];
    final Rot xf1q = xf1.q;
    final Rot xf2q = xf2.q;

    // Get the normal of the reference edge in poly2's frame.
    // Vec2 normal1 = MulT(xf2.R, Mul(xf1.R, normals1[edge1]));
    // before inline:
    // Rot.mulToOutUnsafe(xf1.q, normals1[edge1], normal1); // temporary
View Full Code Here

      xf2 = xfB;
      edge1 = results1.edgeIndex;
      manifold.type = ManifoldType.FACE_A;
      flip = false;
    }
    final Rot xf1q = xf1.q;

    findIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);

    int count1 = poly1.m_count;
    final Vec2[] vertices1 = poly1.m_vertices;
View Full Code Here

    // Rot.mulToOutUnsafe(transform.q, m_p, center);
    // center.addLocal(transform.p);
    //
    // final Vec2 d = center.subLocal(p).negateLocal();
    // return Vec2.dot(d, d) <= m_radius * m_radius;
    final Rot q = transform.q;
    final Vec2 tp = transform.p;
    float centerx = -(q.c * m_p.x - q.s * m_p.y + tp.x - p.x);
    float centery = -(q.s * m_p.x + q.c * m_p.y + tp.y - p.y);

    return centerx * centerx + centery * centery <= m_radius * m_radius;
 
View Full Code Here

  @Override
  public final boolean raycast (RayCastOutput output, RayCastInput input, Transform transform, int childIndex) {
    final Vec2 inputp1 = input.p1;
    final Vec2 inputp2 = input.p2;
    final Rot tq = transform.q;
    final Vec2 tp = transform.p;

    // Rot.mulToOutUnsafe(transform.q, m_p, position);
    // position.addLocal(transform.p);
    final float positionx = tq.c * m_p.x - tq.s * m_p.y + tp.x;
View Full Code Here

    return false;
  }

  @Override
  public final void computeAABB (final AABB aabb, final Transform transform, int childIndex) {
    final Rot tq = transform.q;
    final Vec2 tp = transform.p;
    final float px = tq.c * m_p.x - tq.s * m_p.y + tp.x;
    final float py = tq.s * m_p.x + tq.c * m_p.y + tp.y;

    aabb.lowerBound.x = px - m_radius;
View Full Code Here

TOP

Related Classes of org.jbox2d.common.Rot

Copyright © 2018 www.massapicom. 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.