Package org.jbox2d.serialization
Interface JbSerializer
- All Known Implementing Classes:
PbSerializer
public interface JbSerializer
Serializer for jbox2d, used to serialize any aspect of the physics world
- Author:
- Daniel Murphy
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInterface that allows the serializer to look up tags for each object, which can be used later during deserializing by the developer. -
Method Summary
Modifier and TypeMethodDescriptionSerializes a shapeSerializes a bodySerializes a fixtureSerializes joints.Serializes the worldvoidSets the object signer for the serializer.voidsetUnsupportedListener(UnsupportedListener listener) Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.
-
Method Details
-
setObjectSigner
Sets the object signer for the serializer. This allows the user to specify a 'tag' for each main physics object, which is then referenced later at deserialization for the user. -
setUnsupportedListener
Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception. -
serialize
Serializes the world- Parameters:
world- * @throws UnsupportedObjectException if a physics object is unsupported by this library.- Throws:
UnsupportedObjectException- See Also:
-
serialize
Serializes a body- Parameters:
body- * @throws UnsupportedObjectException if a physics object is unsupported by this library.- Throws:
UnsupportedObjectException- See Also:
-
serialize
Serializes a fixture- Parameters:
fixture- * @throws UnsupportedObjectException if a physics object is unsupported by this library.- Throws:
UnsupportedObjectException- See Also:
-
serialize
Serializes a shape- Parameters:
shape- * @throws UnsupportedObjectException if a physics object is unsupported by this library.- Throws:
UnsupportedObjectException- See Also:
-
serialize
SerializationResult serialize(Joint joint, Map<Body, Integer> bodyIndexMap, Map<Joint, Integer> jointIndexMap) Serializes joints. Joints need to reference bodies and sometimes other joints.
-