Package org.box2d.proto.Box2D

Examples of org.box2d.proto.Box2D.PbFixture


    return builder;
  }

  @Override
  public SerializationResult serialize(Fixture argFixture) {
    final PbFixture fixture = serializeFixture(argFixture).build();
    return new SerializationResult() {
      @Override
      public void writeTo(OutputStream argOutputStream) throws IOException {
        fixture.writeTo(argOutputStream);
      }

      @Override
      public Object getValue() {
        return fixture;
View Full Code Here


    return body;
  }

  @Override
  public Fixture deserializeFixture(Body argBody, InputStream argInput) throws IOException {
    PbFixture fixture = PbFixture.parseFrom(argInput);
    return deserializeFixture(argBody, fixture);
  }
View Full Code Here

    PbFixture fixture = PbFixture.parseFrom(argInput);
    return deserializeFixture(argBody, fixture);
  }

  public Fixture deserializeFixture(Body argBody, PbFixture argFixture) {
    PbFixture f = argFixture;

    FixtureDef fd = new FixtureDef();
    fd.density = f.getDensity();
    fd.filter.categoryBits = f.getFilter().getCategoryBits();
    fd.filter.groupIndex = f.getFilter().getGroupIndex();
    fd.filter.maskBits = f.getFilter().getMaskBits();
    fd.friction = f.getFriction();
    fd.isSensor = f.getSensor();
    fd.restitution = f.getRestitution();
    fd.shape = deserializeShape(f.getShape());

    Fixture fixture = argBody.createFixture(fd);
    if (listener != null && f.hasTag()) {
      listener.processFixture(fixture, f.getTag());
    }
    return fixture;
  }
View Full Code Here

TOP

Related Classes of org.box2d.proto.Box2D.PbFixture

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.