On this page
  1. Fields

rmp::behavior::Lifespan

behavior #include <rmp/behavior.h> include/rmp/behavior.h:458
struct Lifespan

Discarded after N seconds. Particles, bullets.

Added to an object with add<rmp::behavior::Lifespan>(); the framework calls its _update with the object it is on.

Fields

FieldTypeDefaultWhat it is
secondsfloat1

How long the object lasts before it is destroyed

oursstruct { … }

What it is keeping track of. Readable, because sometimes you want it; not yours to write. It is one PUBLIC member and not a private block because a struct with a private member is not an aggregate in C++20, and then { .speed = 320 } stops compiling — which is the whole design. The name is the fence.