mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +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;
|
||||
}
|
||||
|
||||
const CollisionInfo* CollisionList::operator[](int index) const {
|
||||
return (index > -1 && index < _size) ? &(_collisions[index]) : NULL;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,8 @@ public:
|
|||
/// Clear valid collisions.
|
||||
void clear();
|
||||
|
||||
const CollisionInfo* operator[](int index) const;
|
||||
|
||||
private:
|
||||
int _maxSize; // the container cannot get larger than this
|
||||
int _size; // the current number of valid collisions in the list
|
||||
|
|
Loading…
Reference in a new issue