19#ifdef USE_HYBRID_RENDERER
27#include <entt/entt.hpp>
56 static constexpr int k_physicsHz = 128;
57 static constexpr float k_physicsDt = 1.0f /
static_cast<float>(k_physicsHz);
58 static constexpr int k_maxTicksPerFrame = 8;
59 static constexpr int k_fpsHistorySize = 512;
62 SDL_Window* window =
nullptr;
64#ifdef USE_HYBRID_RENDERER
73 entt::dispatcher dispatcher;
76 float accumulator = 0.0f;
78 bool mouseCaptured =
true;
81 float mouseSensitivity = 0.001f;
82 bool renderSeparateFromPhysics =
true;
84 bool inputSyncedWithPhysics =
true;
86 bool limitFPSToMonitor =
true;
88 Uint64 softLimitPeriod = 0;
89 Uint64 softLimitNextFrame = 0;
94 void applyFrameRateLimit();
97 uint64_t frameCount = 0;
100 glm::vec3 cachedEye_{0.f, 100.f, 0.f};
101 glm::vec3 cachedCamFwd_{0.f, 0.f, 1.f};
102 float currentCameraRoll_{0.0f};
105 int wraithModelIdx = -1;
106 int glowSphereModelIdx_ = -1;
107 int movableSphereModelIdx_ = -1;
108 int weaponModelIndices_[4] = {-1, -1, -1, -1};
111 bool showDynLightUI_ =
false;
112 bool flashlightEnabled_ =
false;
113 float flashlightIntensity_ = 8.0f;
114 float flashlightRange_ = 800.0f;
115 float flashlightOffset_ = 30.0f;
116 bool movableSphereEnabled_ =
false;
117 float sphereFollowDist_ = 150.0f;
118 float sphereIntensity_ = 5.0f;
119 float sphereRange_ = 500.0f;
120 int glowCylinderModelIdx_ = -1;
121 bool beamEnabled_ =
false;
122 glm::vec3 beamStartOff_{30.0f, -5.0f, 10.0f};
123 glm::vec3 beamEndOff_{200.0f, -5.0f, 10.0f};
124 float beamRadius_ = 3.0f;
125 glm::vec3 beamColor_{0.6f, 0.1f, 1.0f};
126 float beamLightIntensity_ = 4.0f;
127 float beamLightRange_ = 300.0f;
128 float beamLightSpacing_ = 60.0f;
133 bool wasChargingRailgun_ =
false;
134 bool wasBeamActive_ =
false;
137 float hitmarkerTimer_ = 0.0f;
140 float vmScale = 0.03f;
141 float vmForward = 21.0f;
142 float vmRight = 5.5f;
143 float vmDown = 22.5f;
144 float vmYawOffset = 58.0f;
145 float vmPitchOffset = 12.0f;
146 float vmRollOffset = 2.0f;
147 bool showViewmodelUI =
false;
150 float prevSwayYaw_ = 0.0f;
151 float prevSwayPitch_ = 0.0f;
152 float swayOffsetX_ = 0.0f;
153 float swayOffsetY_ = 0.0f;
154 bool swayInitialized_ =
false;
157 float swayAmplitudeYaw_ = 3.0f;
158 float swayAmplitudePitch_ = 2.0f;
159 float swayDecayRate_ = 8.0f;
160 float swaySmoothing_ = 0.15f;
163 float recoilPitch_ = 0.0f;
164 float recoilPushBack_ = 0.0f;
165 float recoilRoll_ = 0.0f;
168 float localFireCooldown_ = 0.0f;
171 float crosshairSize_ = 6.0f;
172 float crosshairThickness_ = 2.0f;
173 float crosshairGap_ = 3.0f;
174 glm::vec4 crosshairColor_ = {0.0f, 1.0f, 0.0f, 0.85f};
175 bool crosshairDot_ =
true;
176 bool showCrosshair_ =
true;
179 int pendingScrollSwitch_ = 0;
183 int tpTuneWeaponIdx_ = 0;
184 bool showTPWeaponUI_ =
false;
192 float kRigScale_ = 1.0f;
193 float kRigVerticalOffset_ =
195 float rigMeshMinY_ = 0.0f;
198 float fpsHistory[k_fpsHistorySize] = {};
199 int fpsHistoryHead = 0;
200 int fpsHistoryCount = 0;
201 Uint64 prevRenderTime = 0;
204 float pingTimer = 0.0f;
207 Uint64 statsPrevTime = 0;
208 int statsPhysTicks = 0;
209 float measuredPhysicsHz = 0.0f;
210 float statsFPSCurrent = 0.0f;
211 float statsFPSMin = 0.0f;
212 float statsFPSMax = 0.0f;
213 float statsFPS1pLow = 0.0f;
214 float statsFPS5pLow = 0.0f;
222 void attachAnimatedCharacter(entt::entity e);
226 float countdownTimer = 0.0f;
Catalog of ozz animation clips shared across all animated entities.
ImGui panel for driving the animation state machine in development.
Shared skinned-character rig: skeleton, bind-pose mesh, skin weights.
TCP client for connecting to the game server.
Live ECS inspector overlay and debug windows powered by Dear ImGui.
Per-frame state recorder for diagnosing camera jitter and position glitches.
Routing layer between the legacy renderer and the new (in-progress) renderer.
Shared definitions for match status and state synchronization between server and clients.
MatchPhase
Definition MatchStatus.hpp:6
Network configuration loaded from config.toml at startup.
Top-level particle system orchestrator owning all effect sub-systems.
Shared ECS registry type alias for the game engine.
entt::registry Registry
Shared ECS registry type alias.
Definition Registry.hpp:11
Client-side sound effects system.
Pluggable skinning interface — phase-1 CPU LBS; GPU backend slots in later.
Per-weapon viewmodel, third-person, and recoil tuning parameters (header-only).
WeaponType
Weapon type — determines tracer style, damage, sound, and impact effects.
Definition WeaponState.hpp:10
@ Rifle
Fast hitscan/projectile (R301-style capsule tracer)
Collection of animation clips loaded on top of a shared skeleton.
Definition AnimationLibrary.hpp:55
Shared skinned rig — skeleton + bind-pose meshes + joint map.
Definition CharacterRig.hpp:42
TCP stream client — sends input to the server and receives state updates.
Definition Client.hpp:34
CPU Linear Blend Skinning — pure function; no state between calls.
Definition SkinningBackend.hpp:37
Forward-declared to avoid pulling in heavy particle headers.
Definition DebugUI.hpp:31
Records per-frame state to a timestamped directory on disk.
Definition FrameRecorder.hpp:56
Top-level client game object.
Definition Game.hpp:35
SDL_AppResult event(SDL_Event *event)
Forward an SDL event to ImGui and handle application-level keys.
Definition Game.cpp:337
void refreshRemoteProjectileRenderables()
Definition Game.cpp:1656
void quit()
Shut down all subsystems in reverse-init order.
Definition Game.cpp:1603
bool init()
Initialise all subsystems and spawn the local player entity.
Definition Game.cpp:44
void refreshRemotePlayerRenderables()
Definition Game.cpp:1617
SDL_AppResult iterate()
Advance one frame: sample input, step physics, render.
Definition Game.cpp:525
Definition HybridRenderer.hpp:18
Top-level particle system orchestrator.
Definition ParticleSystem.hpp:35
Forward-declared to avoid circular includes.
Definition Renderer.hpp:35
Client-side sound effects system.
Definition SfxSystem.hpp:28
SDL3 GPU forward PBR renderer with HDR pipeline and post-processing.
Persistent UI state for the Animation Tester panel.
Definition AnimationTesterUI.hpp:13
Runtime network connection parameters.
Definition NetworkConfig.hpp:21
Third-person weapon attachment params for remote players.
Definition ViewmodelConfig.hpp:22