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

Method ShouldCollide

DynamicsB2Body.go:824–841  ·  view source on GitHub ↗
(other *B2Body)

Source from the content-addressed store, hash-verified

822}
823
824func (body B2Body) ShouldCollide(other *B2Body) bool {
825
826 // At least one body should be dynamic.
827 if body.M_type != B2BodyType.B2_dynamicBody && other.M_type != B2BodyType.B2_dynamicBody {
828 return false
829 }
830
831 // Does a joint prevent collision?
832 for jn := body.M_jointList; jn != nil; jn = jn.Next {
833 if jn.Other == other {
834 if jn.Joint.IsCollideConnected() == false {
835 return false
836 }
837 }
838 }
839
840 return true
841}
842
843func (body *B2Body) SetTransform(position B2Vec2, angle float64) {
844 B2Assert(body.M_world.IsLocked() == false)

Callers

nothing calls this directly

Calls 1

IsCollideConnectedMethod · 0.65

Tested by

no test coverage detected