Package org.box2d.proto.Box2D

Examples of org.box2d.proto.Box2D.PbJoint


      Map<Joint, Integer> argJointIndexMap) {
    PbJoint.Builder builder = serializeJoint(argJoint, argBodyIndexMap, argJointIndexMap);
    if (builder == null) {
      return null;
    }
    final PbJoint joint = builder.build();
    return new SerializationResult() {
      @Override
      public void writeTo(OutputStream argOutputStream) throws IOException {
        joint.writeTo(argOutputStream);
      }

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


    }

    // first pass, indep joints
    int cnt = 0;
    for (int i = 0; i < pbWorld.getJointsCount(); i++) {
      PbJoint pbJoint = pbWorld.getJoints(i);
      if (isIndependentJoint(pbJoint.getType())) {
        Joint joint = deserializeJoint(world, pbJoint, bodyMap, jointMap);
        jointMap.put(cnt, joint);
        cnt++;
      }
    }

    // second pass, dep joints
    for (int i = 0; i < pbWorld.getJointsCount(); i++) {
      PbJoint pbJoint = pbWorld.getJoints(i);
      if (!isIndependentJoint(pbJoint.getType())) {
        Joint joint = deserializeJoint(world, pbJoint, bodyMap, jointMap);
        jointMap.put(cnt, joint);
        cnt++;
      }
    }
View Full Code Here

  }

  @Override
  public Joint deserializeJoint(World argWorld, InputStream argInput,
      Map<Integer, Body> argBodyMap, Map<Integer, Joint> jointMap) throws IOException {
    PbJoint joint = PbJoint.parseFrom(argInput);
    return deserializeJoint(argWorld, joint, argBodyMap, jointMap);
  }
View Full Code Here

TOP

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

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.