overte-HifiExperiments/interface/src/ui/overlays/Billboard3DOverlay.cpp
2015-10-06 13:56:24 -07:00

45 lines
1.4 KiB
C++

//
// Billboard3DOverlay.cpp
// hifi/interface/src/ui/overlays
//
// Created by Zander Otavka on 8/4/15.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "Billboard3DOverlay.h"
Billboard3DOverlay::Billboard3DOverlay(const Billboard3DOverlay* billboard3DOverlay) :
Planar3DOverlay(billboard3DOverlay),
PanelAttachable(*billboard3DOverlay),
Billboardable(*billboard3DOverlay)
{
}
void Billboard3DOverlay::setProperties(const QScriptValue &properties) {
Planar3DOverlay::setProperties(properties);
PanelAttachable::setProperties(properties);
Billboardable::setProperties(properties);
}
QScriptValue Billboard3DOverlay::getProperty(const QString &property) {
QScriptValue value;
value = Billboardable::getProperty(_scriptEngine, property);
if (value.isValid()) {
return value;
}
value = PanelAttachable::getProperty(_scriptEngine, property);
if (value.isValid()) {
return value;
}
return Planar3DOverlay::getProperty(property);
}
void Billboard3DOverlay::applyTransformTo(Transform& transform, bool force) {
if (force || usecTimestampNow() > _transformExpiry) {
PanelAttachable::applyTransformTo(transform, true);
pointTransformAtCamera(transform, getOffsetRotation());
}
}