group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
Projectile Struct Reference

Component attached to projectile entities. More...

#include <Projectile.hpp>

Public Attributes

WeaponType type = WeaponType::Rifle
 Weapon that spawned this projectile.
float damage = 0.0f
 Damage dealt on hit.
entt::entity owner = entt::null
 Entity that fired this projectile.
bool explosive = false
 True if the projectile detonates on impact.
float currentLifeTime = 0.0f
 Seconds since spawn (destroyed when exceeding max).
float fuseTimer = -1.0f
 Countdown; <0 means no fuse (impact-only).
float bounceRestitution = 0.0f
 0 = no bounce. CollisionSystem reflects velocity * this on hit.
bool sticky = false
 If true, sets vel=0 on first surface hit and starts fuse.
bool stuck = false
 True once attached to a surface or player.
entt::entity stuckTo = entt::null
 Player this grenade is stuck to, or null (world).
glm::vec3 stuckOffset {0.0f}
 Offset from the host's origin at stick time.
glm::vec3 tint = {1.0f, 1.0f, 1.0f}
 Render tint multiplier (cosmetic, client-side).

Detailed Description

Component attached to projectile entities.

Velocity comes from the entity's Velocity component. World position comes from the entity's Position component.

Member Data Documentation

◆ bounceRestitution

float Projectile::bounceRestitution = 0.0f

0 = no bounce. CollisionSystem reflects velocity * this on hit.

◆ currentLifeTime

float Projectile::currentLifeTime = 0.0f

Seconds since spawn (destroyed when exceeding max).

◆ damage

float Projectile::damage = 0.0f

Damage dealt on hit.

◆ explosive

bool Projectile::explosive = false

True if the projectile detonates on impact.

◆ fuseTimer

float Projectile::fuseTimer = -1.0f

Countdown; <0 means no fuse (impact-only).

◆ owner

entt::entity Projectile::owner = entt::null

Entity that fired this projectile.

◆ sticky

bool Projectile::sticky = false

If true, sets vel=0 on first surface hit and starts fuse.

◆ stuck

bool Projectile::stuck = false

True once attached to a surface or player.

◆ stuckOffset

glm::vec3 Projectile::stuckOffset {0.0f}

Offset from the host's origin at stick time.

◆ stuckTo

entt::entity Projectile::stuckTo = entt::null

Player this grenade is stuck to, or null (world).

◆ tint

glm::vec3 Projectile::tint = {1.0f, 1.0f, 1.0f}

Render tint multiplier (cosmetic, client-side).

◆ type

WeaponType Projectile::type = WeaponType::Rifle

Weapon that spawned this projectile.


The documentation for this struct was generated from the following file: