mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
add subscript operator for CollisionList
This commit is contained in:
parent
1782e803c9
commit
63c02f2b04
2 changed files with 5 additions and 0 deletions
|
@ -48,3 +48,6 @@ void CollisionList::clear() {
|
||||||
_size = 0;
|
_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CollisionInfo* CollisionList::operator[](int index) const {
|
||||||
|
return (index > -1 && index < _size) ? &(_collisions[index]) : NULL;
|
||||||
|
}
|
||||||
|
|
|
@ -95,6 +95,8 @@ public:
|
||||||
/// Clear valid collisions.
|
/// Clear valid collisions.
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
const CollisionInfo* operator[](int index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _maxSize; // the container cannot get larger than this
|
int _maxSize; // the container cannot get larger than this
|
||||||
int _size; // the current number of valid collisions in the list
|
int _size; // the current number of valid collisions in the list
|
||||||
|
|
Loading…
Reference in a new issue