mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 16:23:16 +02:00
remove const from CollisionList subscript operator
This commit is contained in:
parent
7cb6856415
commit
a45bc6c110
3 changed files with 7 additions and 4 deletions
|
@ -707,7 +707,7 @@ bool findCapsulePenetrationOp(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
|
||||
AABox cube = node->getAABox();
|
||||
|
@ -719,7 +719,10 @@ bool findShapeCollisionsOp(OctreeElement* node, void* extraData) {
|
|||
return true; // recurse on children
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,6 @@ void CollisionList::clear() {
|
|||
_size = 0;
|
||||
}
|
||||
|
||||
const CollisionInfo* CollisionList::operator[](int index) const {
|
||||
CollisionInfo* CollisionList::operator[](int index) {
|
||||
return (index > -1 && index < _size) ? &(_collisions[index]) : NULL;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
/// Clear valid collisions.
|
||||
void clear();
|
||||
|
||||
const CollisionInfo* operator[](int index) const;
|
||||
CollisionInfo* operator[](int index);
|
||||
|
||||
private:
|
||||
int _maxSize; // the container cannot get larger than this
|
||||
|
|
Loading…
Reference in a new issue