mirror of
https://github.com/overte-org/overte.git
synced 2025-06-28 21:30:13 +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) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue