当前位置: 首页>>代码示例>>Java>>正文


Java PbFixture类代码示例

本文整理汇总了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;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:20,代码来源:PbDeserializer.java

示例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;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:20,代码来源:PbSerializer.java

示例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;
    }
  };
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:16,代码来源:PbSerializer.java


注:本文中的org.box2d.proto.Box2D.PbFixture类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。