group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
TracerEffect Class Reference

Manages oriented-capsule tracers for fast-bullet projectile entities. More...

#include <TracerEffect.hpp>

Public Member Functions

void update (float dt, Registry &registry)
 Update all live tracers.
 
void attach (entt::entity e, Registry &registry)
 Attach a new tracer to a projectile entity.
 
void detach (entt::entity e)
 Detach the tracer from an entity (entity dying); tracer fades out.
 
void spawnFree (glm::vec3 tip, glm::vec3 tail, float lifetime=0.12f)
 Spawn a standalone one-shot tracer streak not tied to any ECS entity.
 
const TracerParticledata () const
 
uint32_t count () const
 

Detailed Description

Manages oriented-capsule tracers for fast-bullet projectile entities.

Each frame, update() polls registry entities with TracerEmitter components and updates the tip/tail of their associated TracerParticle.

Member Function Documentation

◆ attach()

void TracerEffect::attach ( entt::entity  e,
Registry registry 
)

Attach a new tracer to a projectile entity.

Parameters
eEntity handle of the projectile.
registryECS registry to read Position and TracerEmitter from.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ count()

uint32_t TracerEffect::count ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ data()

const TracerParticle * TracerEffect::data ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ detach()

void TracerEffect::detach ( entt::entity  e)

Detach the tracer from an entity (entity dying); tracer fades out.

Parameters
eEntity handle being destroyed.
Here is the call graph for this function:

◆ spawnFree()

void TracerEffect::spawnFree ( glm::vec3  tip,
glm::vec3  tail,
float  lifetime = 0.12f 
)

Spawn a standalone one-shot tracer streak not tied to any ECS entity.

Parameters
tipWorld-space hit/end point.
tailWorld-space origin/start point.
lifetimeSeconds before the streak fully fades.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void TracerEffect::update ( float  dt,
Registry registry 
)

Update all live tracers.

Registry is used to read projectile positions.

Parameters
dtFrame delta time in seconds.
registryECS registry containing TracerEmitter entities.
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: