mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
Ignore new entity dimensions if one of them is 0
This commit is contained in:
parent
cc7a67e05b
commit
3d7a834356
2 changed files with 8 additions and 1 deletions
|
@ -1020,6 +1020,13 @@ void EntityItem::setTranformToCenter(const Transform& transform) {
|
||||||
setTransform(copy);
|
setTransform(copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityItem::setDimensions(const glm::vec3& value) {
|
||||||
|
if (value.x == 0.0f || value.y == 0.0f || value.z == 0.0f) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_transform.setScale(value);
|
||||||
|
}
|
||||||
|
|
||||||
/// The maximum bounding cube for the entity, independent of it's rotation.
|
/// The maximum bounding cube for the entity, independent of it's rotation.
|
||||||
/// This accounts for the registration point (upon which rotation occurs around).
|
/// This accounts for the registration point (upon which rotation occurs around).
|
||||||
///
|
///
|
||||||
|
|
|
@ -195,7 +195,7 @@ public:
|
||||||
|
|
||||||
/// Dimensions in meters (0.0 - TREE_SCALE)
|
/// Dimensions in meters (0.0 - TREE_SCALE)
|
||||||
inline const glm::vec3& getDimensions() const { return _transform.getScale(); }
|
inline const glm::vec3& getDimensions() const { return _transform.getScale(); }
|
||||||
inline virtual void setDimensions(const glm::vec3& value) { _transform.setScale(glm::abs(value)); }
|
virtual void setDimensions(const glm::vec3& value);
|
||||||
|
|
||||||
|
|
||||||
float getGlowLevel() const { return _glowLevel; }
|
float getGlowLevel() const { return _glowLevel; }
|
||||||
|
|
Loading…
Reference in a new issue