예제 #1
0
// RemoveCollisionHandler unsets a collision handler.
func (s *Space) RemoveCollisionHandler(a CollisionType, b CollisionType) {
	C.cpSpaceRemoveCollisionHandler(s.c(), C.cpCollisionType(a), C.cpCollisionType(b))
}
예제 #2
0
func (s *Shape) SetCollisionType(ctype uint) {
	s.CPShape.collision_type = C.cpCollisionType(ctype)
}
예제 #3
0
// c converts CollisionType to c.cpCollisionType.
func (c CollisionType) c() C.cpCollisionType {
	return C.cpCollisionType(c)
}
예제 #4
0
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))
}
예제 #5
0
// 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))
}