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

Method ApplyForceToCenter

DynamicsB2Body.go:376–389  ·  view source on GitHub ↗
(force B2Vec2, wake bool)

Source from the content-addressed store, hash-verified

374}
375
376func (body *B2Body) ApplyForceToCenter(force B2Vec2, wake bool) {
377 if body.M_type != B2BodyType.B2_dynamicBody {
378 return
379 }
380
381 if wake && (body.M_flags&B2Body_Flags.E_awakeFlag) == 0 {
382 body.SetAwake(true)
383 }
384
385 // Don't accumulate a force if the body is sleeping
386 if (body.M_flags & B2Body_Flags.E_awakeFlag) != 0x0000 {
387 body.M_force.OperatorPlusInplace(force)
388 }
389}
390
391func (body *B2Body) ApplyTorque(torque float64, wake bool) {
392 if body.M_type != B2BodyType.B2_dynamicBody {

Callers

nothing calls this directly

Calls 2

SetAwakeMethod · 0.95
OperatorPlusInplaceMethod · 0.45

Tested by

no test coverage detected