notify children of an overlay when the parent overlay moves

This commit is contained in:
Seth Alves 2017-02-24 13:57:49 -08:00
parent b2a35f45db
commit 34755dd75d
2 changed files with 3 additions and 3 deletions

View file

@ -259,6 +259,8 @@ bool Base3DOverlay::findRayIntersection(const glm::vec3& origin, const glm::vec3
} }
void Base3DOverlay::locationChanged(bool tellPhysics) { void Base3DOverlay::locationChanged(bool tellPhysics) {
SpatiallyNestable::locationChanged(tellPhysics);
auto itemID = getRenderItemID(); auto itemID = getRenderItemID();
if (render::Item::isValidID(itemID)) { if (render::Item::isValidID(itemID)) {
render::ScenePointer scene = qApp->getMain3DScene(); render::ScenePointer scene = qApp->getMain3DScene();
@ -266,8 +268,6 @@ void Base3DOverlay::locationChanged(bool tellPhysics) {
pendingChanges.updateItem(itemID); pendingChanges.updateItem(itemID);
scene->enqueuePendingChanges(pendingChanges); scene->enqueuePendingChanges(pendingChanges);
} }
// Overlays can't currently have children.
// SpatiallyNestable::locationChanged(tellPhysics); // tell all the children, also
} }
void Base3DOverlay::parentDeleted() { void Base3DOverlay::parentDeleted() {

View file

@ -53,7 +53,7 @@ namespace render {
return overlay->getBounds(); return overlay->getBounds();
} }
template <> int payloadGetLayer(const Overlay::Pointer& overlay) { template <> int payloadGetLayer(const Overlay::Pointer& overlay) {
// MAgic number while we are defining the layering mechanism: // Magic number while we are defining the layering mechanism:
const int LAYER_NO_AA = 3; const int LAYER_NO_AA = 3;
const int LAYER_2D = 2; const int LAYER_2D = 2;
const int LAYER_3D_FRONT = 1; const int LAYER_3D_FRONT = 1;