mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 01:23:52 +00:00
fix(gizmo): hide on NaN target instead of building NaN geometry
setTarget previously stored the position raw, then updateBuffers ran glm::normalize on axis offsets. NaN target → NaN normalized axes → NaN gizmo vertices → Vulkan validation drops the whole draw and the gizmo is invisible regardless of target value. Hide the gizmo upfront so the user sees no gizmo (which is the intent of the NaN handling) without leaking garbage into the vertex buffer.
This commit is contained in:
parent
cdc9bb94ee
commit
98f2a6c3bf
1 changed files with 8 additions and 0 deletions
|
|
@ -31,6 +31,14 @@ void TransformGizmo::shutdown() {
|
|||
}
|
||||
|
||||
void TransformGizmo::setTarget(const glm::vec3& position, float scale) {
|
||||
// Hide the gizmo on a NaN target. updateBuffers calls glm::normalize on
|
||||
// axis offsets — non-finite targetPos_ would propagate NaN into the
|
||||
// gizmo geometry and Vulkan validation would drop the whole batch.
|
||||
if (!std::isfinite(position.x) || !std::isfinite(position.y) ||
|
||||
!std::isfinite(position.z) || !std::isfinite(scale) || scale <= 0.0f) {
|
||||
visible_ = false;
|
||||
return;
|
||||
}
|
||||
targetPos_ = position;
|
||||
targetScale_ = scale;
|
||||
visible_ = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue