group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
DroppedWeaponSystem.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
8
9#include <glm/vec3.hpp>
10
11namespace systems
12{
13
15constexpr float k_droppedWeaponLifetime = 30.0f;
16
19constexpr float k_swapDropPickupDelay = 0.8f;
20
26{
27 glm::vec3 pos{0.0f};
28 glm::vec3 vel{0.0f};
30 float pickupDelay = 0.0f;
31};
32
44 Registry& registry, glm::vec3 pos, glm::vec3 initialVel, const GunInstance& gun, float pickupDelay);
45
49void runDroppedWeapons(Registry& registry, float dt);
50
51} // namespace systems
Shared ECS registry type alias for the game engine.
entt::registry Registry
Shared ECS registry type alias.
Definition Registry.hpp:11
Weapon state component for armed entities.
Client-only input sampling system — split into two halves so mouse look can run every iterate() (smoo...
Definition DebugUI.hpp:15
void spawnDroppedWeapon(Registry &registry, glm::vec3 pos, glm::vec3 initialVel, const GunInstance &gun, float pickupDelay)
Spawn an in-world dropped-weapon pickup carrying a gun's ammo.
Definition DroppedWeaponSystem.cpp:26
constexpr float k_droppedWeaponLifetime
Default lifetime (seconds) for a dropped weapon before it despawns.
Definition DroppedWeaponSystem.hpp:15
void runDroppedWeapons(Registry &registry, float dt)
Tick dropped weapons: handle pickup (overlap-refill or look+F replace) and despawn timer.
Definition DroppedWeaponSystem.cpp:139
constexpr float k_swapDropPickupDelay
Pickup-immunity applied to a weapon dropped during a swap, so the player can't instantly re-grab the ...
Definition DroppedWeaponSystem.hpp:19
Struct that defines this weapon's type, cooldown, and ammo.
Definition WeaponState.hpp:40
A weapon drop queued during view iteration, spawned afterward.
Definition DroppedWeaponSystem.hpp:26
glm::vec3 pos
Definition DroppedWeaponSystem.hpp:27
float pickupDelay
Definition DroppedWeaponSystem.hpp:30
glm::vec3 vel
Definition DroppedWeaponSystem.hpp:28
GunInstance gun
Definition DroppedWeaponSystem.hpp:29