mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
refactor: replace C-style casts with static_cast and extract toLowerInPlace
Replace ~300 C-style casts ((int), (float), (uint32_t), etc.) with static_cast across 15 source files. Extract toLowerInPlace() helper in lua_engine.cpp to replace 72 identical tolower loop patterns.
This commit is contained in:
parent
d646a0451d
commit
05f2bedf88
15 changed files with 385 additions and 381 deletions
|
|
@ -403,7 +403,7 @@ glm::vec3 TransportManager::evalTimedCatmullRom(const TransportPath& path, uint3
|
|||
uint32_t t1Ms = path.points[p1Idx].tMs;
|
||||
uint32_t t2Ms = path.points[p2Idx].tMs;
|
||||
uint32_t segmentDurationMs = (t2Ms > t1Ms) ? (t2Ms - t1Ms) : 1;
|
||||
float t = (float)(pathTimeMs - t1Ms) / (float)segmentDurationMs;
|
||||
float t = (float)(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
t = glm::clamp(t, 0.0f, 1.0f);
|
||||
|
||||
// Catmull-Rom spline formula
|
||||
|
|
@ -480,7 +480,7 @@ glm::quat TransportManager::orientationFromTangent(const TransportPath& path, ui
|
|||
uint32_t t1Ms = path.points[p1Idx].tMs;
|
||||
uint32_t t2Ms = path.points[p2Idx].tMs;
|
||||
uint32_t segmentDurationMs = (t2Ms > t1Ms) ? (t2Ms - t1Ms) : 1;
|
||||
float t = (float)(pathTimeMs - t1Ms) / (float)segmentDurationMs;
|
||||
float t = (float)(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
t = glm::clamp(t, 0.0f, 1.0f);
|
||||
|
||||
// Tangent of Catmull-Rom spline (derivative)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue