Class PbSerializer
java.lang.Object
org.jbox2d.serialization.pb.PbSerializer
- All Implemented Interfaces:
JbSerializer
Protobuffer serializer implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface JbSerializer
JbSerializer.ObjectSigner -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPbSerializer(JbSerializer.ObjectSigner argSigner) PbSerializer(UnsupportedListener argListener) PbSerializer(UnsupportedListener argListener, JbSerializer.ObjectSigner argSigner) -
Method Summary
Modifier and TypeMethodDescriptionSerializes a shapeSerializes a bodySerializes a fixtureserialize(Joint argJoint, java.util.Map<Body, java.lang.Integer> argBodyIndexMap, java.util.Map<Joint, java.lang.Integer> argJointIndexMap) Serializes joints.Serializes the worldserializeBody(Body argBody) serializeFilter(Filter argFilter) serializeFixture(Fixture argFixture) serializeJoint(Joint joint, java.util.Map<Body, java.lang.Integer> argBodyIndexMap, java.util.Map<Joint, java.lang.Integer> argJointIndexMap) serializeShape(Shape argShape) serializeWorld(World argWorld) voidsetObjectSigner(JbSerializer.ObjectSigner argSigner) Sets the object signer for the serializer.voidsetUnsupportedListener(UnsupportedListener argListener) Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.private Box2D.PbVec2Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
signer
-
listener
-
-
Constructor Details
-
PbSerializer
public PbSerializer() -
PbSerializer
-
PbSerializer
-
PbSerializer
-
-
Method Details
-
setObjectSigner
Description copied from interface:JbSerializerSets the object signer for the serializer. This allows the user to specify an 'tag' for each main physics object, which is then referenced later at deserialization for the user.- Specified by:
setObjectSignerin interfaceJbSerializer- Parameters:
argSigner-
-
setUnsupportedListener
Description copied from interface:JbSerializerSets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.- Specified by:
setUnsupportedListenerin interfaceJbSerializer- Parameters:
argListener-
-
serialize
Description copied from interface:JbSerializerSerializes the world- Specified by:
serializein interfaceJbSerializer- Parameters:
argWorld-- Returns:
- See Also:
-
serializeWorld
-
serialize
Description copied from interface:JbSerializerSerializes a body- Specified by:
serializein interfaceJbSerializer- Parameters:
argBody-- Returns:
- See Also:
-
serializeBody
-
serialize
Description copied from interface:JbSerializerSerializes a fixture- Specified by:
serializein interfaceJbSerializer- Parameters:
argFixture-- Returns:
- See Also:
-
serializeFixture
-
serialize
Description copied from interface:JbSerializerSerializes a shape- Specified by:
serializein interfaceJbSerializer- Parameters:
argShape-- Returns:
- See Also:
-
serializeShape
-
serialize
public SerializationResult serialize(Joint argJoint, java.util.Map<Body, java.lang.Integer> argBodyIndexMap, java.util.Map<Joint, java.lang.Integer> argJointIndexMap) Description copied from interface:JbSerializerSerializes joints. Joints need to reference bodies and sometimes other joints.- Specified by:
serializein interfaceJbSerializer- Parameters:
argJoint-argBodyIndexMap-argJointIndexMap-- Returns:
-
serializeJoint
public Box2D.PbJoint.Builder serializeJoint(Joint joint, java.util.Map<Body, java.lang.Integer> argBodyIndexMap, java.util.Map<Joint, java.lang.Integer> argJointIndexMap) -
serializeFilter
-
vecToPb
-