Class PbSerializer
java.lang.Object
org.jbox2d.serialization.pb.PbSerializer
- All Implemented Interfaces:
JbSerializer
Protobuffer serializer implementation.
- Author:
- Daniel
-
Nested Class Summary
Nested classes/interfaces inherited from interface JbSerializer
JbSerializer.ObjectSigner -
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 fixtureSerializes joints.Serializes the worldserializeBody(Body argBody) serializeFilter(Filter argFilter) serializeFixture(Fixture argFixture) 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.
-
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, Map<Body, Integer> argBodyIndexMap, Map<Joint, 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
-
serializeFilter
-