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

Method SetFixedRotation

DynamicsB2Body.go:915–931  ·  view source on GitHub ↗
(flag bool)

Source from the content-addressed store, hash-verified

913}
914
915func (body *B2Body) SetFixedRotation(flag bool) {
916 status := (body.M_flags & B2Body_Flags.E_fixedRotationFlag) == B2Body_Flags.E_fixedRotationFlag
917
918 if status == flag {
919 return
920 }
921
922 if flag {
923 body.M_flags |= B2Body_Flags.E_fixedRotationFlag
924 } else {
925 body.M_flags &= ^B2Body_Flags.E_fixedRotationFlag
926 }
927
928 body.M_angularVelocity = 0.0
929
930 body.ResetMassData()
931}
932
933func (body *B2Body) Dump() {
934 bodyIndex := body.M_islandIndex

Callers

nothing calls this directly

Calls 1

ResetMassDataMethod · 0.95

Tested by

no test coverage detected