Package org.jbox2d.dynamics

Examples of org.jbox2d.dynamics.Fixture


     
      shape.m_radius=CoordinateConverter.scalerPixelsToWorld(radius);
      fixtureDef.isSensor=true;
      fixtureDef.shape=shape;
     
      Fixture fixture=body.createFixture(fixtureDef);
      aabb=fixture.getAABB();
     
    }else{
      this.radius=0;
    }
  }
View Full Code Here


    for (int i = 0; i < m_count; ++i) {
      // System.out.println("contacts: " + m_count);
      final Contact contact = m_contacts[i];

      final Fixture fixtureA = contact.m_fixtureA;
      final Fixture fixtureB = contact.m_fixtureB;
      final Shape shapeA = fixtureA.getShape();
      final Shape shapeB = fixtureB.getShape();
      final float radiusA = shapeA.m_radius;
      final float radiusB = shapeB.m_radius;
      final Body bodyA = fixtureA.getBody();
      final Body bodyB = fixtureB.getBody();
      final Manifold manifold = contact.getManifold();

      int pointCount = manifold.pointCount;
      assert (pointCount > 0);
View Full Code Here

    if (manifold.pointCount == 0) {
      return;
    }

    Fixture fixtureA = contact.getFixtureA();
    Fixture fixtureB = contact.getFixtureB();

    Collision.getPointStates(state1, state2, oldManifold, manifold);

    contact.getWorldManifold(worldManifold);
View Full Code Here

    for (int i = 0; i < m_count; ++i) {
      // System.out.println("contacts: " + m_count);
      final Contact contact = m_contacts[i];

      final Fixture fixtureA = contact.m_fixtureA;
      final Fixture fixtureB = contact.m_fixtureB;
      final Shape shapeA = fixtureA.getShape();
      final Shape shapeB = fixtureB.getShape();
      final float radiusA = shapeA.m_radius;
      final float radiusB = shapeB.m_radius;
      final Body bodyA = fixtureA.getBody();
      final Body bodyB = fixtureB.getBody();
      final Manifold manifold = contact.getManifold();

      int pointCount = manifold.pointCount;
      assert (pointCount > 0);
View Full Code Here

    }
   
    for (int i = 0; i < m_constraintCount; ++i){
      final Contact contact = contacts[i];

      final Fixture fixtureA = contact.m_fixtureA;
      final Fixture fixtureB = contact.m_fixtureB;
      final Shape shapeA = fixtureA.getShape();
      final Shape shapeB = fixtureB.getShape();
      final float radiusA = shapeA.m_radius;
      final float radiusB = shapeB.m_radius;
      final Body bodyA = fixtureA.getBody();
      final Body bodyB = fixtureB.getBody();
      final Manifold manifold = contact.getManifold();

      final float friction = Settings.mixFriction(fixtureA.getFriction(), fixtureB.getFriction());
      final float restitution = Settings.mixRestitution(fixtureA.getRestitution(), fixtureB.getRestitution());

      final Vec2 vA = bodyA.m_linearVelocity;
      final Vec2 vB = bodyB.m_linearVelocity;
      final float wA = bodyA.m_angularVelocity;
      final float wB = bodyB.m_angularVelocity;
View Full Code Here

//    m_constraints = new TOIConstraint[count];

    for(int i=0; i<m_count; i++){
      Contact contact = contacts[i];
     
      Fixture fixtureA = contact.getFixtureA();
      Fixture fixtureB = contact.getFixtureB();
      Shape shapeA = fixtureA.getShape();
      Shape shapeB = fixtureB.getShape();
      float radiusA = shapeA.m_radius;
      float radiusB = shapeB.m_radius;
      Body bodyA = fixtureA.getBody();
      Body bodyB = fixtureB.getBody();
      Manifold manifold = contact.getManifold();
     
      assert(manifold.pointCount > 0);
     
//      m_constraints[i] = new TOIConstraint();
View Full Code Here

    for (int i = 0; i < m_count; ++i) {
      // System.out.println("contacts: " + m_count);
      final Contact contact = m_contacts[i];

      final Fixture fixtureA = contact.m_fixtureA;
      final Fixture fixtureB = contact.m_fixtureB;
      final Shape shapeA = fixtureA.getShape();
      final Shape shapeB = fixtureB.getShape();
      final float radiusA = shapeA.m_radius;
      final float radiusB = shapeB.m_radius;
      final Body bodyA = fixtureA.getBody();
      final Body bodyB = fixtureB.getBody();
      final Manifold manifold = contact.getManifold();

      int pointCount = manifold.pointCount;
      assert (pointCount > 0);
View Full Code Here

    for (int i = 0; i < m_count; ++i) {
      // System.out.println("contacts: " + m_count);
      final Contact contact = m_contacts[i];

      final Fixture fixtureA = contact.m_fixtureA;
      final Fixture fixtureB = contact.m_fixtureB;
      final Shape shapeA = fixtureA.getShape();
      final Shape shapeB = fixtureB.getShape();
      final float radiusA = shapeA.m_radius;
      final float radiusB = shapeB.m_radius;
      final Body bodyA = fixtureA.getBody();
      final Body bodyB = fixtureB.getBody();
      final Manifold manifold = contact.getManifold();

      int pointCount = manifold.pointCount;
      assert (pointCount > 0);
View Full Code Here

  @Override
  public void preSolve(Contact contact, Manifold oldManifold) {
    super.preSolve(contact, oldManifold);

    Fixture fixtureA = contact.getFixtureA();
    Fixture fixtureB = contact.getFixtureB();

    if (fixtureA == m_platform || fixtureB == m_platform) {
      contact.setTangentSpeed(5.0f);
    }
  }
View Full Code Here

  @Override
  public void preSolve(Contact contact, Manifold oldManifold) {
    super.preSolve(contact, oldManifold);

    Fixture fixtureA = contact.getFixtureA();
    Fixture fixtureB = contact.getFixtureB();

    if (fixtureA != m_platform && fixtureA != m_character) {
      return;
    }
View Full Code Here

TOP

Related Classes of org.jbox2d.dynamics.Fixture

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.