Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
ArcadeGliderFlightModel.h
1#pragma once
2
3#include <glm/glm.hpp>
4
6{
12 {
13 float momentumDrag = 0.12f;
14 float highSpeedDrag = 0.005f;
15 float minGlideSink = 0.65f;
16 float maxClimbRate = 6.0f;
17 float climbMomentumCost = 0.48f;
18 float diveSinkRate = 7.0f;
19 float diveMomentumGain = 0.72f;
20 float windMomentumGain = 0.72f;
21 float windDiminishingSpeed = 12.0f;
22 float windAlignmentPower = 1.6f;
23 float crosswindTurnRate = 0.06f;
24 float headwindPenalty = 0.55f;
25 float glideTurnRate = 7.0f;
26 float stallSpeed = 3.5f;
27 float stallRecoverySpeed = 4.7f;
28 float stallSinkSpeed = 6.0f;
29 float stallDiveSinkScale = 0.35f;
30 float stallExtraDrag = 0.12f;
31 float stallRecoveryDelay = 0.18f;
32 float emergencyMaxSpeed = 80.0f;
33 };
34
39 {
43 bool stalled = false;
44
48 float stallRecoveryTimer = 0.0f;
49 };
50
55 {
59 glm::vec3 velocity{ 0.0f };
60
64 glm::vec3 glideDirection{ 0.0f, 0.0f, -1.0f };
65
69 glm::vec3 windVelocity{ 0.0f };
70
74 float palmTilt = 0.0f;
75
79 float deltaTime = 0.0f;
80
85 };
86
91 {
95 glm::vec3 velocity{ 0.0f };
96
100 glm::vec3 glideDirection{ 0.0f, 0.0f, -1.0f };
101
105 float momentum = 0.0f;
106
110 float verticalVelocity = 0.0f;
111
115 float climbDemand = 0.0f;
116
120 float diveDemand = 0.0f;
121
125 float windAlignment = 0.0f;
126
130 float windMomentumDelta = 0.0f;
131
135 float dragDelta = 0.0f;
136
140 float climbMomentumDelta = 0.0f;
141
145 bool stalled = false;
146
150 bool enteredStall = false;
151
155 bool recoveredStall = false;
156
160 float stallRecoveryTimer = 0.0f;
161 };
162
170 const ArcadeGliderTuning & tuning,
171 const ArcadeGliderInput & input
172 );
173} // namespace Engine::Components
ArcadeGliderStep stepArcadeGliderFlight(const ArcadeGliderTuning &tuning, const ArcadeGliderInput &input)
Advances the arcade glider flight model by one step.
Input values for one arcade glider simulation step.
glm::vec3 windVelocity
Wind velocity sampled at the glider position.
glm::vec3 velocity
Current world-space velocity.
glm::vec3 glideDirection
Current normalized glide direction.
ArcadeGliderState state
Previous persistent glider state.
float deltaTime
Step duration in seconds.
float palmTilt
Player palm tilt used to request climb or dive.
Persistent state carried between arcade glider simulation steps.
float stallRecoveryTimer
Time accumulated toward stall recovery.
bool stalled
True while the glider is stalled.
Output values from one arcade glider simulation step.
glm::vec3 velocity
Updated world-space velocity.
bool stalled
True while the glider is stalled after this step.
float climbMomentumDelta
Momentum spent on climb this step.
float verticalVelocity
Vertical velocity after the step.
float windMomentumDelta
Momentum gained or lost from wind this step.
float stallRecoveryTimer
Updated stall recovery timer.
float windAlignment
Alignment between glide direction and wind direction.
float dragDelta
Momentum lost to drag this step.
float diveDemand
Requested dive amount derived from input.
float momentum
Horizontal speed component used as glide momentum.
glm::vec3 glideDirection
Updated normalized glide direction.
float climbDemand
Requested climb amount derived from input.
bool recoveredStall
True on the first step that exits stall.
bool enteredStall
True on the first step that enters stall.
Stores the config values for the glider. Can be used to change the flight behavior of the glider move...
float glideTurnRate
Rate that carried velocity turns toward glide direction.
float stallSpeed
Horizontal speed below which the glider stalls.
float windMomentumGain
Momentum gain scale from aligned wind.
float stallExtraDrag
Additional momentum drag while stalled.
float climbMomentumCost
Momentum lost per unit of climb rate.
float crosswindTurnRate
Rate that crosswind steers carried direction.
float stallRecoverySpeed
Horizontal speed required to recover from stall.
float minGlideSink
Minimum downward speed while gliding.
float stallRecoveryDelay
Time at recovery speed before leaving stall.
float stallSinkSpeed
Downward speed while stalled.
float diveMomentumGain
Momentum gained per unit of dive rate.
float maxClimbRate
Maximum upward speed from full climb input.
float emergencyMaxSpeed
Safety clamp for total velocity magnitude.
float headwindPenalty
Momentum loss scale for opposing wind.
float highSpeedDrag
Extra drag scaled by squared horizontal speed.
float stallDiveSinkScale
Fraction of dive sink applied during stall.
float diveSinkRate
Downward speed added by full dive input.
float windAlignmentPower
Exponent applied to tailwind alignment.
float momentumDrag
Base horizontal momentum loss per second.
float windDiminishingSpeed
Speed where wind momentum gain begins to diminish.