From Newton Wiki
Jump to: navigation, search



NewtonCollision* NewtonCreateSphere( const NewtonWorld* newtonWorld, dFloat radiusX, dFloat radiusY, dFloat radiusZ, const dFloat *offsetMatrix)


Create a generalized ellipsoid primitive.


  • const NewtonWorld *newtonWorld - pointer to the Newton world.
  • dFloat radiusX - sphere radius along X axis.
  • dFloat radiusY - sphere radius along Y axis.
  • dFloat radiusZ - sphere radius along Z axis.
  • const dFloat *offsetMatrix - pointer to an array of 16 floats containing the offset matrix of the sphere relative to the * body. If this parameter is NULL then the sphere is centered at the origin of the body.


  • Pointer to the generalized sphere.


  • Sphere collision are generalized ellipsoids, the application can create many different kind of objects by just playing with dimensions of the radius. for example to make a sphere set all three radii to the same value, to make a ellipse of revolution just set two of the three radii to the same value.
  • General ellipsoids are very good hull geometries to represent the outer shell of avatars in a game.
  • Collision primitives are reference counted objects. The application should call NewtonReleaseCollision in order to release references to the object. Neglecting to release references to collision primitives is a common cause of memory leaks. Collision primitives can be reused with more than one body. This will reduce the amount of memory used be the engine, as well as speed up some calculations.

See also

NewtonReleaseCollisionNewtonCreateConvexHullModifier Newton SDK API reference#Category:convex_collision_primitives_creation_functions