optimize isLeaf() to just check the child mask instead of counting children

This commit is contained in:
ZappoMan 2014-03-19 13:15:28 -07:00
parent f3bd8925d9
commit adaa01c13e

View file

@ -126,7 +126,7 @@ public:
float distanceSquareToPoint(const glm::vec3& point) const; // when you don't need the actual distance, use this.
float distanceToPoint(const glm::vec3& point) const;
bool isLeaf() const { return getChildCount() == 0; }
bool isLeaf() const { return _childBitmask == 0; }
int getChildCount() const { return numberOfOnes(_childBitmask); }
void printDebugDetails(const char* label) const;
bool isDirty() const { return _isDirty; }