From 5b9d6cce989720aa65828bcba8e13b78d10758af Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 11 Jan 2016 09:03:02 +0100 Subject: [PATCH] made drop distance configurable --- apps/opencs/model/prefs/state.cpp | 5 +++++ apps/opencs/view/render/worldspacewidget.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/prefs/state.cpp b/apps/opencs/model/prefs/state.cpp index 8b827d0a2..d2ad0f6ef 100644 --- a/apps/opencs/model/prefs/state.cpp +++ b/apps/opencs/model/prefs/state.cpp @@ -190,6 +190,11 @@ void CSMPrefs::State::declare() declareBool ("scene-hide-basic", "Hide basic 3D scenes tooltips", false); declareInt ("scene-delay", "Tooltip delay in milliseconds", 500). setMin (1); + + declareCategory ("Scene Drops"); + declareInt ("distance", "Drop Distance", 50). + setTooltip ("If an instance drop can not be placed against another object at the " + "insert point, it will be placed by this distance from the insert point instead"); } void CSMPrefs::State::declareCategory (const std::string& key) diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index 0383b0bcf..536126689 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -360,7 +360,7 @@ osg::Vec3f CSVRender::WorldspaceWidget::getIntersectionPoint (const QPoint& loca osg::Vec3d direction = end-start; direction.normalize(); - return start+direction * 50; + return start + direction * CSMPrefs::get()["Scene Drops"]["distance"].toInt(); } void CSVRender::WorldspaceWidget::dragEnterEvent (QDragEnterEvent* event)