mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-08 18:13:52 +00:00
fix(brush): NaN-guard EditorBrush::setPosition
applyBrush already early-outs on NaN brush position, but the stored worldPos_ would still capture NaN and surface it to UI panels and the brush-circle indicator (which renders a NaN ring). Reject NaN at the setter so the editor state itself stays sane.
This commit is contained in:
parent
4c0f8dd5c0
commit
9e801f93b6
1 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <cmath>
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
|
|
@ -31,7 +32,13 @@ public:
|
|||
void setActive(bool a) { active_ = a; }
|
||||
|
||||
const glm::vec3& getPosition() const { return worldPos_; }
|
||||
void setPosition(const glm::vec3& pos) { worldPos_ = pos; }
|
||||
void setPosition(const glm::vec3& pos) {
|
||||
// applyBrush already early-outs on NaN, but rejecting at the
|
||||
// setter keeps the stored state itself sane — handy for UI
|
||||
// panels that read the current brush position back.
|
||||
if (std::isfinite(pos.x) && std::isfinite(pos.y) && std::isfinite(pos.z))
|
||||
worldPos_ = pos;
|
||||
}
|
||||
|
||||
float getInfluence(float distance) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue