/** * Get the world manifold. */ public void getWorldManifold(WorldManifold worldManifold) { final Body bodyA = m_fixtureA.getBody(); final Body bodyB = m_fixtureB.getBody(); final Shape shapeA = m_fixtureA.getShape(); final Shape shapeB = m_fixtureB.getShape(); worldManifold.initialize(m_manifold, bodyA.getTransform(), shapeA.m_radius, bodyB.getTransform(), shapeB.m_radius); }
public void pushContact(Contact contact) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (contact.m_manifold.pointCount > 0 && !fixtureA.isSensor() && !fixtureB.isSensor()) { fixtureA.getBody().setAwake(true); fixtureB.getBody().setAwake(true); } ShapeType type1 = fixtureA.getType(); ShapeType type2 = fixtureB.getType(); IDynamicStack<Contact> creator = contactStacks[type1.ordinal()][type2.ordinal()].creator; creator.push(contact); }
Body body = fixture.getBody(); int childCount = shape.getChildCount(); for (int childIndex = 0; childIndex < childCount; childIndex++) {
Body b = fixture.getBody(); Vec2 bp = b.getWorldCenter(); float bm = b.getMass();
public float reportFixture(Fixture fixture, Vec2 point, Vec2 normal, float fraction) { Body body = fixture.getBody(); Object userData = body.getUserData(); if (userData != null) { int index = (Integer) userData; if (index == 0) { // filter return -1f; } } m_hit = true; m_point = point; m_normal = normal; return 0f; }
public float reportFixture(Fixture fixture, Vec2 point, Vec2 normal, float fraction) { Body body = fixture.getBody(); Object userData = body.getUserData(); if (userData != null) { int index = (Integer) userData; if (index == 0) { // filter return -1f; } } m_hit = true; m_point = point; m_normal = normal; return fraction; }
Body b = fixture.getBody(); liquidOffset.set(b.m_linearVelocity); float linVelLength = b.m_linearVelocity.length();
public boolean reportFixture(Fixture argFixture) { Body body = argFixture.getBody(); if (body.getType() == BodyType.DYNAMIC) { boolean inside = argFixture.testPoint(point); if (inside) { fixture = argFixture; return false; } } return true; } }
public void beginContact(Contact contact) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (fixtureA == m_sensor) { Object userData = fixtureB.getBody().getUserData(); if (userData != null) { ((BoolWrapper) userData).tf = true; } } if (fixtureB == m_sensor) { Object userData = fixtureA.getBody().getUserData(); if (userData != null) { ((BoolWrapper) userData).tf = true; } } }
public void endContact(Contact contact) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (fixtureA == m_sensor) { Object userData = fixtureB.getBody().getUserData(); if (userData != null) { ((BoolWrapper) userData).tf = false; } } if (fixtureB == m_sensor) { Object userData = fixtureA.getBody().getUserData(); if (userData != null) { ((BoolWrapper) userData).tf = false; } } }
/** * Get the world manifold. */ public void getWorldManifold(WorldManifold worldManifold) { final Body bodyA = m_fixtureA.getBody(); final Body bodyB = m_fixtureB.getBody(); final Shape shapeA = m_fixtureA.getShape(); final Shape shapeB = m_fixtureB.getShape(); worldManifold.initialize(m_manifold, bodyA.getTransform(), shapeA.m_radius, bodyB.getTransform(), shapeB.m_radius); }
public void pushContact(Contact contact) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (contact.m_manifold.pointCount > 0 && !fixtureA.isSensor() && !fixtureB.isSensor()) { fixtureA.getBody().setAwake(true); fixtureB.getBody().setAwake(true); } ShapeType type1 = fixtureA.getType(); ShapeType type2 = fixtureB.getType(); IDynamicStack<Contact> creator = contactStacks[type1.ordinal()][type2.ordinal()].creator; creator.push(contact); }
public boolean reportFixture(Fixture fixture) { if (m_count == e_maxCount) { return false; } Body body = fixture.getBody(); Shape shape = fixture.getShape(); boolean overlap = p.getCollision().testOverlap(shape, 0, m_circle, 0, body.getTransform(), m_transform); if (overlap) { DrawFixture(fixture); ++m_count; } return true; } }
@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; } if (fixtureB != m_character && fixtureB != m_character) { return; } Vec2 position = m_character.getBody().getPosition(); if (position.y < m_top + m_radius - 3.0f * Settings.linearSlop) { contact.setEnabled(false); } } }