// SpaceNew creates a new space. func SpaceNew() Space { s := Space(unsafe.Pointer(C.cpSpaceNew())) spaceDataMap[s] = &spaceData{} postStepCallbackMap[s] = make(map[interface{}]func(Space, interface{})) collisionHandlerMap[s] = make(map[collisionTypePair]collisionHandler) return s }
// SpaceNew creates a new space. func SpaceNew() *Space { s := Space(Pointer(C.cpSpaceNew())) m := make(map[interface{}]func(*Space, interface{})) postStepCallbackMap[s] = &m return &s }
func NewSpace() *Space { var cpspace *C.cpSpace = C.cpSpaceNew() return &Space{cpspace, nil} }
func NewSpace() Space { return Space{s: C.cpSpaceNew()} }
// Allocate and initialize a Space. func NewSpace() *Space { space := new(Space) space.ptr = C.cpSpaceNew() return space }