mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +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);
|
||||
}
|
||||
|
||||
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.
|
||||
/// This accounts for the registration point (upon which rotation occurs around).
|
||||
///
|
||||
|
|
|
@ -195,7 +195,7 @@ public:
|
|||
|
||||
/// Dimensions in meters (0.0 - TREE_SCALE)
|
||||
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; }
|
||||
|
|
Loading…
Reference in a new issue