NewtonUniversalSetUserCallback

From Newton Wiki
Jump to: navigation, search

NewtonUniversalSetUserCallback

void NewtonUniversalSetUserCallback( const NewtonJoint* Universal, NewtonUniversalCallBack callback)

Usage

Set an update call back to be called when either of the two body linked by the joint is active.

Parameters

  • const NewtonJoint *Universal - pointer to the joint.
  • NewtonUniversalCallBack callback - pointer to the joint function call back.

Return

  • nothing.

Remarks

  • if the application wants to have some feedback from the joint simulation, the application can register a function update callback to be called every time any of the bodies linked by this joint is active. This is useful to provide special effects like particles, sound or even to simulate breakable moving parts.
  • the function NewtonUniversalCallBack callback should return a bit field code. if the application does not want to set the joint acceleration the retur code is zero if the application only wants to change the joint linear acceleration the return code is 1 if the application only wants to change the joint angular acceleration the return code is 2 if the application only wants to change the joint angular and linear acceleration the return code is 3

See also

NewtonJointGetUserData NewtonJointSetUserData