Ignore new entity dimensions if one of them is 0

This commit is contained in:
Atlante45 2015-05-24 19:49:45 +02:00
parent cc7a67e05b
commit 3d7a834356
2 changed files with 8 additions and 1 deletions

View file

@ -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).
///

View file

@ -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; }