File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Build directories
2+ build /
3+ dist /
4+ _codeql_build_dir /
5+ * .o
6+ * .a
7+ * .so
8+ * .dylib
9+ * .exe
10+
11+ # CodeQL
12+ _codeql_detected_source_root
13+
14+ # IDE
15+ .vscode /
16+ .idea /
17+ * .swp
18+ * .swo
19+ * ~
20+
21+ # Coverage
22+ * .gcda
23+ * .gcno
24+ * .gcov
25+ coverage /
26+
27+ # Temporary files
28+ /tmp /
29+ * .tmp
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ static constexpr size_t MAX_LINE = 1024 * 1024;
4242
4343uint32_t now_ms () {
4444 auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(
45- std::chrono::steady_clock ::now ().time_since_epoch ()
45+ std::chrono::system_clock ::now ().time_since_epoch ()
4646 ).count ();
4747 return static_cast <uint32_t >(ms);
4848}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class PropulsionPhysicsEngine {
1010 static constexpr float MAX_THRUST_kN = 2500 .0f ;
1111 static constexpr float MIN_MASS_KG = 100 .0f ;
1212 static constexpr float MIN_VELOCITY_M_S = -20000 .0f ;
13+ static constexpr float MAX_VELOCITY_M_S = 20000 .0f ; // ~72,000 km/h
1314 static constexpr uint32_t PHYSICS_DT_MS = 10 ;
1415
1516 void init ();
Original file line number Diff line number Diff line change @@ -169,10 +169,10 @@ bool PropulsionPhysicsEngine::is_state_physically_plausible(
169169 if (radius_sq < min_radius * min_radius)
170170 return false ;
171171
172- // Velocity sanity check
173- if (state.velocity_m_s [0 ] < MIN_VELOCITY_M_S ||
174- state.velocity_m_s [1 ] < MIN_VELOCITY_M_S ||
175- state.velocity_m_s [2 ] < MIN_VELOCITY_M_S )
172+ // Velocity sanity check (magnitude per component)
173+ if (std::abs ( state.velocity_m_s [0 ]) > MAX_VELOCITY_M_S ||
174+ std::abs ( state.velocity_m_s [1 ]) > MAX_VELOCITY_M_S ||
175+ std::abs ( state.velocity_m_s [2 ]) > MAX_VELOCITY_M_S )
176176 return false ;
177177
178178 return true ;
You can’t perform that action at this time.
0 commit comments