Skip to content

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 ​

  • class basic_iterator — Forward iterator over the valid hits (const or mutable).

Public types ​

iterator ​

cpp
using iterator = basic_iterator<false>

Mutable hit iterator.

const_iterator ​

cpp
using const_iterator = basic_iterator<true>

Const hit iterator.

Public member functions ​

operator[] ​

cpp
RayCollisionItem &operator[](size_t i)

Access an item by index.

Parameters

ParameterDescription
i (in)Index into the hit list. Not bounds-checked; only indices below size() hold valid hits.

Returns Hit entry at the given index.

cpp
const RayCollisionItem &operator[](size_t i) const

Access an item by index.

Parameters

ParameterDescription
i (in)Index into the hit list.

Returns Hit entry at the given index.

size ​

cpp
size_t size() const

Returns Number of valid hits.

begin ​

cpp
iterator begin()

Returns Iterator to the first hit.

cpp
const_iterator begin() const

Returns const iterator to the first hit

end ​

cpp
iterator end()

Returns Iterator past the last hit.

cpp
const_iterator end() const

Returns const iterator past the last hit

cbegin ​

cpp
const_iterator cbegin() const

Returns const iterator to the first hit

cend ​

cpp
const_iterator cend() const

Returns const iterator past the last hit

back ​

cpp
iterator back()

Returns Iterator to the last hit (a null iterator if the list is empty).

cpp
const_iterator back() const

Returns const iterator to the last hit (a null iterator if the list is empty)

setSize ​

cpp
void setSize(size_t size)

Set the number of valid hits in the list.

Parameters

ParameterDescription
size (in)Number of hits, clamped to the storage size.

resize ​

cpp
void resize(size_t size)

Resize the storage for hit entries.

Parameters

ParameterDescription
size (in)New storage size.

reserve ​

cpp
void reserve(size_t size)

Reserve storage for hit entries.

Parameters

ParameterDescription
size (in)Capacity to reserve.

RaiSim — physics for robotics and AI.