Package org.jbox2d.collision.shapes

Examples of org.jbox2d.collision.shapes.ShapeType


    addType(pool.getChainCircleContactStack(), ShapeType.CHAIN, ShapeType.CIRCLE);
    addType(pool.getChainPolyContactStack(), ShapeType.CHAIN, ShapeType.POLYGON);
  }

  public Contact popContact(Fixture fixtureA, int indexA, Fixture fixtureB, int indexB) {
    final ShapeType type1 = fixtureA.getType();
    final ShapeType type2 = fixtureB.getType();

    final ContactRegister reg = contactStacks[type1.ordinal()][type2.ordinal()];
    final IDynamicStack<Contact> creator = reg.creator;
    if (creator != null) {
      if (reg.primary) {
        Contact c = creator.pop();
        c.init(fixtureA, indexA, fixtureB, indexB);
View Full Code Here


    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);
  }
View Full Code Here

  public void setParticleDestructionListener(ParticleDestructionListener listener) {
    m_particleDestructionListener = listener;
  }

  public Contact popContact(Fixture fixtureA, int indexA, Fixture fixtureB, int indexB) {
    final ShapeType type1 = fixtureA.getType();
    final ShapeType type2 = fixtureB.getType();

    final ContactRegister reg = contactStacks[type1.ordinal()][type2.ordinal()];
    if (reg != null) {
      if (reg.primary) {
        Contact c = reg.creator.pop();
        c.init(fixtureA, indexA, fixtureB, indexB);
        return c;
View Full Code Here

    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);
  }
View Full Code Here

    addType(pool.getPolyCircleContactStack(), ShapeType.POLYGON, ShapeType.CIRCLE);
    addType(pool.getPolyContactStack(), ShapeType.POLYGON, ShapeType.POLYGON);
  }

  public Contact popContact(Fixture fixtureA, Fixture fixtureB) {
    final ShapeType type1 = fixtureA.getType();
    final ShapeType type2 = fixtureB.getType();

    final ContactRegister reg = contactStacks[type1.intValue][type2.intValue];
    final IDynamicStack<Contact> creator = reg.creator;
    if (creator != null) {
      if (reg.primary) {
View Full Code Here

    if (contact.m_manifold.pointCount > 0) {
      contact.getFixtureA().getBody().setAwake(true);
      contact.getFixtureB().getBody().setAwake(true);
    }

    ShapeType type1 = contact.getFixtureA().getType();
    ShapeType type2 = contact.getFixtureB().getType();

    IDynamicStack<Contact> creator = contactStacks[type1.intValue][type2.intValue].creator;
    creator.push(contact);
  }
View Full Code Here

    addType(pool.getChainCircleContactStack(), ShapeType.CHAIN, ShapeType.CIRCLE);
    addType(pool.getChainPolyContactStack(), ShapeType.CHAIN, ShapeType.POLYGON);
  }

  public Contact popContact (Fixture fixtureA, int indexA, Fixture fixtureB, int indexB) {
    final ShapeType type1 = fixtureA.getType();
    final ShapeType type2 = fixtureB.getType();

    final ContactRegister reg = contactStacks[type1.ordinal()][type2.ordinal()];
    final IDynamicStack<Contact> creator = reg.creator;
    if (creator != null) {
      if (reg.primary) {
        Contact c = creator.pop();
        c.init(fixtureA, indexA, fixtureB, indexB);
View Full Code Here

    if (contact.m_manifold.pointCount > 0) {
      contact.getFixtureA().getBody().setAwake(true);
      contact.getFixtureB().getBody().setAwake(true);
    }

    ShapeType type1 = contact.getFixtureA().getType();
    ShapeType type2 = contact.getFixtureB().getType();

    IDynamicStack<Contact> creator = contactStacks[type1.ordinal()][type2.ordinal()].creator;
    creator.push(contact);
  }
View Full Code Here

  }

  /** Get the type of the child shape. You can use this to down cast to the concrete shape.
   * @return the shape type. */
  public Type getType () {
    ShapeType type = fixture.getType();
    if (type == ShapeType.CIRCLE) return Type.Circle;
    if (type == ShapeType.EDGE) return Type.Edge;
    if (type == ShapeType.POLYGON) return Type.Polygon;
    if (type == ShapeType.CHAIN) return Type.Chain;
    return Type.Circle;
View Full Code Here

  /** Returns the shape of this fixture */
  public Shape getShape () {
    if (shape == null) {
      org.jbox2d.collision.shapes.Shape shape2 = fixture.getShape();
      ShapeType type = shape2.getType();
      if (type == ShapeType.CHAIN) shape = new ChainShape((org.jbox2d.collision.shapes.ChainShape)shape2);
      if (type == ShapeType.CIRCLE) shape = new CircleShape((org.jbox2d.collision.shapes.CircleShape)shape2);
      if (type == ShapeType.EDGE) shape = new EdgeShape((org.jbox2d.collision.shapes.EdgeShape)shape2);
      if (type == ShapeType.POLYGON) shape = new PolygonShape((org.jbox2d.collision.shapes.PolygonShape)shape2);
    }
View Full Code Here

TOP

Related Classes of org.jbox2d.collision.shapes.ShapeType

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.