(flag bool)
| 874 | } |
| 875 | |
| 876 | func (body *B2Body) SetActive(flag bool) { |
| 877 | |
| 878 | B2Assert(body.M_world.IsLocked() == false) |
| 879 | |
| 880 | if flag == body.IsActive() { |
| 881 | return |
| 882 | } |
| 883 | |
| 884 | if flag { |
| 885 | body.M_flags |= B2Body_Flags.E_activeFlag |
| 886 | |
| 887 | // Create all proxies. |
| 888 | broadPhase := &body.M_world.M_contactManager.M_broadPhase |
| 889 | for f := body.M_fixtureList; f != nil; f = f.M_next { |
| 890 | f.CreateProxies(broadPhase, body.M_xf) |
| 891 | } |
| 892 | |
| 893 | // Contacts are created the next time step. |
| 894 | } else { |
| 895 | body.M_flags &= ^B2Body_Flags.E_activeFlag |
| 896 | |
| 897 | // Destroy all proxies. |
| 898 | broadPhase := &body.M_world.M_contactManager.M_broadPhase |
| 899 | for f := body.M_fixtureList; f != nil; f = f.M_next { |
| 900 | f.DestroyProxies(broadPhase) |
| 901 | } |
| 902 | |
| 903 | // Destroy the attached contacts. |
| 904 | ce := body.M_contactList |
| 905 | for ce != nil { |
| 906 | ce0 := ce |
| 907 | ce = ce.Next |
| 908 | body.M_world.M_contactManager.Destroy(ce0.Contact) |
| 909 | } |
| 910 | |
| 911 | body.M_contactList = nil |
| 912 | } |
| 913 | } |
| 914 | |
| 915 | func (body *B2Body) SetFixedRotation(flag bool) { |
| 916 | status := (body.M_flags & B2Body_Flags.E_fixedRotationFlag) == B2Body_Flags.E_fixedRotationFlag |
nothing calls this directly
no test coverage detected