From d387ea840b56018522260a089c56af7ae0a10061 Mon Sep 17 00:00:00 2001 From: ksuprynowicz Date: Fri, 1 Dec 2023 23:59:05 +0100 Subject: [PATCH] Add a warnning about Controller.Standard property --- interface/src/scripting/ControllerScriptingInterface.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h index 175021e559..4128976fdc 100644 --- a/interface/src/scripting/ControllerScriptingInterface.h +++ b/interface/src/scripting/ControllerScriptingInterface.h @@ -216,6 +216,7 @@ class ScriptEngine; * * @property {Controller.Actions} Actions - Predefined actions on Interface and the user's avatar. These can be used as end * points in a {@link RouteObject} mapping. A synonym for Controller.Hardware.Actions. + * Getting this property is computationally expensive, so it's best to cache it once on script start. * Read-only. *

Default mappings are provided from the Controller.Hardware.Keyboard and Controller.Standard * to actions in @@ -225,13 +226,16 @@ class ScriptEngine; * standard.json, respectively.

* * @property {Controller.Hardware} Hardware - Standard and hardware-specific controller and computer outputs, plus predefined - * actions on Interface and the user's avatar. The outputs can be mapped to Actions or functions in a + * actions on Interface and the user's avatar. Getting this property is computationally expensive, so it's best to cache it + * instead of calling on every update. + * The outputs can be mapped to Actions or functions in a * {@link RouteObject} mapping. Additionally, hardware-specific controller outputs can be mapped to * Controller.Standard controller outputs. Read-only. * * @property {Controller.Standard} Standard - Standard controller outputs that can be mapped to Actions or * functions in a {@link RouteObject} mapping. Read-only. - *

Each hardware device has a mapping from its outputs to Controller.Standard items, specified in a JSON file. + *

Each hardware device has a mapping from its outputs to Controller.Standard items, specified in a JSON file. + * Getting this property is computationally expensive, so it's best to cache it once on script start. * For example, * leapmotion.json and * vive.json.