NewtonBodySetFreezeState

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

NewtonBodySetFreezeState

Syntax:

void NewtonBodySetFreezeState (const NewtonBody* body, int state)

Usage

Set the Freeze state of the body.

Parameters

  • const NewtonBody *bodyPtr - pointer to the body.
  • int state - Freeze state. 1 to freeze . 0 to unfrezze.

Description

When a body is set to freeze state, the body and all the other bodies associated with that body are also set to same freeze state, so the entire "island" of objects is frozen in space.

Each body still gets Force and Torque callback, which makes is easy to inspect the body and to see if it has to be unfrozen.

If some other body collide or is connected to a frozen body, the entire island become dynamic again, but only while they are connected to an non-frozen body. When they lose the contact they become frozen again.

See also

NewtonBodyGetSleepState NewtonBodyGetAutoSleep NewtonBodySetAutoSleep NewtonBodyGetFreezeState