mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-17 06:20:11 +02:00
minimum entity dimension
This commit is contained in:
parent
ef133806be
commit
9f3a431c5d
2 changed files with 3 additions and 4 deletions
|
@ -1688,7 +1688,8 @@ void EntityItem::setScaledDimensions(const glm::vec3& value) {
|
|||
}
|
||||
|
||||
void EntityItem::setUnscaledDimensions(const glm::vec3& value) {
|
||||
glm::vec3 newDimensions = glm::max(value, glm::vec3(0.0f)); // can never have negative dimensions
|
||||
const float MIN_ENTITY_DIMENSION = 0.01f; // this value cubed should == MIN_VOLUME in setMass
|
||||
glm::vec3 newDimensions = glm::max(value, glm::vec3(MIN_ENTITY_DIMENSION));
|
||||
if (getUnscaledDimensions() != newDimensions) {
|
||||
withWriteLock([&] {
|
||||
_unscaledDimensions = newDimensions;
|
||||
|
|
|
@ -182,9 +182,7 @@ const float SCALE_CHANGE_EPSILON = 0.0000001f;
|
|||
void Model::setScaleInternal(const glm::vec3& scale) {
|
||||
if (glm::distance(_scale, scale) > SCALE_CHANGE_EPSILON) {
|
||||
_scale = scale;
|
||||
if (_scale.x == 0.0f || _scale.y == 0.0f || _scale.z == 0.0f) {
|
||||
assert(false);
|
||||
}
|
||||
assert(_scale.x != 0.0f && scale.y != 0.0f && scale.z != 0.0f);
|
||||
simulate(0.0f, true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue