// RemoveCollisionHandler unsets a collision handler. func (s *Space) RemoveCollisionHandler(a CollisionType, b CollisionType) { C.cpSpaceRemoveCollisionHandler(s.c(), C.cpCollisionType(a), C.cpCollisionType(b)) }
func (s *Shape) SetCollisionType(ctype uint) { s.CPShape.collision_type = C.cpCollisionType(ctype) }
// c converts CollisionType to c.cpCollisionType. func (c CollisionType) c() C.cpCollisionType { return C.cpCollisionType(c) }
func (s *Space) AddSeparateCollisionHandler(typeA uint, typeB uint, data interface{}, handler CollisionHandler) { h := CollisionHandlerData{s, data, handler} uglyassshit = append(uglyassshit, &h) C.cpgoSpaceAddSeparateCollisionHandler(s.CPSpace, C.cpCollisionType(typeA), C.cpCollisionType(typeB), unsafe.Pointer(&h)) }
// RemoveCollisionHandler unsets a collision handler. func (s Space) RemoveCollisionHandler(a CollisionType, b CollisionType) { colTypes := collisionTypePair{a, b} delete(collisionHandlerMap[s], colTypes) C.cpSpaceRemoveCollisionHandler(s.c(), C.cpCollisionType(a), C.cpCollisionType(b)) }