NewtonCreateCylinder

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

NewtonCreateCylinder

Syntax:

NewtonCollision* NewtonCreateCylinder( const NewtonWorld* newtonWorld, dFloat radius, dFloat height,int shapeID, const dFloat *offsetMatrix)

Usage

Creates a cylindrical collision primitive.

Parameters

  • const NewtonWorld *newtonWorld - is the pointer to the Newton world.
  • dFloat radius - cylinder radius at the base.
  • dFloat height - cylinder height along the x local axis.
  • int shapeID - shape ID
  • const dFloat *offsetMatrix - pointer to an array of 16 floats containing the offset matrix of the box relative to the body. If this parameter is NULL, then the primitive is centered at the origin of the body.

Return

  • pointer to the cylinder object.

Remarks

  • Newton orients the height of cylinders along the X axis
  • 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