remove const from CollisionList subscript operator

This commit is contained in:
Andrew Meadows 2014-04-22 10:48:05 -07:00
parent 7cb6856415
commit a45bc6c110
3 changed files with 7 additions and 4 deletions

View file

@ -707,7 +707,7 @@ bool findCapsulePenetrationOp(OctreeElement* node, void* extraData) {
} }
bool findShapeCollisionsOp(OctreeElement* node, void* extraData) { bool findShapeCollisionsOp(OctreeElement* node, void* extraData) {
const ShapeArgs* args = static_cast<ShapeArgs*>(extraData); ShapeArgs* args = static_cast<ShapeArgs*>(extraData);
// coarse check against bounds // coarse check against bounds
AABox cube = node->getAABox(); AABox cube = node->getAABox();
@ -719,7 +719,10 @@ bool findShapeCollisionsOp(OctreeElement* node, void* extraData) {
return true; // recurse on children return true; // recurse on children
} }
if (node->hasContent()) { if (node->hasContent()) {
return ShapeCollider::collideShapeWithAACube(args->shape, cube.calcCenter(), cube.getScale(), args->collisions); if (ShapeCollider::collideShapeWithAACube(args->shape, cube.calcCenter(), cube.getScale(), args->collisions)) {
args->found = true;
return true;
}
} }
return false; return false;
} }

View file

@ -48,6 +48,6 @@ void CollisionList::clear() {
_size = 0; _size = 0;
} }
const CollisionInfo* CollisionList::operator[](int index) const { CollisionInfo* CollisionList::operator[](int index) {
return (index > -1 && index < _size) ? &(_collisions[index]) : NULL; return (index > -1 && index < _size) ? &(_collisions[index]) : NULL;
} }

View file

@ -95,7 +95,7 @@ public:
/// Clear valid collisions. /// Clear valid collisions.
void clear(); void clear();
const CollisionInfo* operator[](int index) const; CollisionInfo* operator[](int index);
private: private:
int _maxSize; // the container cannot get larger than this int _maxSize; // the container cannot get larger than this