mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
fix tablet culling
This commit is contained in:
parent
5d0be31fe7
commit
d316fe15ce
6 changed files with 9 additions and 19 deletions
|
@ -290,6 +290,7 @@ void Base3DOverlay::locationChanged(bool tellPhysics) {
|
|||
notifyRenderVariableChange();
|
||||
}
|
||||
|
||||
// FIXME: Overlays shouldn't be deleted when their parents are
|
||||
void Base3DOverlay::parentDeleted() {
|
||||
qApp->getOverlays().deleteOverlay(getOverlayID());
|
||||
}
|
||||
|
|
|
@ -59,8 +59,6 @@ public:
|
|||
void setIsGrabbable(bool value) { _isGrabbable = value; }
|
||||
virtual void setIsVisibleInSecondaryCamera(bool value) { _isVisibleInSecondaryCamera = value; }
|
||||
|
||||
virtual AABox getBounds() const override = 0;
|
||||
|
||||
void update(float deltatime) override;
|
||||
|
||||
void notifyRenderVariableChange() const;
|
||||
|
|
|
@ -60,6 +60,8 @@ ModelOverlay::ModelOverlay(const ModelOverlay* modelOverlay) :
|
|||
}
|
||||
|
||||
void ModelOverlay::update(float deltatime) {
|
||||
Base3DOverlay::update(deltatime);
|
||||
|
||||
if (_updateModel) {
|
||||
_updateModel = false;
|
||||
_model->setSnapModelToCenter(true);
|
||||
|
|
|
@ -247,7 +247,7 @@ void Overlay::removeMaterial(graphics::MaterialPointer material, const std::stri
|
|||
}
|
||||
|
||||
render::ItemKey Overlay::getKey() {
|
||||
auto builder = render::ItemKey::Builder().withTypeShape();
|
||||
auto builder = render::ItemKey::Builder().withTypeShape().withTypeMeta();
|
||||
|
||||
builder.withViewSpace();
|
||||
builder.withLayer(render::hifi::LAYER_2D);
|
||||
|
|
|
@ -20,11 +20,9 @@ Volume3DOverlay::Volume3DOverlay(const Volume3DOverlay* volume3DOverlay) :
|
|||
}
|
||||
|
||||
AABox Volume3DOverlay::getBounds() const {
|
||||
auto extents = Extents{_localBoundingBox};
|
||||
extents.rotate(getWorldOrientation());
|
||||
extents.shiftBy(getWorldPosition());
|
||||
|
||||
return AABox(extents);
|
||||
AABox bounds = _localBoundingBox;
|
||||
bounds.transform(getTransform());
|
||||
return bounds;
|
||||
}
|
||||
|
||||
void Volume3DOverlay::setDimensions(const glm::vec3& value) {
|
||||
|
@ -49,15 +47,7 @@ void Volume3DOverlay::setProperties(const QVariantMap& properties) {
|
|||
glm::vec3 scale = vec3FromVariant(dimensions);
|
||||
// don't allow a zero or negative dimension component to reach the renderTransform
|
||||
const float MIN_DIMENSION = 0.0001f;
|
||||
if (scale.x < MIN_DIMENSION) {
|
||||
scale.x = MIN_DIMENSION;
|
||||
}
|
||||
if (scale.y < MIN_DIMENSION) {
|
||||
scale.y = MIN_DIMENSION;
|
||||
}
|
||||
if (scale.z < MIN_DIMENSION) {
|
||||
scale.z = MIN_DIMENSION;
|
||||
}
|
||||
scale = glm::max(scale, MIN_DIMENSION);
|
||||
setDimensions(scale);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ public:
|
|||
virtual AABox getBounds() const override;
|
||||
|
||||
const glm::vec3& getDimensions() const { return _localBoundingBox.getDimensions(); }
|
||||
void setDimensions(float value) { setDimensions(glm::vec3(value)); }
|
||||
void setDimensions(const glm::vec3& value);
|
||||
|
||||
void setProperties(const QVariantMap& properties) override;
|
||||
|
@ -37,7 +36,7 @@ public:
|
|||
|
||||
protected:
|
||||
// Centered local bounding box
|
||||
AABox _localBoundingBox{ vec3(0.0f), 1.0f };
|
||||
AABox _localBoundingBox { vec3(-0.5), 1.0f };
|
||||
|
||||
Transform evalRenderTransform() override;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue