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

Method ApplyTorque

DynamicsB2Body.go:391–404  ·  view source on GitHub ↗
(torque float64, wake bool)

Source from the content-addressed store, hash-verified

389}
390
391func (body *B2Body) ApplyTorque(torque float64, wake bool) {
392 if body.M_type != B2BodyType.B2_dynamicBody {
393 return
394 }
395
396 if wake && (body.M_flags&B2Body_Flags.E_awakeFlag) == 0 {
397 body.SetAwake(true)
398 }
399
400 // Don't accumulate a force if the body is sleeping
401 if (body.M_flags & B2Body_Flags.E_awakeFlag) != 0x0000 {
402 body.M_torque += torque
403 }
404}
405
406func (body *B2Body) ApplyLinearImpulse(impulse B2Vec2, point B2Vec2, wake bool) {
407 if body.M_type != B2BodyType.B2_dynamicBody {

Callers

nothing calls this directly

Calls 1

SetAwakeMethod · 0.95

Tested by

no test coverage detected