mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 15:31:49 +00:00
update entity Transform epsilon
This commit is contained in:
parent
e45f63c315
commit
d59491f63a
1 changed files with 3 additions and 2 deletions
|
|
@ -38,6 +38,7 @@ struct EntityId {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Transform {
|
struct Transform {
|
||||||
|
static inline constexpr float EPSILON = 0.0000001f;
|
||||||
glm::vec3 pos;
|
glm::vec3 pos;
|
||||||
glm::vec3 size;
|
glm::vec3 size;
|
||||||
glm::mat3 rot;
|
glm::mat3 rot;
|
||||||
|
|
@ -55,14 +56,14 @@ struct Transform {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setSize(glm::vec3 v) {
|
inline void setSize(glm::vec3 v) {
|
||||||
if (glm::distance2(displaySize, v) >= 0.00001f) {
|
if (glm::distance2(displaySize, v) >= EPSILON) {
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
size = v;
|
size = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setPos(glm::vec3 v) {
|
inline void setPos(glm::vec3 v) {
|
||||||
if (glm::distance2(displayPos, v) >= 0.0001f) {
|
if (glm::distance2(displayPos, v) >= EPSILON) {
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
pos = v;
|
pos = v;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue