MCPcopy Create free account
hub / github.com/ByteArena/box2d / SetAwake

Method SetAwake

DynamicsB2Body.go:294–306  ·  view source on GitHub ↗
(flag bool)

Source from the content-addressed store, hash-verified

292}
293
294func (body *B2Body) SetAwake(flag bool) {
295 if flag {
296 body.M_flags |= B2Body_Flags.E_awakeFlag
297 body.M_sleepTime = 0.0
298 } else {
299 body.M_flags &= ^B2Body_Flags.E_awakeFlag
300 body.M_sleepTime = 0.0
301 body.M_linearVelocity.SetZero()
302 body.M_angularVelocity = 0.0
303 body.M_force.SetZero()
304 body.M_torque = 0.0
305 }
306}
307
308func (body B2Body) IsAwake() bool {
309 return (body.M_flags & B2Body_Flags.E_awakeFlag) == B2Body_Flags.E_awakeFlag

Callers 15

SetLinearVelocityMethod · 0.95
SetAngularVelocityMethod · 0.95
SetSleepingAllowedMethod · 0.95
ApplyForceMethod · 0.95
ApplyForceToCenterMethod · 0.95
ApplyTorqueMethod · 0.95
ApplyLinearImpulseMethod · 0.95
ApplyAngularImpulseMethod · 0.95
SetTypeMethod · 0.95
DestroyJointMethod · 0.80
SetAllowSleepingMethod · 0.80

Calls 1

SetZeroMethod · 0.45

Tested by

no test coverage detected