Example #1
0
func cToSpace(c C.dSpaceID) Space {
	base := SpaceBase(unsafe.Pointer(c))
	var s Space
	switch int(C.dSpaceGetClass(c)) {
	case SimpleSpaceClass:
		s = SimpleSpace{base}
	case HashSpaceClass:
		s = HashSpace{base}
	case QuadTreeSpaceClass:
		s = QuadTreeSpace{base}
	case SweepAndPruneSpaceClass:
		s = SweepAndPruneSpace{base}
	default:
		s = base
	}
	return s
}
Example #2
0
// Class returns the space class.
func (s SpaceBase) Class() int {
	return int(C.dSpaceGetClass(s.c()))
}