Showing the changes to interface/src/raypick/PickScriptingInterface.cpp (1 of 16 files). Show all
Unified · Split
| @@ -31,6 +31,7 @@ · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | #include <ScriptEngine.h> | 32 | #include <ScriptEngine.h> |
| 33 | #include <ScriptEngineCast.h> | 33 | #include <ScriptEngineCast.h> |
| 34 | #include <ScriptEngineLogging.h> | ||
| 34 | #include <ScriptValueUtils.h> | 35 | #include <ScriptValueUtils.h> |
| 35 | 36 | ||
| 36 | STATIC_SCRIPT_TYPES_INITIALIZER(+[](ScriptManager* manager){ | 37 | STATIC_SCRIPT_TYPES_INITIALIZER(+[](ScriptManager* manager){ |
| @@ -39,6 +40,17 @@ STATIC_SCRIPT_TYPES_INITIALIZER(+[](ScriptManager* manager){ · 2 unmodified lines | |||
| 39 | PickScriptingInterface::registerMetaTypes(scriptEngine); | 40 | PickScriptingInterface::registerMetaTypes(scriptEngine); |
| 40 | }); | 41 | }); |
| 41 | 42 | ||
| 43 | STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager){ | ||
| 44 | auto scriptEngine = manager->engine().get(); | ||
| 45 | |||
| 46 | auto pickScriptingInterface = DependencyManager::get<PickScriptingInterface>(); | ||
| 47 | if (pickScriptingInterface) { | ||
| 48 | pickScriptingInterface->registerProperties(scriptEngine); | ||
| 49 | } else { | ||
| 50 | qWarning(scriptengine) << "Cannot register PickScriptingInterface properties with script engine, PickScriptingInterface instance not available"; | ||
| 51 | } | ||
| 52 | }); | ||
| 53 | |||
| 42 | static const float WEB_TOUCH_Y_OFFSET = 0.105f; // how far forward (or back with a negative number) to slide stylus in hand | 54 | static const float WEB_TOUCH_Y_OFFSET = 0.105f; // how far forward (or back with a negative number) to slide stylus in hand |
| 43 | static const glm::vec3 TIP_OFFSET = glm::vec3(0.0f, StylusPick::WEB_STYLUS_LENGTH - WEB_TOUCH_Y_OFFSET, 0.0f); | 55 | static const glm::vec3 TIP_OFFSET = glm::vec3(0.0f, StylusPick::WEB_STYLUS_LENGTH - WEB_TOUCH_Y_OFFSET, 0.0f); |
| 44 | 56 | ||