mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 01:23:52 +00:00
fix(wob): scrub NaN/inf doodad position+rotation on load
Already had a guard for scale; extending to position/rotation too. A WoB with non-finite doodad transforms produces NaN model matrices that propagate into the M2 instance SSBO and crash the GPU.
This commit is contained in:
parent
1135e499d7
commit
5d78cbb81d
1 changed files with 6 additions and 0 deletions
|
|
@ -176,6 +176,12 @@ WoweeBuilding WoweeBuildingLoader::load(const std::string& basePath) {
|
|||
// the field, or NaNs from a partial write). The renderer would
|
||||
// collapse the doodad to a point with scale 0.
|
||||
if (!std::isfinite(dp.scale) || dp.scale <= 0.0001f) dp.scale = 1.0f;
|
||||
// Same NaN scrub for position/rotation — doodads with non-finite
|
||||
// transforms produce NaN model matrices and crash the GPU.
|
||||
for (int k = 0; k < 3; k++) {
|
||||
if (!std::isfinite(dp.position[k])) dp.position[k] = 0.0f;
|
||||
if (!std::isfinite(dp.rotation[k])) dp.rotation[k] = 0.0f;
|
||||
}
|
||||
bld.doodads.push_back(dp);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue