add Space::clear() method

This commit is contained in:
Andrew Meadows 2018-03-01 12:09:28 -08:00
parent 67c78a2df1
commit 18a6ac057a
2 changed files with 6 additions and 1 deletions

View file

@ -20,6 +20,11 @@
using namespace workload;
void Space::clear() {
_proxies.clear();
_freeIndices.clear();
}
int32_t Space::createProxy(const Space::Sphere& newSphere) {
if (_freeIndices.empty()) {
_proxies.emplace_back(Space::Proxy(newSphere));

View file

@ -70,6 +70,7 @@ public:
Space() {}
void clear();
int32_t createProxy(const Sphere& sphere);
void deleteProxies(const std::vector<int32_t>& deadIndices);
void updateProxies(const std::vector<ProxyUpdate>& changedProxies);
@ -79,7 +80,6 @@ public:
uint32_t getNumAllocatedProxies() const { return (uint32_t)(_proxies.size()); }
void categorizeAndGetChanges(std::vector<Change>& changes);
uint32_t copyProxyValues(Proxy* proxies, uint32_t numDestProxies);
private: