mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
fix bound scaling
This commit is contained in:
parent
544f54e69a
commit
6d6cd42adb
4 changed files with 8 additions and 6 deletions
|
@ -266,7 +266,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
|||
APPEND_ENTITY_PROPERTY(PROP_HREF, getHref());
|
||||
APPEND_ENTITY_PROPERTY(PROP_DESCRIPTION, getDescription());
|
||||
APPEND_ENTITY_PROPERTY(PROP_POSITION, getLocalPosition());
|
||||
APPEND_ENTITY_PROPERTY(PROP_DIMENSIONS, getUnscaledDimensions());
|
||||
APPEND_ENTITY_PROPERTY(PROP_DIMENSIONS, getScaledDimensions());
|
||||
APPEND_ENTITY_PROPERTY(PROP_ROTATION, getLocalOrientation());
|
||||
APPEND_ENTITY_PROPERTY(PROP_REGISTRATION_POINT, getRegistrationPoint());
|
||||
APPEND_ENTITY_PROPERTY(PROP_CREATED, getCreated());
|
||||
|
@ -818,7 +818,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
|||
};
|
||||
READ_ENTITY_PROPERTY(PROP_POSITION, glm::vec3, customUpdatePositionFromNetwork);
|
||||
}
|
||||
READ_ENTITY_PROPERTY(PROP_DIMENSIONS, glm::vec3, setUnscaledDimensions);
|
||||
READ_ENTITY_PROPERTY(PROP_DIMENSIONS, glm::vec3, setScaledDimensions);
|
||||
{ // See comment above
|
||||
auto customUpdateRotationFromNetwork = [this, shouldUpdate, lastEdited](glm::quat value) {
|
||||
if (shouldUpdate(_lastUpdatedRotationTimestamp, value != _lastUpdatedRotationValue)) {
|
||||
|
@ -1315,7 +1315,7 @@ EntityItemProperties EntityItem::getProperties(const EntityPropertyFlags& desire
|
|||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(href, getHref);
|
||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(description, getDescription);
|
||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(position, getLocalPosition);
|
||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(dimensions, getUnscaledDimensions);
|
||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(dimensions, getScaledDimensions);
|
||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(rotation, getLocalOrientation);
|
||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(registrationPoint, getRegistrationPoint);
|
||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(created, getCreated);
|
||||
|
@ -1462,7 +1462,7 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
|||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(href, setHref);
|
||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(description, setDescription);
|
||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(position, setPosition);
|
||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(dimensions, setUnscaledDimensions);
|
||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(dimensions, setScaledDimensions);
|
||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(rotation, setRotation);
|
||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(registrationPoint, setRegistrationPoint);
|
||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(created, setCreated);
|
||||
|
@ -1872,7 +1872,7 @@ glm::vec3 EntityItem::getScaledDimensions() const {
|
|||
|
||||
void EntityItem::setScaledDimensions(const glm::vec3& value) {
|
||||
glm::vec3 parentScale = getSNScale();
|
||||
setUnscaledDimensions(value * parentScale);
|
||||
setUnscaledDimensions(value / parentScale);
|
||||
}
|
||||
|
||||
void EntityItem::setUnscaledDimensions(const glm::vec3& value) {
|
||||
|
|
|
@ -1013,7 +1013,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
|||
* @property {Vec3} dimensions=0.1,0.1,0.1 - The dimensions of the entity. When adding an entity, if no <code>dimensions</code>
|
||||
* value is specified then the model is automatically sized to its
|
||||
* <code>{@link Entities.EntityProperties|naturalDimensions}</code>.
|
||||
* @property {Vec3} modelScale - The scale factor applied to the model's dimensions.
|
||||
* @property {Vec3} modelScale - The scale factor applied to the model's dimensions. Deprecated.
|
||||
* @property {Color} color=255,255,255 - <em>Currently not used.</em>
|
||||
* @property {string} modelURL="" - The URL of the FBX of OBJ model. Baked FBX models' URLs end in ".baked.fbx".<br />
|
||||
* @property {string} textures="" - A JSON string of texture name, URL pairs used when rendering the model in place of the
|
||||
|
|
|
@ -178,6 +178,7 @@ void CauterizedModel::updateClusterMatrices() {
|
|||
}
|
||||
}
|
||||
}
|
||||
computeMeshPartLocalBounds();
|
||||
|
||||
// post the blender if we're not currently waiting for one to finish
|
||||
auto modelBlender = DependencyManager::get<ModelBlender>();
|
||||
|
|
|
@ -1385,6 +1385,7 @@ void Model::updateClusterMatrices() {
|
|||
}
|
||||
}
|
||||
}
|
||||
computeMeshPartLocalBounds();
|
||||
|
||||
// post the blender if we're not currently waiting for one to finish
|
||||
auto modelBlender = DependencyManager::get<ModelBlender>();
|
||||
|
|
Loading…
Reference in a new issue