本文整理汇总了Java中org.box2d.proto.Box2D.PbFixture类的典型用法代码示例。如果您正苦于以下问题:Java PbFixture类的具体用法?Java PbFixture怎么用?Java PbFixture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PbFixture类属于org.box2d.proto.Box2D包,在下文中一共展示了PbFixture类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserializeFixture
import org.box2d.proto.Box2D.PbFixture; //导入依赖的package包/类
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;
}
示例2: serializeFixture
import org.box2d.proto.Box2D.PbFixture; //导入依赖的package包/类
public PbFixture.Builder serializeFixture(Fixture argFixture) {
final PbFixture.Builder builder = PbFixture.newBuilder();
if (signer != null) {
Long tag = signer.getTag(argFixture);
if (tag != null) {
builder.setTag(tag);
}
}
builder.setDensity(argFixture.m_density);
builder.setFriction(argFixture.m_friction);
builder.setRestitution(argFixture.m_restitution);
builder.setSensor(argFixture.m_isSensor);
builder.setShape(serializeShape(argFixture.m_shape));
builder.setFilter(serializeFilter(argFixture.m_filter));
return builder;
}
示例3: serialize
import org.box2d.proto.Box2D.PbFixture; //导入依赖的package包/类
@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;
}
};
}