NewtonCreateCollisionFromSerialization

From Newton Wiki
Revision as of 08:02, 10 June 2019 by WikiSysop (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NewtonCreateCollisionFromSerialization

NewtonCollision* NewtonCreateCollisionFromSerialization (const NewtonWorld* newtonWorld, NewtonDeserialize deserializeFunction, void* serializeHandle);

Usage

Create a collision shape via a serialization function.

Parameters

  • 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.

Return

  • Nothing.

Remarks

  • 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.

See also

NewtonCollisionSerialize NewtonCollisionGetInfo