Package org.jbox2d.serialization.pb
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 org.jbox2d.serialization.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) void
setObjectSigner
(JbSerializer.ObjectSigner argSigner) Sets the object signer for the serializer.void
setUnsupportedListener
(UnsupportedListener argListener) Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.private Box2D.PbVec2
Methods 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:JbSerializer
Sets 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:
setObjectSigner
in interfaceJbSerializer
- Parameters:
argSigner
-
-
setUnsupportedListener
Description copied from interface:JbSerializer
Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.- Specified by:
setUnsupportedListener
in interfaceJbSerializer
- Parameters:
argListener
-
-
serialize
Description copied from interface:JbSerializer
Serializes the world- Specified by:
serialize
in interfaceJbSerializer
- Parameters:
argWorld
-- Returns:
- See Also:
-
serializeWorld
-
serialize
Description copied from interface:JbSerializer
Serializes a body- Specified by:
serialize
in interfaceJbSerializer
- Parameters:
argBody
-- Returns:
- See Also:
-
serializeBody
-
serialize
Description copied from interface:JbSerializer
Serializes a fixture- Specified by:
serialize
in interfaceJbSerializer
- Parameters:
argFixture
-- Returns:
- See Also:
-
serializeFixture
-
serialize
Description copied from interface:JbSerializer
Serializes a shape- Specified by:
serialize
in 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:JbSerializer
Serializes joints. Joints need to reference bodies and sometimes other joints.- Specified by:
serialize
in 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
-