raisim::RayCollisionList
class · #include <raisim/rayCollision.hpp>
Hit list returned by World::rayTest(). Only the first size() entries are valid; the storage is reused by the next ray test.
Nested classes
classbasic_iterator — Forward iterator over the valid hits (const or mutable).
Public types
iterator
using iterator = basic_iterator<false>Mutable hit iterator.
const_iterator
using const_iterator = basic_iterator<true>Const hit iterator.
Public member functions
operator[]
RayCollisionItem &operator[](size_t i)Access an item by index.
Parameters
| Parameter | Description |
|---|---|
i (in) | Index into the hit list. Not bounds-checked; only indices below size() hold valid hits. |
Returns Hit entry at the given index.
const RayCollisionItem &operator[](size_t i) constAccess an item by index.
Parameters
| Parameter | Description |
|---|---|
i (in) | Index into the hit list. |
Returns Hit entry at the given index.
size
size_t size() constReturns Number of valid hits.
begin
iterator begin()Returns Iterator to the first hit.
const_iterator begin() constReturns const iterator to the first hit
end
iterator end()Returns Iterator past the last hit.
const_iterator end() constReturns const iterator past the last hit
cbegin
const_iterator cbegin() constReturns const iterator to the first hit
cend
const_iterator cend() constReturns const iterator past the last hit
back
iterator back()Returns Iterator to the last hit (a null iterator if the list is empty).
const_iterator back() constReturns const iterator to the last hit (a null iterator if the list is empty)
setSize
void setSize(size_t size)Set the number of valid hits in the list.
Parameters
| Parameter | Description |
|---|---|
size (in) | Number of hits, clamped to the storage size. |
resize
void resize(size_t size)Resize the storage for hit entries.
Parameters
| Parameter | Description |
|---|---|
size (in) | New storage size. |
reserve
void reserve(size_t size)Reserve storage for hit entries.
Parameters
| Parameter | Description |
|---|---|
size (in) | Capacity to reserve. |