Skip to content

raisim::ProjectileHit ​

struct · #include <raisim/Explosion.hpp>

A projectile striking an object.

Public attributes ​

id ​

cpp
size_t id

Increasing identifier, unique within the world.

projectileId ​

cpp
size_t projectileId

Identifier of the projectile.

objectIndex ​

cpp
size_t objectIndex

World index of the object hit (Object::getIndexInWorld() when it happened).

localIdx ​

cpp
size_t localIdx

Local body index of the body hit within that object.

position ​

cpp
Vec<3> position

Point of impact in the world frame (m).

normal ​

cpp
Vec<3> normal

Surface normal at the point of impact, pointing toward the side the projectile came from.

velocity ​

cpp
Vec<3> velocity

Velocity of the projectile at impact (m/s).

mass ​

cpp
double mass

Mass of the projectile (kg).

time ​

cpp
double time

World time of the impact (s).

detonated ​

cpp
bool detonated

The projectile detonated there.

RaiSim — physics for robotics and AI.