raisim::ProjectileProperties
struct · #include <raisim/Explosion.hpp>
A ballistic projectile: a shell, a bullet, a rocket after burnout. It flies through the world's fluids: drag acts on its velocity relative to the fluid around it, so the wind (the velocity of the ambient fluid, World::setAmbientFluid()) carries it and its density sets how hard the air holds it back; in a volume of liquid (World::addFluidVolume(), below its mean surface) the liquid's density and current do. A world without an ambient fluid is a vacuum. An explosive projectile (explosion.chargeMass > 0) detonates where it hits or when its fuse runs out; an inert one stops where it hits. Either hands its momentum to a dynamic body it hits.
Public attributes
mass
double massMass (kg).
radius
double radiusRadius (m) of its cross section, which sets its drag area.
dragCoefficient
double dragCoefficientDrag coefficient of its cross section (about 0.3 for a shell at subsonic speed).
maxLifetime
double maxLifetimeSeconds after launch at which the projectile is removed if it has hit nothing.
fuseTime
double fuseTimeSeconds after launch at which it detonates in flight; zero or negative: no time fuse.
detonateOnImpact
bool detonateOnImpactAn explosive projectile detonates where it hits something; otherwise it stops there. Either way it hands what it hits the momentum an inelastic impact transfers: the projectile's velocity times the reduced mass of the projectile and the body it hits.
explosion
ExplosionProperties explosionThe explosion it sets off; a chargeMass of zero makes an inert projectile.
collisionMask
CollisionGroup collisionMaskCollision groups the projectile hits.
ignoredObject
size_t ignoredObjectWorld index (Object::getIndexInWorld()) of an object it passes through, such as the vehicle that fired it; size_t(-1) for none.