mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 17:56:43 +02:00
Merge pull request #11418 from SamGondelman/laserLaser
Don't let scripts control visibility of laser pointer overlays
This commit is contained in:
commit
daf18156f9
3 changed files with 12 additions and 7 deletions
|
@ -5160,12 +5160,6 @@ void Application::update(float deltaTime) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
PROFILE_RANGE_EX(app, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
|
|
||||||
PerformanceTimer perfTimer("overlays");
|
|
||||||
_overlays.update(deltaTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
PROFILE_RANGE(app, "RayPickManager");
|
PROFILE_RANGE(app, "RayPickManager");
|
||||||
_rayPickManager.update();
|
_rayPickManager.update();
|
||||||
|
@ -5176,6 +5170,12 @@ void Application::update(float deltaTime) {
|
||||||
_laserPointerManager.update();
|
_laserPointerManager.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
PROFILE_RANGE_EX(app, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
|
||||||
|
PerformanceTimer perfTimer("overlays");
|
||||||
|
_overlays.update(deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
// Update _viewFrustum with latest camera and view frustum data...
|
// Update _viewFrustum with latest camera and view frustum data...
|
||||||
// NOTE: we get this from the view frustum, to make it simpler, since the
|
// NOTE: we get this from the view frustum, to make it simpler, since the
|
||||||
// loadViewFrumstum() method will get the correct details from the camera
|
// loadViewFrumstum() method will get the correct details from the camera
|
||||||
|
|
|
@ -86,7 +86,9 @@ void LaserPointer::editRenderState(const std::string& state, const QVariant& sta
|
||||||
|
|
||||||
void LaserPointer::updateRenderStateOverlay(const OverlayID& id, const QVariant& props) {
|
void LaserPointer::updateRenderStateOverlay(const OverlayID& id, const QVariant& props) {
|
||||||
if (!id.isNull() && props.isValid()) {
|
if (!id.isNull() && props.isValid()) {
|
||||||
qApp->getOverlays().editOverlay(id, props);
|
QVariantMap propMap = props.toMap();
|
||||||
|
propMap.remove("visible");
|
||||||
|
qApp->getOverlays().editOverlay(id, propMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ const RenderState LaserPointerScriptingInterface::buildRenderState(const QVarian
|
||||||
if (propMap["start"].isValid()) {
|
if (propMap["start"].isValid()) {
|
||||||
QVariantMap startMap = propMap["start"].toMap();
|
QVariantMap startMap = propMap["start"].toMap();
|
||||||
if (startMap["type"].isValid()) {
|
if (startMap["type"].isValid()) {
|
||||||
|
startMap.remove("visible");
|
||||||
startID = qApp->getOverlays().addOverlay(startMap["type"].toString(), startMap);
|
startID = qApp->getOverlays().addOverlay(startMap["type"].toString(), startMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +105,7 @@ const RenderState LaserPointerScriptingInterface::buildRenderState(const QVarian
|
||||||
QVariantMap pathMap = propMap["path"].toMap();
|
QVariantMap pathMap = propMap["path"].toMap();
|
||||||
// right now paths must be line3ds
|
// right now paths must be line3ds
|
||||||
if (pathMap["type"].isValid() && pathMap["type"].toString() == "line3d") {
|
if (pathMap["type"].isValid() && pathMap["type"].toString() == "line3d") {
|
||||||
|
pathMap.remove("visible");
|
||||||
pathID = qApp->getOverlays().addOverlay(pathMap["type"].toString(), pathMap);
|
pathID = qApp->getOverlays().addOverlay(pathMap["type"].toString(), pathMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,6 +114,7 @@ const RenderState LaserPointerScriptingInterface::buildRenderState(const QVarian
|
||||||
if (propMap["end"].isValid()) {
|
if (propMap["end"].isValid()) {
|
||||||
QVariantMap endMap = propMap["end"].toMap();
|
QVariantMap endMap = propMap["end"].toMap();
|
||||||
if (endMap["type"].isValid()) {
|
if (endMap["type"].isValid()) {
|
||||||
|
endMap.remove("visible");
|
||||||
endID = qApp->getOverlays().addOverlay(endMap["type"].toString(), endMap);
|
endID = qApp->getOverlays().addOverlay(endMap["type"].toString(), endMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue