Difference between pages "NewtonWorldListenerGetBodyDestroyCallback" and "NewtonBodySetCollision"

From Newton Wiki
(Difference between pages)
Jump to: navigation, search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
== NewtonWorldListenerGetBodyDestroyCallback ==
+
== NewtonBodySetCollision ==
  
  NewtonWorldListenerBodyDestroyCallback NewtonWorldListenerGetBodyDestroyCallback (const NewtonWorld* const newtonWorld, void* const listener)
+
  void NewtonBodySetCollision( const NewtonBody* bodyPtr, const NewtonCollision* collisionPtr)
  
 
== Usage ==
 
== Usage ==
  
Returns pointer to currently set body destroy callback for a listener, that was set via [[NewtonWorldListenerSetBodyDestroyCallback]].
+
Assign a collision primitive to the body.
  
 
== Parameters ==
 
== Parameters ==
  
* const NewtonWorld* const newtonWorld - instance of newton world
+
* const NewtonBody *bodyPtr - pointer to the body.
* void* const listener - pointer to a listener created with [[NewtonWorldAddListener]]
+
* const collisionPtr *collisionPtr - pointer to the new collision geometry.
  
 
== Return ==
 
== Return ==
* NewtonWorldListenerBodyDestroyCallback pointer
+
* Nothing.
 
 
== Description ==
 
  
 +
== Remarks ==
 +
* This function replaces a collision geometry of a body with the new collision geometry. This function increments the reference count of the collision geometry and decrements the reference count of the old collision geometry. If the reference count of the old collision geometry reaches zero, the old collision geometry is destroyed. This function can be used to swap the collision geometry of bodies at runtime.
  
 
== See also ==
 
== See also ==
 +
[[NewtonCreateBody]]
 +
[[NewtonBodyGetCollision]]
  
[[NewtonWorldAddListener]], [[NewtonWorldGetListenerUserData]], [[NewtonWorldListenerDebug]], [[NewtonWorldListenerGetBodyDestroyCallback]], [[NewtonWorldListenerSetBodyDestroyCallback]], [[NewtonWorldListenerSetDebugCallback]], [[NewtonWorldListenerSetDestroctorCallback]], [[NewtonWorldListenerSetPostUpdateCallback]], [[NewtonWorldListenerSetPreUpdateCallback]]
+
[[Category:body manipulation functions]] [[Category:Newton Functions]] [[Category:Newton 3 Functions]] [[Category:Collision shape functions]]
 
 
[[Category:Newton World Control Functions]] [[Category:Newton Functions]] [[Category:Newton 3 Functions]] [[Category:World functions]] [[Category:body manipulation functions]] [[Category:World listener functions]]
 

Latest revision as of 08:02, 10 June 2019

NewtonBodySetCollision

void NewtonBodySetCollision( const NewtonBody* bodyPtr, const NewtonCollision* collisionPtr)

Usage

Assign a collision primitive to the body.

Parameters

  • const NewtonBody *bodyPtr - pointer to the body.
  • const collisionPtr *collisionPtr - pointer to the new collision geometry.

Return

  • Nothing.

Remarks

  • This function replaces a collision geometry of a body with the new collision geometry. This function increments the reference count of the collision geometry and decrements the reference count of the old collision geometry. If the reference count of the old collision geometry reaches zero, the old collision geometry is destroyed. This function can be used to swap the collision geometry of bodies at runtime.

See also

NewtonCreateBody NewtonBodyGetCollision