mirror of
https://github.com/overte-org/overte.git
synced 2025-06-03 18:51:37 +02:00
try, try again
This commit is contained in:
parent
5f05d576cc
commit
01659cf93b
4 changed files with 5 additions and 43 deletions
|
@ -74,26 +74,7 @@ void RenderableModelEntityItem::loader() {
|
|||
|
||||
void RenderableModelEntityItem::setDimensions(const glm::vec3& value) {
|
||||
_dimensionsInitialized = true;
|
||||
|
||||
bool success;
|
||||
AACube queryAACube = getQueryAACube(success);
|
||||
|
||||
ModelEntityItem::setDimensions(value);
|
||||
|
||||
AACube maxAACube = getMaximumAACube(success);
|
||||
if (!success) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!success || !queryAACube.contains(maxAACube)) {
|
||||
EntityItemProperties properties;
|
||||
properties.setQueryAACube(maxAACube);
|
||||
qCDebug(entitiesrenderer) << "Auto-setting queryAACube:" << (!getName().isEmpty() ? getName() : getModelURL());
|
||||
QMetaObject::invokeMethod(DependencyManager::get<EntityScriptingInterface>().data(), "editEntity",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(QUuid, getEntityItemID()),
|
||||
Q_ARG(EntityItemProperties, properties));
|
||||
}
|
||||
}
|
||||
|
||||
bool RenderableModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||
|
|
|
@ -1202,27 +1202,6 @@ const Transform EntityItem::getTransformToCenter(bool& success) const {
|
|||
return result;
|
||||
}
|
||||
|
||||
// void EntityItem::checkAndAdjustQueryAACube() {
|
||||
// bool maxAACubeSuccess;
|
||||
// AACube maxAACube = getMaximumAACube(maxAACubeSuccess);
|
||||
// if (maxAACubeSuccess) {
|
||||
// if (!_queryAACubeSet || !_queryAACube.contains(maxAACube)) {
|
||||
// // allow server to patch up broken queryAACubes
|
||||
// EntityTreePointer tree = getTree();
|
||||
// if (tree) {
|
||||
// EntityItemProperties properties;
|
||||
// properties.setQueryAACube(maxAACube);
|
||||
// tree->updateEntity(getID(), properties);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
void EntityItem::setParentID(const QUuid& parentID) {
|
||||
SpatiallyNestable::setParentID(parentID);
|
||||
}
|
||||
|
||||
|
||||
void EntityItem::setDimensions(const glm::vec3& value) {
|
||||
if (value.x <= 0.0f || value.y <= 0.0f || value.z <= 0.0f) {
|
||||
return;
|
||||
|
@ -1334,6 +1313,7 @@ AACube EntityItem::getQueryAACube(bool& success) const {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
// NOTE: This should only be used in cases of old bitstreams which only contain radius data
|
||||
// 0,0,0 --> maxDimension,maxDimension,maxDimension
|
||||
// ... has a corner to corner distance of glm::length(maxDimension,maxDimension,maxDimension)
|
||||
|
|
|
@ -179,8 +179,6 @@ public:
|
|||
QString getDescription() const { return _description; }
|
||||
void setDescription(QString value) { _description = value; }
|
||||
|
||||
virtual void setParentID(const QUuid& parentID);
|
||||
|
||||
/// Dimensions in meters (0.0 - TREE_SCALE)
|
||||
inline const glm::vec3 getDimensions() const { return getScale(); }
|
||||
virtual void setDimensions(const glm::vec3& value);
|
||||
|
@ -242,6 +240,7 @@ public:
|
|||
|
||||
using SpatiallyNestable::getQueryAACube;
|
||||
virtual AACube getQueryAACube(bool& success) const override;
|
||||
|
||||
const QString& getScript() const { return _script; }
|
||||
void setScript(const QString& value) { _script = value; }
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ void SpatiallyNestable::setParentID(const QUuid& parentID) {
|
|||
_parentKnowsMe = false;
|
||||
}
|
||||
});
|
||||
checkAndAdjustQueryAACube();
|
||||
}
|
||||
|
||||
Transform SpatiallyNestable::getParentTransform(bool& success, int depth) const {
|
||||
|
@ -139,6 +140,7 @@ void SpatiallyNestable::forgetChild(SpatiallyNestablePointer newChild) const {
|
|||
|
||||
void SpatiallyNestable::setParentJointIndex(quint16 parentJointIndex) {
|
||||
_parentJointIndex = parentJointIndex;
|
||||
checkAndAdjustQueryAACube();
|
||||
}
|
||||
|
||||
glm::vec3 SpatiallyNestable::worldToLocal(const glm::vec3& position,
|
||||
|
@ -776,7 +778,7 @@ void SpatiallyNestable::setQueryAACube(const AACube& queryAACube) {
|
|||
return;
|
||||
}
|
||||
_queryAACube = queryAACube;
|
||||
if (_queryAACube.getScale() > 0.0f) {
|
||||
if (queryAACube.getScale() > 0.0f) {
|
||||
_queryAACubeSet = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue