Exemple #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))
}
Exemple #2
0
func (s *Shape) SetCollisionType(ctype uint) {
	s.CPShape.collision_type = C.cpCollisionType(ctype)
}
Exemple #3
0
// c converts CollisionType to c.cpCollisionType.
func (c CollisionType) c() C.cpCollisionType {
	return C.cpCollisionType(c)
}
Exemple #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))
}
Exemple #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))
}