NewtonCollision* NewtonCreateCollisionFromSerialization (const NewtonWorld* newtonWorld, NewtonDeserialize deserializeFunction, void* serializeHandle);
Create a collision shape via a serialization function.
- const NewtonWorld *newtonWorld - is the pointer to the Newton world.
- NewtonDeserialize deserializeFunction - pointer to the callback function that will handle the serialization.
- void* serializeHandle - user data that will be passed as the argument to NewtonDeserialize callback.
- Small and medium size collision objects (under 50000 polygons) can be constructed at application startup without significant processing overhead. However, for very large polygons sets (over 50000 polygons) it is recommended that the application serialize the collisions in an off-line tool. Then the application can call this function to de-serialize a collision from a file or any file packer system the application is using that was created with NewtonCollisionSerialize.
- Binary format of serialized data may change between different versions and builds of Newton but is identical on platforms using same cpu arhitecture. Reading serialized data generated by a different version might not always work and may crash newton, newton does not check for consistiency of serialized data during de-serialization.