LONGITUDINAL_BACKWARD | number | number | Deprecated: Use
diff --git a/libraries/controllers/src/controllers/InputDevice.h b/libraries/controllers/src/controllers/InputDevice.h
index 7c3c31cb38..95d0524a4a 100644
--- a/libraries/controllers/src/controllers/InputDevice.h
+++ b/libraries/controllers/src/controllers/InputDevice.h
@@ -54,10 +54,9 @@ enum Hand {
/**jsdoc
* The Controller.Hardware object has properties representing standard and hardware-specific controller and
- * computer outputs, plus predefined actions on Interface and the user's avatar. Read-only. The outputs can be mapped
- * to actions or functions in a {@link RouteObject} mapping. Additionally, hardware-specific controller outputs can be mapped
- * to standard controller outputs.
- *
+ * computer outputs, plus predefined actions on Interface and the user's avatar. Read-only.
+ * The outputs can be mapped to actions or functions in a {@link RouteObject} mapping. Additionally, hardware-specific
+ * controller outputs can be mapped to standard controller outputs.
* Controllers typically implement a subset of the {@link Controller.Standard} controls, plus they may implement some extras.
* Some common controllers are included in the table. You can see the outputs provided by these and others by
* viewing their {@link Controller.MappingJSON|MappingJSON} files at
diff --git a/libraries/controllers/src/controllers/ScriptingInterface.cpp b/libraries/controllers/src/controllers/ScriptingInterface.cpp
index 07c59e1aaa..fd32b2eb43 100644
--- a/libraries/controllers/src/controllers/ScriptingInterface.cpp
+++ b/libraries/controllers/src/controllers/ScriptingInterface.cpp
@@ -227,6 +227,7 @@ namespace controller {
}
QObject* ScriptingInterface::loadMapping(const QString& jsonUrl) {
+ // FIXME: Implement. https://highfidelity.manuscript.com/f/cases/14188/Implement-Controller-loadMappping
return nullptr;
}
diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h
index 157730e7c6..de1cada97b 100644
--- a/libraries/controllers/src/controllers/ScriptingInterface.h
+++ b/libraries/controllers/src/controllers/ScriptingInterface.h
@@ -73,7 +73,7 @@ namespace controller {
virtual ~ScriptingInterface() {};
/**jsdoc
- * Get a list of all available actions.
+ * Gets a list of all available actions.
* @function Controller.getAllActions
* @returns {Action[]} All available actions.
* @deprecated This function no longer works.
@@ -82,7 +82,7 @@ namespace controller {
Q_INVOKABLE QVector getAllActions();
/**jsdoc
- * Get a list of all available inputs for a hardware device.
+ * Gets a list of all available inputs for a hardware device.
* @function Controller.getAvailableInputs
* @param {number} deviceID - Integer ID of the hardware device.
* @returns {NamedPair[]} All available inputs for the device.
@@ -92,7 +92,7 @@ namespace controller {
Q_INVOKABLE QVector getAvailableInputs(unsigned int device);
/**jsdoc
- * Find the name of a particular controller from its device ID.
+ * Finds the name of a particular controller from its device ID.
* @function Controller.getDeviceName
* @param {number} deviceID - The integer ID of the device.
* @returns {string} The name of the device if found, otherwise "unknown" .
@@ -106,7 +106,7 @@ namespace controller {
Q_INVOKABLE QString getDeviceName(unsigned int device);
/**jsdoc
- * Get the current value of an action.
+ * Gets the current value of an action.
* @function Controller.getActionValue
* @param {number} actionID - The integer ID of the action.
* @returns {number} The current value of the action.
@@ -121,7 +121,7 @@ namespace controller {
Q_INVOKABLE float getActionValue(int action);
/**jsdoc
- * Find the ID of a specific controller from its device name.
+ * Finds the ID of a specific controller from its device name.
* @function Controller.findDevice
* @param {string} deviceName - The name of the device to find.
* @returns {number} The integer ID of the device if available, otherwise 65535 .
@@ -132,7 +132,7 @@ namespace controller {
Q_INVOKABLE int findDevice(QString name);
/**jsdoc
- * Get the names of all currently available controller devices plus "Actions", "Application", and "Standard".
+ * Gets the names of all currently available controller devices plus "Actions", "Application", and "Standard".
* @function Controller.getDeviceNames
* @returns {string[]} An array of device names.
* @example Get the names of all currently available controller devices.
@@ -143,7 +143,7 @@ namespace controller {
Q_INVOKABLE QVector getDeviceNames();
/**jsdoc
- * Find the ID of an action from its name.
+ * Finds the ID of an action from its name.
* @function Controller.findAction
* @param {string} actionName - The name of the action: one of the {@link Controller.Actions} property names.
* @returns {number} The integer ID of the action if found, otherwise 4095 . Note that this value is not
@@ -156,7 +156,7 @@ namespace controller {
Q_INVOKABLE int findAction(QString actionName);
/**jsdoc
- * Get the names of all actions available as properties of {@link Controller.Actions}.
+ * Gets the names of all actions available as properties of {@link Controller.Actions}.
* @function Controller.getActionNames
* @returns {string[]} An array of action names.
* @example Get the names of all actions.
@@ -167,7 +167,7 @@ namespace controller {
Q_INVOKABLE QVector getActionNames() const;
/**jsdoc
- * Get the value of a controller button or axis output. Note: Also gets the value of a controller axis output.
+ * Gets the value of a controller button or axis output. Note: Also gets the value of a controller axis output.
* @function Controller.getValue
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item.
* @returns {number} The current value of the controller item output if source is valid, otherwise
@@ -186,7 +186,7 @@ namespace controller {
Q_INVOKABLE float getValue(const int& source) const;
/**jsdoc
- * Get the value of a controller axis output. Note: Also gets the value of a controller button output.
+ * Gets the value of a controller axis output. Note: Also gets the value of a controller button output.
* @function Controller.getAxisValue
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item.
* @returns {number} The current value of the controller item output if source is valid, otherwise
@@ -196,7 +196,7 @@ namespace controller {
Q_INVOKABLE float getAxisValue(int source) const;
/**jsdoc
- * Get the value of a controller pose output.
+ * Gets the value of a controller pose output.
* @function Controller.getPoseValue
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} pose output.
* @returns {Pose} The current value of the controller pose output if source is a pose output, otherwise
@@ -212,7 +212,7 @@ namespace controller {
* @function Controller.triggerHapticPulse
* @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
- * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
+ * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
* @example Trigger a haptic pulse on the right hand.
* var HAPTIC_STRENGTH = 0.5;
* var HAPTIC_DURATION = 10;
@@ -225,7 +225,7 @@ namespace controller {
* Triggers a 250ms haptic pulse on connected and enabled devices that have the capability.
* @function Controller.triggerShortHapticPulse
* @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
- * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
+ * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
*/
Q_INVOKABLE bool triggerShortHapticPulse(float strength, controller::Hand hand = BOTH) const;
@@ -235,7 +235,7 @@ namespace controller {
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
* @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
- * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
+ * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
* @example Trigger a haptic pulse on an Oculus Touch controller.
* var HAPTIC_STRENGTH = 0.5;
* var deviceID = Controller.findDevice("OculusTouch");
@@ -251,18 +251,18 @@ namespace controller {
* @function Controller.triggerShortHapticPulseOnDevice
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
* @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
- * @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
+ * @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
*/
Q_INVOKABLE bool triggerShortHapticPulseOnDevice(unsigned int device, float strength, controller::Hand hand = BOTH)
const;
/**jsdoc
- * Create a new controller mapping. Routes can then be added to the mapping using {@link MappingObject} methods and
+ * Creates a new controller mapping. Routes can then be added to the mapping using {@link MappingObject} methods and
* routed to Standard controls, Actions , or script functions using {@link RouteObject}
* methods. The mapping can then be enabled using {@link Controller.enableMapping|enableMapping} for it to take effect.
* @function Controller.newMapping
- * @param {string} mappingName=Uuid.generate() - A unique name for the mapping. If not specified a new UUID generated
+ * @param {string} [mappingName=Uuid.generate()] - A unique name for the mapping. If not specified a new UUID generated
* by {@link Uuid.generate} is used.
* @returns {MappingObject} A controller mapping object.
* @example Create a simple mapping that makes the right trigger move your avatar up.
@@ -279,22 +279,22 @@ namespace controller {
Q_INVOKABLE QObject* newMapping(const QString& mappingName = QUuid::createUuid().toString());
/**jsdoc
- * Enable or disable a controller mapping. When enabled, the routes in the mapping have effect.
+ * Enables or disables a controller mapping. When enabled, the routes in the mapping have effect.
* @function Controller.enableMapping
* @param {string} mappingName - The name of the mapping.
- * @param {boolean} enable=true - If true then the mapping is enabled, otherwise it is disabled.
+ * @param {boolean} [[enable=true] - If true then the mapping is enabled, otherwise it is disabled.
*/
Q_INVOKABLE void enableMapping(const QString& mappingName, bool enable = true);
/**jsdoc
- * Disable a controller mapping. When disabled, the routes in the mapping have no effect.
+ * Disables a controller mapping. When disabled, the routes in the mapping have no effect.
* @function Controller.disableMapping
* @param {string} mappingName - The name of the mapping.
*/
Q_INVOKABLE void disableMapping(const QString& mappingName) { enableMapping(mappingName, false); }
/**jsdoc
- * Create a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} string. Use
+ * Creates a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} string. Use
* {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect.
* @function Controller.parseMapping
* @param {string} jsonString - A JSON string of the {@link Controller.MappingJSON|MappingJSON}.
@@ -317,19 +317,19 @@ namespace controller {
Q_INVOKABLE QObject* parseMapping(const QString& json);
/**jsdoc
- * Create a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} JSON file at a URL. Use
+ * Creates a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} JSON file at a URL. Use
* {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect.
+ * Warning: This function is not yet implemented; it doesn't load a mapping and just returns
+ * null .
* @function Controller.loadMapping
* @param {string} jsonURL - The URL the {@link Controller.MappingJSON|MappingJSON} JSON file.
* @returns {MappingObject} A controller mapping object.
- * @todo Implement this function. It currently does not load the mapping from the file; it just returns
- * null .
*/
Q_INVOKABLE QObject* loadMapping(const QString& jsonUrl);
/**jsdoc
- * Get the {@link Controller.Hardware} property tree. Calling this function is the same as using the {@link Controller}
+ * Gets the {@link Controller.Hardware} property tree. Calling this function is the same as using the {@link Controller}
* property, Controller.Hardware .
* @function Controller.getHardware
* @returns {Controller.Hardware} The {@link Controller.Hardware} property tree.
@@ -337,7 +337,7 @@ namespace controller {
Q_INVOKABLE const QVariantMap getHardware() { return _hardware; }
/**jsdoc
- * Get the {@link Controller.Actions} property tree. Calling this function is the same as using the {@link Controller}
+ * Gets the {@link Controller.Actions} property tree. Calling this function is the same as using the {@link Controller}
* property, Controller.Actions .
* @function Controller.getActions
* @returns {Controller.Actions} The {@link Controller.Actions} property tree.
@@ -345,7 +345,7 @@ namespace controller {
Q_INVOKABLE const QVariantMap getActions() { return _actions; } //undefined
/**jsdoc
- * Get the {@link Controller.Standard} property tree. Calling this function is the same as using the {@link Controller}
+ * Gets the {@link Controller.Standard} property tree. Calling this function is the same as using the {@link Controller}
* property, Controller.Standard .
* @function Controller.getStandard
* @returns {Controller.Standard} The {@link Controller.Standard} property tree.
@@ -354,7 +354,7 @@ namespace controller {
/**jsdoc
- * Start making a recording of currently active controllers.
+ * Starts making a recording of currently active controllers.
* @function Controller.startInputRecording
* @example Make a controller recording.
* // Delay start of recording for 2s.
@@ -374,13 +374,13 @@ namespace controller {
Q_INVOKABLE void startInputRecording();
/**jsdoc
- * Stop making a recording started by {@link Controller.startInputRecording|startInputRecording}.
+ * Stops making a recording started by {@link Controller.startInputRecording|startInputRecording}.
* @function Controller.stopInputRecording
*/
Q_INVOKABLE void stopInputRecording();
/**jsdoc
- * Play back the current recording from the beginning. The current recording may have been recorded by
+ * Plays back the current recording from the beginning. The current recording may have been recorded by
* {@link Controller.startInputRecording|startInputRecording} and
* {@link Controller.stopInputRecording|stopInputRecording}, or loaded by
* {@link Controller.loadInputRecording|loadInputRecording}. Playback repeats in a loop until
@@ -403,13 +403,13 @@ namespace controller {
Q_INVOKABLE void startInputPlayback();
/**jsdoc
- * Stop play back of a recording started by {@link Controller.startInputPlayback|startInputPlayback}.
+ * Stops play back of a recording started by {@link Controller.startInputPlayback|startInputPlayback}.
* @function Controller.stopInputPlayback
*/
Q_INVOKABLE void stopInputPlayback();
/**jsdoc
- * Save the current recording to a file. The current recording may have been recorded by
+ * Saves the current recording to a file. The current recording may have been recorded by
* {@link Controller.startInputRecording|startInputRecording} and
* {@link Controller.stopInputRecording|stopInputRecording}, or loaded by
* {@link Controller.loadInputRecording|loadInputRecording}. It is saved in the directory returned by
@@ -419,24 +419,26 @@ namespace controller {
Q_INVOKABLE void saveInputRecording();
/**jsdoc
- * Load an input recording, ready for play back.
+ * Loads an input recording, ready for play back.
* @function Controller.loadInputRecording
* @param {string} file - The path to the recording file, prefixed by "file:///" .
*/
Q_INVOKABLE void loadInputRecording(const QString& file);
/**jsdoc
- * Get the directory in which input recordings are saved.
+ * Gets the directory in which input recordings are saved.
* @function Controller.getInputRecorderSaveDirectory
* @returns {string} The directory in which input recordings are saved.
*/
Q_INVOKABLE QString getInputRecorderSaveDirectory();
/**jsdoc
- * Get all the active and enabled (running) input devices
- * @function Controller.getRunningInputDevices
- * @returns {string[]} An array of strings with the names
- */
+ * Gets the names of all the active and running (enabled) input devices.
+ * @function Controller.getRunningInputDevices
+ * @returns {string[]} The list of current active and running input devices.
+ * @example List all active and running input devices.
+ * print("Running devices: " + JSON.stringify(Controller.getRunningInputDeviceNames()));
+ */
Q_INVOKABLE QStringList getRunningInputDeviceNames();
bool isMouseCaptured() const { return _mouseCaptured; }
@@ -447,7 +449,7 @@ namespace controller {
public slots:
/**jsdoc
- * Disable processing of mouse "move", "press", "double-press", and "release" events into
+ * Disables processing of mouse "move", "press", "double-press", and "release" events into
* {@link Controller.Hardware|Controller.Hardware.Keyboard} outputs.
* @function Controller.captureMouseEvents
* @example Disable Controller.Hardware.Keyboard mouse events for a short period.
@@ -475,7 +477,7 @@ namespace controller {
virtual void captureMouseEvents() { _mouseCaptured = true; }
/**jsdoc
- * Enable processing of mouse "move", "press", "double-press", and "release" events into
+ * Enables processing of mouse "move", "press", "double-press", and "release" events into
* {@link Controller.Hardware-Keyboard|Controller.Hardware.Keyboard} outputs that were disabled using
* {@link Controller.captureMouseEvents|captureMouseEvents}.
* @function Controller.releaseMouseEvents
@@ -484,7 +486,7 @@ namespace controller {
/**jsdoc
- * Disable processing of touch "begin", "update", and "end" events into
+ * Disables processing of touch "begin", "update", and "end" events into
* {@link Controller.Hardware|Controller.Hardware.Keyboard},
* {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and
* {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs.
@@ -493,7 +495,7 @@ namespace controller {
virtual void captureTouchEvents() { _touchCaptured = true; }
/**jsdoc
- * Enable processing of touch "begin", "update", and "end" events into
+ * Enables processing of touch "begin", "update", and "end" events into
* {@link Controller.Hardware|Controller.Hardware.Keyboard},
* {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and
* {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs that were disabled using
@@ -504,14 +506,14 @@ namespace controller {
/**jsdoc
- * Disable processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
+ * Disables processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
* outputs.
* @function Controller.captureWheelEvents
*/
virtual void captureWheelEvents() { _wheelCaptured = true; }
/**jsdoc
- * Enable processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
+ * Enables processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
* outputs that wer disabled using {@link Controller.captureWheelEvents|captureWheelEvents}.
* @function Controller.releaseWheelEvents
*/
@@ -519,7 +521,7 @@ namespace controller {
/**jsdoc
- * Disable translating and rotating the user's avatar in response to keyboard and controller controls.
+ * Disables translating and rotating the user's avatar in response to keyboard and controller controls.
* @function Controller.captureActionEvents
* @example Disable avatar translation and rotation for a short period.
* Script.setTimeout(function () {
@@ -533,12 +535,19 @@ namespace controller {
virtual void captureActionEvents() { _actionsCaptured = true; }
/**jsdoc
- * Enable translating and rotating the user's avatar in response to keyboard and controller controls that were disabled
+ * Enables translating and rotating the user's avatar in response to keyboard and controller controls that were disabled
* using {@link Controller.captureActionEvents|captureActionEvents}.
* @function Controller.releaseActionEvents
*/
virtual void releaseActionEvents() { _actionsCaptured = false; }
+ /**jsdoc
+ * @function Controller.updateRunningInputDevices
+ * @param {string} deviceName - Device name.
+ * @param {boolean} isRunning - Is running.
+ * @param {string[]} runningDevices - Running devices.
+ * @deprecated This function is deprecated and will be removed.
+ */
void updateRunningInputDevices(const QString& deviceName, bool isRunning, const QStringList& runningDevices);
signals:
@@ -593,7 +602,7 @@ namespace controller {
/**jsdoc
* Triggered when a device is registered or unregistered by a plugin. Not all plugins generate
- * hardwareChanged events: for example connecting or disconnecting a mouse will not generate an event but
+ * hardwareChanged events: for example, connecting or disconnecting a mouse will not generate an event but
* connecting or disconnecting an Xbox controller will.
* @function Controller.hardwareChanged
* @returns {Signal}
@@ -601,13 +610,13 @@ namespace controller {
void hardwareChanged();
/**jsdoc
- * Triggered when a device is enabled/disabled
- * Enabling/Disabling Leapmotion on settings/controls will trigger this signal.
- * @function Controller.deviceRunningChanged
- * @param {string} deviceName - The name of the device that is getting enabled/disabled
- * @param {boolean} isEnabled - Return if the device is enabled.
- * @returns {Signal}
- */
+ * Triggered when an input device starts or stops being active and running (enabled). For example, enabling or
+ * disabling the LeapMotion in Settings > Controls > Calibration will trigger this signal.
+ * @function Controller.inputDeviceRunningChanged
+ * @param {string} deviceName - The name of the device.
+ * @param {boolean} isRunning - true if the device is active and running, false if it isn't.
+ * @returns {Signal}
+ */
void inputDeviceRunningChanged(QString deviceName, bool isRunning);
diff --git a/libraries/controllers/src/controllers/StandardController.cpp b/libraries/controllers/src/controllers/StandardController.cpp
index e1733d2524..a7ae1aae98 100644
--- a/libraries/controllers/src/controllers/StandardController.cpp
+++ b/libraries/controllers/src/controllers/StandardController.cpp
@@ -30,17 +30,16 @@ void StandardController::focusOutEvent() {
/**jsdoc
* The Controller.Standard object has properties representing standard controller outputs. Those for physical
* controllers are based on the XBox controller, with aliases for PlayStation. The property values are integer IDs, uniquely
- * identifying each output. Read-only. These can be mapped to actions or functions in a {@link RouteObject}
- * mapping.
- *
- * The data value provided by each control is either a number or a {@link Pose}. Numbers are typically normalized to
- * 0.0 or 1.0 for button states, the range 0.0 – 1.0 for unidirectional scales,
- * and the range -1.0 – 1.0 for bidirectional scales.
- *
- * Each hardware device has a mapping from its outputs to Controller.Standard items, specified in a JSON file.
- * For example,
- * leapmotion.json and
- * vive.json.
+ * identifying each output. Read-only.
+ * These outputs can be mapped to actions or functions in a {@link RouteObject} mapping. The data value provided by each
+ * control is either a number or a {@link Pose}. Numbers are typically normalized to 0.0 or 1.0 for
+ * button states, the range 0.0 – 1.0 for unidirectional scales, and the range -1.0 – 1.0
+ * for bidirectional scales.
+ * Each hardware device has a mapping from its outputs to a subset of Controller.Standard items, specified in a
+ * JSON file. For example,
+ * vive.json
+ * and
+ * leapmotion.json.
*
*
*
@@ -119,12 +118,12 @@ void StandardController::focusOutEvent() {
* button.
* RightThumbUp | number | number | Right thumb not touching primary or secondary
* thumb buttons. |
- * LeftPrimaryIndex | number | number | Left primary index control pressed.
- * To Do: Implement this for current controllers. |
+ * LeftPrimaryIndex | number | number | Left primary index control
+ * pressed. |
* LeftSecondaryIndex | number | number | Left secondary index control pressed.
* |
* RightPrimaryIndex | number | number | Right primary index control pressed.
- * To Do: Implement this for current controllers. |
+ *
* RightSecondaryIndex | number | number | Right secondary index control pressed.
* |
* LeftPrimaryIndexTouch | number | number | Left index finger is touching primary
diff --git a/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h b/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h
index 845e19f6c3..b51f484f7d 100644
--- a/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h
+++ b/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h
@@ -134,7 +134,7 @@ public:
: _parent(parent), _mapping(mapping) { }
/**jsdoc
- * Create a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
+ * Creates a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
* function.
* This is a QML-specific version of {@link MappingObject#from|from}: use this version in QML files.
* @function MappingObject#fromQml
@@ -145,7 +145,7 @@ public:
Q_INVOKABLE QObject* fromQml(const QJSValue& source);
/**jsdoc
- * Create a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
+ * Creates a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
* direction and the other in the positive direction, ready to be mapped to a standard control, action, or function.
* This is a QML-specific version of {@link MappingObject#makeAxis|makeAxis}: use this version in QML files.
* @function MappingObject#makeAxisQml
@@ -157,7 +157,7 @@ public:
Q_INVOKABLE QObject* makeAxisQml(const QJSValue& source1, const QJSValue& source2);
/**jsdoc
- * Create a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
+ * Creates a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
* function.
* @function MappingObject#from
* @param {Controller.Standard|Controller.Hardware|function} source - The controller output or function that is the source
@@ -167,7 +167,7 @@ public:
Q_INVOKABLE QObject* from(const QScriptValue& source);
/**jsdoc
- * Create a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
+ * Creates a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
* direction and the other in the positive direction, ready to be mapped to a standard control, action, or function.
* @function MappingObject#makeAxis
* @param {Controller.Hardware} source1 - The first, negative-direction controller output.
@@ -189,7 +189,7 @@ public:
Q_INVOKABLE QObject* makeAxis(const QScriptValue& source1, const QScriptValue& source2);
/**jsdoc
- * Enable or disable the mapping. When enabled, the routes in the mapping take effect.
+ * Enables or disables the mapping. When enabled, the routes in the mapping take effect.
* Synonymous with {@link Controller.enableMapping}.
* @function MappingObject#enable
* @param {boolean} enable=true - If true then the mapping is enabled, otherwise it is disabled.
@@ -198,7 +198,7 @@ public:
Q_INVOKABLE QObject* enable(bool enable = true);
/**jsdoc
- * Disable the mapping. When disabled, the routes in the mapping have no effect.
+ * Disables the mapping. When disabled, the routes in the mapping have no effect.
* Synonymous with {@link Controller.disableMapping}.
* @function MappingObject#disable
* @returns {MappingObject} The mapping object, so that further routes can be added.
diff --git a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp
index 048e23be1c..56ace23335 100644
--- a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp
+++ b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.cpp
@@ -66,6 +66,8 @@ QObject* RouteBuilderProxy::peek(bool enable) {
}
QObject* RouteBuilderProxy::when(const QScriptValue& expression) {
+ // FIXME: Support "!" conditional in simple expression and array expression.
+ // Note that "!" is supported when parsing a JSON file, in UserInputMapper::parseConditional().
auto newConditional = _parent.conditionalFor(expression);
if (_route->conditional) {
_route->conditional = ConditionalPointer(new AndConditional(_route->conditional, newConditional));
diff --git a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h
index eb610af78a..e7ff04d72c 100644
--- a/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h
+++ b/libraries/controllers/src/controllers/impl/RouteBuilderProxy.h
@@ -51,7 +51,7 @@ class RouteBuilderProxy : public QObject {
: _parent(parent), _mapping(mapping), _route(route) { }
/**jsdoc
- * Terminate the route with a standard control, an action, or a script function. The output value from the route is
+ * Terminates the route with a standard control, an action, or a script function. The output value from the route is
* sent to the specified destination.
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files.
* @function RouteObject#toQml
@@ -62,7 +62,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE void toQml(const QJSValue& destination);
/**jsdoc
- * Process the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
+ * Processes the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
* the input is read only if the condition is true . Thus, if the condition is not met then subsequent
* routes using the same input are processed.
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files.
@@ -81,7 +81,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* whenQml(const QJSValue& expression);
/**jsdoc
- * Terminate the route with a standard control, an action, or a script function. The output value from the route is
+ * Terminates the route with a standard control, an action, or a script function. The output value from the route is
* sent to the specified destination.
* @function RouteObject#to
* @param {Controller.Standard|Controller.Actions|function} destination - The standard control, action, or JavaScript
@@ -117,7 +117,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE void to(const QScriptValue& destination);
/**jsdoc
- * Enable and disabling writing debug information for a route to the program log.
+ * Enables or disables writing debug information for a route to the program log.
* @function RouteObject#debug
* @param {boolean} [enable=true] - If true then writing debug information is enabled for the route,
* otherwise it is disabled.
@@ -147,7 +147,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* debug(bool enable = true);
/**jsdoc
- * Process the route without marking the controller output as having been read, so that other routes from the same
+ * Processes the route without marking the controller output as having been read, so that other routes from the same
* controller output can also process.
* @function RouteObject#peek
* @param {boolean} [enable=true] - If true then the route is processed without marking the route's
@@ -157,7 +157,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* peek(bool enable = true);
/**jsdoc
- * Process the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
+ * Processes the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
* the input is read only if the condition is true . Thus, if the condition is not met then subsequent
* routes using the same input are processed.
* @function RouteObject#when
@@ -170,6 +170,8 @@ class RouteBuilderProxy : public QObject {
* definition.
*
* If an array of conditions is provided, their values are ANDed together.
+ * Warning: The use of ! is not currently supported in JavaScript .when()
+ * calls.
* @returns {RouteObject} The RouteObject with the condition added.
* @example Process the right trigger differently in HMD and desktop modes.
* var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping";
@@ -193,7 +195,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* when(const QScriptValue& expression);
/**jsdoc
- * Filter numeric route values to lie between two values; values outside this range are not passed on through the
+ * Filters numeric route values to lie between two values; values outside this range are not passed on through the
* route.
* @function RouteObject#clamp
* @param {number} min - The minimum value to pass through.
@@ -214,7 +216,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* clamp(float min, float max);
/**jsdoc
- * Filter numeric route values such that they are rounded to 0 or 1 without output values
+ * Filters numeric route values such that they are rounded to 0 or 1 without output values
* flickering when the input value hovers around 0.5 . For example, this enables you to use an analog input
* as if it were a toggle.
* @function RouteObject#hysteresis
@@ -239,7 +241,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* hysteresis(float min, float max);
/**jsdoc
- * Filter numeric route values to send at a specified interval.
+ * Filters numeric route values to send at a specified interval.
* @function RouteObject#pulse
* @param {number} interval - The interval between sending values, in seconds.
* @returns {RouteObject} The RouteObject with the filter applied.
@@ -258,7 +260,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* pulse(float interval);
/**jsdoc
- * Filter numeric and {@link Pose} route values to be scaled by a constant amount.
+ * Filters numeric and {@link Pose} route values to be scaled by a constant amount.
* @function RouteObject#scale
* @param {number} multiplier - The scale to multiply the value by.
* @returns {RouteObject} The RouteObject with the filter applied.
@@ -280,7 +282,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* scale(float multiplier);
/**jsdoc
- * Filter numeric and {@link Pose} route values to have the opposite sign, e.g., 0.5 is changed to
+ * Filters numeric and {@link Pose} route values to have the opposite sign, e.g., 0.5 is changed to
* -0.5 .
* @function RouteObject#invert
* @returns {RouteObject} The RouteObject with the filter applied.
@@ -302,7 +304,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* invert();
/**jsdoc
- * Filter numeric route values such that they're sent only when the input value is outside a dead-zone. When the input
+ * Filters numeric route values such that they're sent only when the input value is outside a dead-zone. When the input
* passes the dead-zone value, output is sent starting at 0.0 and catching up with the input value. As the
* input returns toward the dead-zone value, output values reduce to 0.0 at the dead-zone value.
* @function RouteObject#deadZone
@@ -324,7 +326,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* deadZone(float min);
/**jsdoc
- * Filter numeric route values such that they are rounded to -1 , 0 , or 1 .
+ * Filters numeric route values such that they are rounded to -1 , 0 , or 1 .
* For example, this enables you to use an analog input as if it were a toggle or, in the case of a bidirectional axis,
* a tri-state switch.
* @function RouteObject#constrainToInteger
@@ -345,7 +347,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* constrainToInteger();
/**jsdoc
- * Filter numeric route values such that they are rounded to 0 or 1 . For example, this
+ * Filters numeric route values such that they are rounded to 0 or 1 . For example, this
* enables you to use an analog input as if it were a toggle.
* @function RouteObject#constrainToPositiveInteger
* @returns {RouteObject} The RouteObject with the filter applied.
@@ -364,7 +366,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* constrainToPositiveInteger();
/**jsdoc
- * Filter {@link Pose} route values to have a pre-translation applied.
+ * Filters {@link Pose} route values to have a pre-translation applied.
* @function RouteObject#translate
* @param {Vec3} translate - The pre-translation to add to the pose.
* @returns {RouteObject} The RouteObject with the pre-translation applied.
@@ -373,7 +375,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* translate(glm::vec3 translate);
/**jsdoc
- * Filter {@link Pose} route values to have a pre-transform applied.
+ * Filters {@link Pose} route values to have a pre-transform applied.
* @function RouteObject#transform
* @param {Mat4} transform - The pre-transform to apply.
* @returns {RouteObject} The RouteObject with the pre-transform applied.
@@ -382,7 +384,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* transform(glm::mat4 transform);
/**jsdoc
- * Filter {@link Pose} route values to have a post-transform applied.
+ * Filters {@link Pose} route values to have a post-transform applied.
* @function RouteObject#postTransform
* @param {Mat4} transform - The post-transform to apply.
* @returns {RouteObject} The RouteObject with the post-transform applied.
@@ -391,7 +393,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* postTransform(glm::mat4 transform);
/**jsdoc
- * Filter {@link Pose} route values to have a pre-rotation applied.
+ * Filters {@link Pose} route values to have a pre-rotation applied.
* @function RouteObject#rotate
* @param {Quat} rotation - The pre-rotation to add to the pose.
* @returns {RouteObject} The RouteObject with the pre-rotation applied.
@@ -400,7 +402,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* rotate(glm::quat rotation);
/**jsdoc
- * Filter {@link Pose} route values to be smoothed by a low velocity filter. The filter's rotation and translation
+ * Filters {@link Pose} route values to be smoothed by a low velocity filter. The filter's rotation and translation
* values are calculated as: (1 - f) * currentValue + f * previousValue where
* f = currentVelocity / filterConstant . At low velocities, the filter value is largely the previous
* value; at high velocities the value is wholly the current controller value.
@@ -415,7 +417,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* lowVelocity(float rotationConstant, float translationConstant);
/**jsdoc
- * Filter {@link Pose} route values to be smoothed by an exponential decay filter. The filter's rotation and
+ * Filters {@link Pose} route values to be smoothed by an exponential decay filter. The filter's rotation and
* translation values are calculated as: filterConstant * currentValue + (1 - filterConstant) *
* previousValue . Values near 1 are less smooth with lower latency; values near 0 are more smooth with higher
* latency.
@@ -428,7 +430,7 @@ class RouteBuilderProxy : public QObject {
Q_INVOKABLE QObject* exponentialSmoothing(float rotationConstant, float translationConstant);
/**jsdoc
- * Filter numeric route values such that a value of 0.0 is changed to 1.0 , and other values
+ * Filters numeric route values such that a value of 0.0 is changed to 1.0 , and other values
* are changed to 0.0 .
* @function RouteObject#logicalNot
* @returns {RouteObject} The RouteObject with the filter applied.
diff --git a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp
index 3383d71a52..78dd14868c 100755
--- a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp
+++ b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp
@@ -219,9 +219,10 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic
/**jsdoc
* The Controller.Hardware.Keyboard object has properties representing keyboard, mouse, and display touch
- * events. The property values are integer IDs, uniquely identifying each output. Read-only. These can be mapped to
- * actions or functions or Controller.Standard items in a {@link RouteObject} mapping. For presses, each data
- * value is either 1.0 for "true" or 0.0 for "false".
+ * events. The property values are integer IDs, uniquely identifying each output. Read-only.
+ * These events can be mapped to actions or functions or Controller.Standard items in a {@link RouteObject}
+ * mapping. For presses, each data value is either 1.0 for "true" or 0.0 for "false".
+ *
*
*
* Property | Type | Data | Description |
@@ -274,9 +275,13 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic
* MouseWheelLeft | number | number | The mouse wheel rotated left. The data value
* is the number of units rotated (typically 1.0 ). |
* MouseWheelUp | number | number | The mouse wheel rotated up. The data value
- * is the number of units rotated (typically 1.0 ). |
+ * is the number of units rotated (typically 1.0 ).
+ * Warning: The mouse wheel in an ordinary mouse generates left/right wheel events instead of
+ * up/down.
* MouseWheelDown | number | number | The mouse wheel rotated down. The data value
- * is the number of units rotated (typically 1.0 ). |
+ * is the number of units rotated (typically 1.0 ).
+ * Warning: The mouse wheel in an ordinary mouse generates left/right wheel events instead of
+ * up/down.
* TouchpadRight | number | number | The average touch on a touch-enabled device
* moved right. The data value is how far the average position of all touch points moved. |
* TouchpadLeft | number | number | The average touch on a touch-enabled device
@@ -288,7 +293,6 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic
*
* |
* @typedef {object} Controller.Hardware-Keyboard
- * @todo Currently, the mouse wheel in an ordinary mouse generates left/right wheel events instead of up/down.
*/
controller::Input::NamedVector KeyboardMouseDevice::InputDevice::getAvailableInputs() const {
using namespace controller;
diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp
index 8d97ff78af..14830f3f04 100644
--- a/plugins/oculus/src/OculusControllerManager.cpp
+++ b/plugins/oculus/src/OculusControllerManager.cpp
@@ -409,9 +409,10 @@ void OculusControllerManager::TouchDevice::stopHapticPulse(bool leftHand) {
}
/**jsdoc
- * The Controller.Hardware.OculusTouch object has properties representing Oculus Rift. The property values are
- * integer IDs, uniquely identifying each output. Read-only. These can be mapped to actions or functions or
- * Controller.Standard items in a {@link RouteObject} mapping.
+ * The Controller.Hardware.OculusTouch object has properties representing the Oculus Rift. The property values
+ * are integer IDs, uniquely identifying each output. Read-only.
+ * These outputs can be mapped to actions or functions or Controller.Standard items in a {@link RouteObject}
+ * mapping.
*
*
* Property | Type | Data | Description |
diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp
index 34ebb73fda..c21a9ae4df 100644
--- a/plugins/openvr/src/ViveControllerManager.cpp
+++ b/plugins/openvr/src/ViveControllerManager.cpp
@@ -1299,14 +1299,20 @@ void ViveControllerManager::InputDevice::setConfigFromString(const QString& valu
}
/**jsdoc
- * The Controller.Hardware.Vive object has properties representing Vive. The property values are integer IDs,
- * uniquely identifying each output. Read-only. These can be mapped to actions or functions or
- * Controller.Standard items in a {@link RouteObject} mapping.
+ * The Controller.Hardware.Vive object has properties representing the Vive. The property values are integer
+ * IDs, uniquely identifying each output. Read-only.
+ * These outputs can be mapped to actions or functions or Controller.Standard items in a {@link RouteObject}
+ * mapping.
*
*
* Property | Type | Data | Description |
*
*
+ * Buttons |
+ * LeftApplicationMenu | number | number | Left application menu button pressed.
+ * |
+ * RightApplicationMenu | number | number | Right application menu button pressed.
+ * |
* Touch Pad (Sticks) |
* LX | number | number | Left touch pad x-axis scale. |
* LY | number | number | Left touch pad y-axis scale. |
From 9a70416f2b89f9a923210eab81b0ac89ccf70112 Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Wed, 10 Apr 2019 12:04:53 +1200
Subject: [PATCH 02/11] Update Clipboard JSDoc
---
.../scripting/ClipboardScriptingInterface.h | 84 +++++++++++++------
1 file changed, 60 insertions(+), 24 deletions(-)
diff --git a/interface/src/scripting/ClipboardScriptingInterface.h b/interface/src/scripting/ClipboardScriptingInterface.h
index 42f2205861..9e72d9ea15 100644
--- a/interface/src/scripting/ClipboardScriptingInterface.h
+++ b/interface/src/scripting/ClipboardScriptingInterface.h
@@ -18,7 +18,7 @@
#include
/**jsdoc
- * The Clipboard API enables you to export and import entities to and from JSON files.
+ * The Clipboard API enables you to export and import entities to and from JSON files.
*
* @namespace Clipboard
*
@@ -33,56 +33,92 @@ public:
public:
/**jsdoc
- * Compute the extents of the contents held in the clipboard.
+ * Gets the extents of the entities held in the clipboard.
* @function Clipboard.getContentsDimensions
- * @returns {Vec3} The extents of the contents held in the clipboard.
+ * @returns {Vec3} The extents of the content held in the clipboard.
+ * @example Import entities to the clipboard and report their overall dimensions.
+ * var filename = Window.browse("Import entities to clipboard", "", "*.json");
+ * if (filename) {
+ * if (Clipboard.importEntities(filename)) {
+ * print("Clipboard dimensions: " + JSON.stringify(Clipboard.getContentsDimensions()));
+ * }
+ * }
*/
Q_INVOKABLE glm::vec3 getContentsDimensions();
/**jsdoc
- * Compute the largest dimension of the extents of the contents held in the clipboard.
+ * Gets the largest dimension of the extents of the entities held in the clipboard.
* @function Clipboard.getClipboardContentsLargestDimension
- * @returns {number} The largest dimension computed.
+ * @returns {number} The largest dimension of the extents of the content held in the clipboard.
*/
Q_INVOKABLE float getClipboardContentsLargestDimension();
/**jsdoc
- * Import entities from a JSON file containing entity data into the clipboard.
- * You can generate a JSON file using {@link Clipboard.exportEntities}.
+ * Imports entities from a JSON file into the clipboard.
* @function Clipboard.importEntities
- * @param {string} filename Path and name of file to import.
- * @param {boolean} does the ResourceRequestObserver observe this request?
- * @param {number} optional internal id of object causing this import.
+ * @param {string} filename - The path and name of the JSON file to import.
+ * @param {boolean} [isObservable=true] - true if the {@link ResourceRequestObserver} can observe this
+ * request, false if it can't.
+ * @param {number} [callerID=-1] - An integer ID that is passed through to the {@link ResourceRequestObserver}.
* @returns {boolean} true if the import was successful, otherwise false .
+ * @example Import entities and paste into the domain.
+ * var filename = Window.browse("Import entities to clipboard", "", "*.json");
+ * if (filename) {
+ * if (Clipboard.importEntities(filename)) {
+ * pastedEntities = Clipboard.pasteEntities(Vec3.sum(MyAvatar.position,
+ * Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })));
+ * print("Entities pasted: " + JSON.stringify(pastedEntities));
+ * }
+ * }
*/
Q_INVOKABLE bool importEntities(const QString& filename, const bool isObservable = true, const qint64 callerId = -1);
/**jsdoc
- * Export the entities specified to a JSON file.
+ * Exports specified entities to a JSON file.
* @function Clipboard.exportEntities
- * @param {string} filename Path and name of the file to export the entities to. Should have the extension ".json".
- * @param {Uuid[]} entityIDs Array of IDs of the entities to export.
- * @returns {boolean} true if the export was successful, otherwise false .
+ * @param {string} filename - Path and name of the file to export the entities to. Should have the extension ".json".
+ * @param {Uuid[]} entityIDs - The IDs of the entities to export.
+ * @returns {boolean} true if entities were found and the file was written, otherwise false .
+ * @example Create and export a cube and a sphere.
+ * // Create entities.
+ * var box = Entities.addEntity({
+ * type: "Box",
+ * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: -0.2, y: 0, z: -3 })),
+ * lifetime: 300 // Delete after 5 minutes.
+ * });
+ * var sphere = Entities.addEntity({
+ * type: "Sphere",
+ * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0.2, y: 0, z: -3 })),
+ * lifetime: 300 // Delete after 5 minutes.
+ * });
+ *
+ * // Export entities.
+ * var filename = Window.save("Export entities to JSON file", Paths.resources, "*.json");
+ * if (filename) {
+ * Clipboard.exportEntities(filename, [box, sphere]);
+ * }
*/
Q_INVOKABLE bool exportEntities(const QString& filename, const QVector& entityIDs);
/**jsdoc
- * Export the entities with centers within a cube to a JSON file.
+ * Exports all entities that have centers within a cube to a JSON file.
* @function Clipboard.exportEntities
- * @param {string} filename Path and name of the file to export the entities to. Should have the extension ".json".
- * @param {number} x X-coordinate of the cube center.
- * @param {number} y Y-coordinate of the cube center.
- * @param {number} z Z-coordinate of the cube center.
- * @param {number} scale Half dimension of the cube.
- * @returns {boolean} true if the export was successful, otherwise false .
+ * @variation 0
+ * @param {string} filename - Path and name of the file to export the entities to. Should have the extension ".json".
+ * @param {number} x - X-coordinate of the cube center.
+ * @param {number} y - Y-coordinate of the cube center.
+ * @param {number} z - Z-coordinate of the cube center.
+ * @param {number} scale - Half dimension of the cube.
+ * @returns {boolean} true if entities were found and the file was written, otherwise false .
*/
Q_INVOKABLE bool exportEntities(const QString& filename, float x, float y, float z, float scale);
/**jsdoc
- * Paste the contents of the clipboard into the world.
+ * Pastes the contents of the clipboard into the domain.
* @function Clipboard.pasteEntities
- * @param {Vec3} position Position to paste the clipboard contents at.
- * @returns {Uuid[]} Array of entity IDs for the new entities that were created as a result of the paste operation.
+ * @param {Vec3} position - The position to paste the clipboard contents at.
+ * @returns {Uuid[]} The IDs of the new entities that were created as a result of the paste operation. If entities couldn't
+ * be created then an empty array is returned.
*/
Q_INVOKABLE QVector pasteEntities(glm::vec3 position);
};
From d587f1227d9bfccbf64228bd8f97de8ac825fc98 Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Wed, 10 Apr 2019 12:05:15 +1200
Subject: [PATCH 03/11] Add ResourceRequestObserver JSDoc
---
.../shared/src/ResourceRequestObserver.cpp | 7 ++++
.../shared/src/ResourceRequestObserver.h | 34 ++++++++++++++++++-
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/libraries/shared/src/ResourceRequestObserver.cpp b/libraries/shared/src/ResourceRequestObserver.cpp
index 608d6905c5..21f4d56173 100644
--- a/libraries/shared/src/ResourceRequestObserver.cpp
+++ b/libraries/shared/src/ResourceRequestObserver.cpp
@@ -16,6 +16,13 @@
#include
#include
+/**jsdoc
+ * Information about a resource request.
+ * @typedef {object} ResourceRequestObserver.ResourceRequest
+ * @property {string} url - The URL of the resource request.
+ * @property {number} callerId - An ID identifying the request.
+ * @property {string} extra - Extra information about the request.
+ */
void ResourceRequestObserver::update(const QUrl& requestUrl,
const qint64 callerId,
const QString& extra) {
diff --git a/libraries/shared/src/ResourceRequestObserver.h b/libraries/shared/src/ResourceRequestObserver.h
index edf3c617cb..352f01c3a5 100644
--- a/libraries/shared/src/ResourceRequestObserver.h
+++ b/libraries/shared/src/ResourceRequestObserver.h
@@ -16,7 +16,15 @@
#include "DependencyManager.h"
-
+/**jsdoc
+ * The ResourceRequestObserver API provides notifications when an observable resource request is made.
+ *
+ * @namespace ResourceRequestObserver
+ *
+ * @hifi-interface
+ * @hifi-client-entity
+ * @hifi-avatar
+ */
class ResourceRequestObserver : public QObject, public Dependency {
Q_OBJECT
SINGLETON_DEPENDENCY
@@ -25,5 +33,29 @@ public:
void update(const QUrl& requestUrl, const qint64 callerId = -1, const QString& extra = "");
signals:
+ /**jsdoc
+ * Triggered when an observable resource request is made.
+ * @function ResourceRequestObserver.resourceRequestEvent
+ * @param {ResourceRequestObserver.ResourceRequest} request - Information about the resource request.
+ * @returns {Signal}
+ * @example Report when a particular Clipboard.importEntities() resource request is made.
+ * ResourceRequestObserver.resourceRequestEvent.connect(function (request) {
+ * if (request.callerId === 100) {
+ * print("Resource request: " + JSON.stringify(request));
+ * }
+ * });
+ *
+ * function importEntities() {
+ * var filename = Window.browse("Import entities to clipboard", "", "*.json");
+ * if (filename) {
+ * Clipboard.importEntities(filename, true, 100);
+ * pastedEntities = Clipboard.pasteEntities(Vec3.sum(MyAvatar.position,
+ * Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })));
+ * print("Entities pasted: " + JSON.stringify(pastedEntities));
+ * }
+ * }
+ *
+ * Script.setTimeout(importEntities, 2000);
+ */
void resourceRequestEvent(QVariantMap result);
};
From e1e755622640065a7756af4d986ae15c47a5f975 Mon Sep 17 00:00:00 2001
From: Clement
Date: Wed, 24 Apr 2019 13:40:20 -0700
Subject: [PATCH 04/11] Fix cmake warnings
---
cmake/compiler.cmake | 2 +-
cmake/externals/LibOVR/CMakeLists.txt | 22 +++++++++----------
cmake/externals/LibOVRPlatform/CMakeLists.txt | 6 ++---
cmake/externals/hifiAudioCodec/CMakeLists.txt | 6 ++---
cmake/externals/neuron/CMakeLists.txt | 12 +++++-----
cmake/externals/sixense/CMakeLists.txt | 6 ++---
cmake/externals/steamworks/CMakeLists.txt | 8 +++----
cmake/externals/tbb/CMakeLists.txt | 2 +-
cmake/macros/TargetBreakpad.cmake | 2 +-
cmake/macros/TargetBullet.cmake | 2 +-
cmake/macros/TargetDraco.cmake | 4 ++--
cmake/macros/TargetHifiAudioCodec.cmake | 4 ++--
cmake/macros/TargetNvtt.cmake | 4 ++--
cmake/macros/TargetOpenSSL.cmake | 4 ++--
cmake/macros/TargetPolyvox.cmake | 2 +-
15 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake
index bc35d2f2f8..3615b80cda 100644
--- a/cmake/compiler.cmake
+++ b/cmake/compiler.cmake
@@ -89,7 +89,7 @@ if (APPLE)
string(REGEX MATCH "^[0-9]+\\.[0-9]+" OSX_VERSION ${OSX_VERSION})
message(STATUS "Detected OS X version = ${OSX_VERSION}")
- set(OSX_SDK "${OSX_VERSION}" CACHE String "OS X SDK version to look for inside Xcode bundle or at OSX_SDK_PATH")
+ set(OSX_SDK "${OSX_VERSION}" CACHE STRING "OS X SDK version to look for inside Xcode bundle or at OSX_SDK_PATH")
# set our OS X deployment target
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
diff --git a/cmake/externals/LibOVR/CMakeLists.txt b/cmake/externals/LibOVR/CMakeLists.txt
index 481753f7e0..53c4c2976c 100644
--- a/cmake/externals/LibOVR/CMakeLists.txt
+++ b/cmake/externals/LibOVR/CMakeLists.txt
@@ -27,12 +27,12 @@ if (WIN32)
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
set(LIBOVR_DIR ${INSTALL_DIR})
- set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${LIBOVR_DIR}/Include CACHE TYPE INTERNAL)
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${LIBOVR_DIR}/Lib/LibOVRd.lib CACHE TYPE INTERNAL)
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${LIBOVR_DIR}/Lib/LibOVR.lib CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${LIBOVR_DIR}/Include CACHE STRING INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${LIBOVR_DIR}/Lib/LibOVRd.lib CACHE STRING INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${LIBOVR_DIR}/Lib/LibOVR.lib CACHE STRING INTERNAL)
include(SelectLibraryConfigurations)
select_library_configurations(LIBOVR)
- set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARIES} CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARIES} CACHE STRING INTERNAL)
elseif(APPLE)
@@ -50,11 +50,11 @@ elseif(APPLE)
# In theory we should use the Headers path inside the framework, as seen here
# but unfortunately Oculus doesn't seem to have figured out automated testing
# so they released a framework with missing headers.
- #set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/Headers/ CACHE TYPE INTERNAL)
+ #set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/Headers/ CACHE STRING INTERNAL)
# Work around the broken framework by using a different path for the headers.
- set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include CACHE TYPE INTERNAL)
- set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/LibOVR CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include CACHE STRING INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/LibOVR CACHE STRING INTERNAL)
@@ -74,8 +74,8 @@ elseif(NOT ANDROID)
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${INSTALL_DIR}/lib/libovr.a CACHE TYPE INTERNAL)
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG "" CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${INSTALL_DIR}/lib/libovr.a CACHE STRING INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG "" CACHE STRING INTERNAL)
find_package(Threads REQUIRED)
find_package(X11 REQUIRED)
@@ -89,8 +89,8 @@ elseif(NOT ANDROID)
select_library_configurations(${EXTERNAL_NAME_UPPER})
- set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include ${SOURCE_DIR}/LibOVR/Src CACHE TYPE INTERNAL)
- set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARY} ${${EXTERNAL_NAME_UPPER}_LIBRARY_EXTRAS} CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include ${SOURCE_DIR}/LibOVR/Src CACHE STRING INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARY} ${${EXTERNAL_NAME_UPPER}_LIBRARY_EXTRAS} CACHE STRING INTERNAL)
endif()
# Hide this external target (for ide users)
diff --git a/cmake/externals/LibOVRPlatform/CMakeLists.txt b/cmake/externals/LibOVRPlatform/CMakeLists.txt
index 895efa9357..adf89823f2 100644
--- a/cmake/externals/LibOVRPlatform/CMakeLists.txt
+++ b/cmake/externals/LibOVRPlatform/CMakeLists.txt
@@ -20,12 +20,12 @@ if (WIN32)
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform64_1.lib CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform64_1.lib CACHE STRING INTERNAL)
else()
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform32_1.lib CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform32_1.lib CACHE STRING INTERNAL)
endif()
- set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/Include CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/Include CACHE STRING INTERNAL)
endif ()
# Hide this external target (for ide users)
diff --git a/cmake/externals/hifiAudioCodec/CMakeLists.txt b/cmake/externals/hifiAudioCodec/CMakeLists.txt
index 8a8e2573d5..5d439cd519 100644
--- a/cmake/externals/hifiAudioCodec/CMakeLists.txt
+++ b/cmake/externals/hifiAudioCodec/CMakeLists.txt
@@ -36,10 +36,10 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
-set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE TYPE INTERNAL)
+set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE STRING INTERNAL)
if (WIN32)
- set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/audio.lib CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/audio.lib CACHE STRING INTERNAL)
else()
- set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/libaudio.a CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/libaudio.a CACHE STRING INTERNAL)
endif()
diff --git a/cmake/externals/neuron/CMakeLists.txt b/cmake/externals/neuron/CMakeLists.txt
index 5ac38bc442..049e175354 100644
--- a/cmake/externals/neuron/CMakeLists.txt
+++ b/cmake/externals/neuron/CMakeLists.txt
@@ -21,9 +21,9 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
# set include dir
if(WIN32)
- set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Windows/include" CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Windows/include" CACHE STRING INTERNAL)
elseif(APPLE)
- set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Mac/include" CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Mac/include" CACHE STRING INTERNAL)
else()
# Unsupported
endif()
@@ -37,16 +37,16 @@ if(WIN32)
endif()
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/NeuronDataReader_Windows/lib/${ARCH_DIR}")
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE TYPE INTERNAL)
- set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE STRING INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE STRING INTERNAL)
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_LIB_PATH}")
elseif(APPLE)
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/NeuronDataReader_Mac/dylib")
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE TYPE INTERNAL)
- set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE STRING INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE STRING INTERNAL)
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_LIB_PATH}")
diff --git a/cmake/externals/sixense/CMakeLists.txt b/cmake/externals/sixense/CMakeLists.txt
index 17d2f98e2d..35f7758820 100644
--- a/cmake/externals/sixense/CMakeLists.txt
+++ b/cmake/externals/sixense/CMakeLists.txt
@@ -30,7 +30,7 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
-set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE TYPE INTERNAL)
+set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE STRING INTERNAL)
if (WIN32)
@@ -52,7 +52,7 @@ if (WIN32)
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/lib/${ARCH_DIR}/release_dll")
endif()
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/sixense${ARCH_SUFFIX}.lib" CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/sixense${ARCH_SUFFIX}.lib" CACHE STRING INTERNAL)
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_DLL_PATH}")
elseif(APPLE)
@@ -62,7 +62,7 @@ elseif(APPLE)
elseif(NOT ANDROID)
# FIXME need to account for different architectures
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/lib/linux_x64/release/libsixense_x64.so CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/lib/linux_x64/release/libsixense_x64.so CACHE STRING INTERNAL)
endif()
diff --git a/cmake/externals/steamworks/CMakeLists.txt b/cmake/externals/steamworks/CMakeLists.txt
index 30b3926436..eb61d22f8b 100644
--- a/cmake/externals/steamworks/CMakeLists.txt
+++ b/cmake/externals/steamworks/CMakeLists.txt
@@ -21,7 +21,7 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
-set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/public CACHE TYPE INTERNAL)
+set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/public CACHE STRING INTERNAL)
if (WIN32)
@@ -36,12 +36,12 @@ if (WIN32)
set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${ARCH_DIR})
set(${EXTERNAL_NAME_UPPER}_LIB_PATH ${ARCH_DIR})
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/steam_api${ARCH_SUFFIX}.lib" CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/steam_api${ARCH_SUFFIX}.lib" CACHE STRING INTERNAL)
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_DLL_PATH}")
elseif(APPLE)
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/osx32/libsteam_api.dylib CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/osx32/libsteam_api.dylib CACHE STRING INTERNAL)
set(_STEAMWORKS_LIB_DIR "${SOURCE_DIR}/redistributable_bin/osx32")
ExternalProject_Add_Step(
@@ -57,6 +57,6 @@ elseif(APPLE)
elseif(NOT ANDROID)
# FIXME need to account for different architectures
- set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/linux64/libsteam_api.so CACHE TYPE INTERNAL)
+ set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/linux64/libsteam_api.so CACHE STRING INTERNAL)
endif()
diff --git a/cmake/externals/tbb/CMakeLists.txt b/cmake/externals/tbb/CMakeLists.txt
index 436cae79a1..1788922ef2 100644
--- a/cmake/externals/tbb/CMakeLists.txt
+++ b/cmake/externals/tbb/CMakeLists.txt
@@ -102,6 +102,6 @@ if (DEFINED _TBB_LIB_DIR)
endif ()
if (DEFINED ${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE)
- set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE TYPE "List of tbb include directories")
+ set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE STRING "List of tbb include directories")
endif ()
diff --git a/cmake/macros/TargetBreakpad.cmake b/cmake/macros/TargetBreakpad.cmake
index dac581d6c7..58626ad17b 100644
--- a/cmake/macros/TargetBreakpad.cmake
+++ b/cmake/macros/TargetBreakpad.cmake
@@ -8,7 +8,7 @@
macro(TARGET_BREAKPAD)
if (ANDROID)
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/breakpad)
- set(BREAKPAD_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE TYPE INTERNAL)
+ set(BREAKPAD_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE STRING INTERNAL)
set(LIB_DIR ${INSTALL_DIR}/lib)
list(APPEND BREAKPAD_LIBRARIES ${LIB_DIR}/libbreakpad_client.a)
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BREAKPAD_INCLUDE_DIRS})
diff --git a/cmake/macros/TargetBullet.cmake b/cmake/macros/TargetBullet.cmake
index 1f4050dd42..843b03ac13 100644
--- a/cmake/macros/TargetBullet.cmake
+++ b/cmake/macros/TargetBullet.cmake
@@ -8,7 +8,7 @@
macro(TARGET_BULLET)
if (ANDROID)
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/bullet)
- set(BULLET_INCLUDE_DIRS "${INSTALL_DIR}/include/bullet" CACHE TYPE INTERNAL)
+ set(BULLET_INCLUDE_DIRS "${INSTALL_DIR}/include/bullet" CACHE STRING INTERNAL)
set(LIB_DIR ${INSTALL_DIR}/lib)
list(APPEND BULLET_LIBRARIES ${LIB_DIR}/libBulletDynamics.a)
diff --git a/cmake/macros/TargetDraco.cmake b/cmake/macros/TargetDraco.cmake
index 9dbfa865b8..520786d4c3 100755
--- a/cmake/macros/TargetDraco.cmake
+++ b/cmake/macros/TargetDraco.cmake
@@ -3,7 +3,7 @@ macro(TARGET_DRACO)
find_library(LIBPATH ${LIB} PATHS )
if (ANDROID)
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/draco)
- set(DRACO_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE TYPE INTERNAL)
+ set(DRACO_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE STRING INTERNAL)
set(LIB_DIR ${INSTALL_DIR}/lib)
list(APPEND DRACO_LIBRARIES ${LIB_DIR}/libdraco.a)
list(APPEND DRACO_LIBRARIES ${LIB_DIR}/libdracodec.a)
@@ -21,4 +21,4 @@ macro(TARGET_DRACO)
select_library_configurations(DRACO)
target_link_libraries(${TARGET_NAME} ${DRACO_LIBRARY})
endif()
-endmacro()
\ No newline at end of file
+endmacro()
diff --git a/cmake/macros/TargetHifiAudioCodec.cmake b/cmake/macros/TargetHifiAudioCodec.cmake
index 98c24e684c..4eaccc4f25 100644
--- a/cmake/macros/TargetHifiAudioCodec.cmake
+++ b/cmake/macros/TargetHifiAudioCodec.cmake
@@ -9,9 +9,9 @@ macro(TARGET_HIFIAUDIOCODEC)
if (ANDROID)
set(HIFIAC_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/hifiAC/codecSDK)
set(HIFIAC_LIB_DIR "${HIFIAC_INSTALL_DIR}/Release")
- set(HIFIAC_INCLUDE_DIRS "${HIFIAC_INSTALL_DIR}/include" CACHE TYPE INTERNAL)
+ set(HIFIAC_INCLUDE_DIRS "${HIFIAC_INSTALL_DIR}/include" CACHE STRING INTERNAL)
list(APPEND HIFIAC_LIBS "${HIFIAC_LIB_DIR}/libaudio.a")
- set(HIFIAC_LIBRARIES ${HIFIAC_LIBS} CACHE TYPE INTERNAL)
+ set(HIFIAC_LIBRARIES ${HIFIAC_LIBS} CACHE STRING INTERNAL)
else()
add_dependency_external_projects(hifiAudioCodec)
target_include_directories(${TARGET_NAME} PRIVATE ${HIFIAUDIOCODEC_INCLUDE_DIRS})
diff --git a/cmake/macros/TargetNvtt.cmake b/cmake/macros/TargetNvtt.cmake
index 8227355cb9..c2f243563f 100644
--- a/cmake/macros/TargetNvtt.cmake
+++ b/cmake/macros/TargetNvtt.cmake
@@ -9,12 +9,12 @@ macro(TARGET_NVTT)
if (ANDROID)
set(NVTT_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/nvtt)
set(NVTT_LIB_DIR "${NVTT_INSTALL_DIR}/lib")
- set(NVTT_INCLUDE_DIRS "${NVTT_INSTALL_DIR}/include" CACHE TYPE INTERNAL)
+ set(NVTT_INCLUDE_DIRS "${NVTT_INSTALL_DIR}/include" CACHE STRING INTERNAL)
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvcore.so")
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvmath.so")
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvimage.so")
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvtt.so")
- set(NVTT_LIBRARIES ${NVTT_LIBS} CACHE TYPE INTERNAL)
+ set(NVTT_LIBRARIES ${NVTT_LIBS} CACHE STRING INTERNAL)
target_include_directories(${TARGET_NAME} PRIVATE ${NVTT_INCLUDE_DIRS})
else()
find_library(NVTT_LIBRARY_RELEASE nvtt PATHS ${VCPKG_INSTALL_ROOT}/lib NO_DEFAULT_PATH)
diff --git a/cmake/macros/TargetOpenSSL.cmake b/cmake/macros/TargetOpenSSL.cmake
index 3faaab5801..f74015201d 100644
--- a/cmake/macros/TargetOpenSSL.cmake
+++ b/cmake/macros/TargetOpenSSL.cmake
@@ -8,8 +8,8 @@
macro(TARGET_OPENSSL)
if (ANDROID)
set(OPENSSL_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/openssl)
- set(OPENSSL_INCLUDE_DIR "${OPENSSL_INSTALL_DIR}/include" CACHE TYPE INTERNAL)
- set(OPENSSL_LIBRARIES "${OPENSSL_INSTALL_DIR}/lib/libcrypto.a;${OPENSSL_INSTALL_DIR}/lib/libssl.a" CACHE TYPE INTERNAL)
+ set(OPENSSL_INCLUDE_DIR "${OPENSSL_INSTALL_DIR}/include" CACHE STRING INTERNAL)
+ set(OPENSSL_LIBRARIES "${OPENSSL_INSTALL_DIR}/lib/libcrypto.a;${OPENSSL_INSTALL_DIR}/lib/libssl.a" CACHE STRING INTERNAL)
else()
# using VCPKG for OpenSSL
find_package(OpenSSL REQUIRED)
diff --git a/cmake/macros/TargetPolyvox.cmake b/cmake/macros/TargetPolyvox.cmake
index 9db6b522c7..b2c4e30dd2 100644
--- a/cmake/macros/TargetPolyvox.cmake
+++ b/cmake/macros/TargetPolyvox.cmake
@@ -8,7 +8,7 @@
macro(TARGET_POLYVOX)
if (ANDROID)
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/polyvox)
- set(POLYVOX_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE TYPE INTERNAL)
+ set(POLYVOX_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE STRING INTERNAL)
set(LIB_DIR ${INSTALL_DIR}/lib)
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/libPolyVoxUtil.so)
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/Release/libPolyVoxCore.so)
From 3032b58abc72d95010b213dcbcb50b0b22394da6 Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Tue, 30 Apr 2019 10:10:46 +1200
Subject: [PATCH 05/11] Revise formatting of Facilities and Entity Methods
sections
---
.../scripting/ControllerScriptingInterface.h | 52 ++++++++++++-------
1 file changed, 32 insertions(+), 20 deletions(-)
diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h
index 3f3c2eec5d..4fb631463e 100644
--- a/interface/src/scripting/ControllerScriptingInterface.h
+++ b/interface/src/scripting/ControllerScriptingInterface.h
@@ -28,16 +28,18 @@ class ScriptEngine;
/**jsdoc
* The Controller API provides facilities to interact with computer and controller hardware.
*
- * Facilities
+ * Facilities
*
- * Properties
+ * Properties
+ * Get Controller property trees.
*
* - {@link Controller.getActions|getActions}
* - {@link Controller.getHardware|getHardware}
* - {@link Controller.getStandard|getStandard}
*
*
- * Mappings
+ * Mappings
+ * Create and enable or disable Controller mappings.
*
* - {@link Controller.disableMapping|disableMapping}
* - {@link Controller.enableMapping|enableMapping}
@@ -46,7 +48,8 @@ class ScriptEngine;
* - {@link Controller.parseMapping|parseMapping}
*
*
- * Input, Hardware, and Action Reflection
+ * Input, Hardware, and Action Reflection
+ * Information on the devices and actions available.
*
* - {@link Controller.findAction|findAction}
* - {@link Controller.findDevice|findDevice}
@@ -58,7 +61,8 @@ class ScriptEngine;
* - {@link Controller.getRunningInputDevices|getRunningInputDevices}
*
*
- * Input, Hardware, and Action Signals
+ * Input, Hardware, and Action Signals
+ * Notifications of device and action events.
*
* - {@link Controller.actionEvent|actionEvent}
* - {@link Controller.hardwareChanged|hardwareChanged}
@@ -66,7 +70,8 @@ class ScriptEngine;
* - {@link Controller.inputEvent|inputEvent}
*
*
- * Mouse, Keyboard, and Touch Signals
+ * Mouse, Keyboard, and Touch Signals
+ * Notifications of mouse, keyboard, and touch events.
*
* - {@link Controller.keyPressEvent|keyPressEvent}
* - {@link Controller.keyReleaseEvent|keyReleaseEvent}
@@ -80,29 +85,32 @@ class ScriptEngine;
* - {@link Controller.wheelEvent|wheelEvent}
*
*
- * Control Capturing
+ * Control Capturing
+ * Disable and enable the processing of mouse and touch events.
*
* - {@link Controller.captureMouseEvents|captureMouseEvents}
- * - {@link Controller.captureTouchEvents|captureTouchEvents}
* - {@link Controller.captureWheelEvents|captureWheelEvents}
+ * - {@link Controller.captureTouchEvents|captureTouchEvents}
* - {@link Controller.releaseMouseEvents|releaseMouseEvents}
- * - {@link Controller.releaseTouchEvents|releaseTouchEvents}
* - {@link Controller.releaseWheelEvents|releaseWheelEvents}
+ * - {@link Controller.releaseTouchEvents|releaseTouchEvents}
*
*
- * Action Capturing
+ * Action Capturing
+ * Disable and enable controller actions.
*
* - {@link Controller.captureActionEvents|captureActionEvents}
- * - {@link Controller.captureEntityClickEvents|captureEntityClickEvents}
- * - {@link Controller.captureJoystick|captureJoystick}
* - {@link Controller.captureKeyEvents|captureKeyEvents}
+ * - {@link Controller.captureJoystick|captureJoystick}
+ * - {@link Controller.captureEntityClickEvents|captureEntityClickEvents}
* - {@link Controller.releaseActionEvents|releaseActionEvents}
- * - {@link Controller.releaseEntityClickEvents|releaseEntityClickEvents}
- * - {@link Controller.releaseJoystick|releaseJoystick}
* - {@link Controller.releaseKeyEvents|releaseKeyEvents}
+ * - {@link Controller.releaseJoystick|releaseJoystick}
+ * - {@link Controller.releaseEntityClickEvents|releaseEntityClickEvents}
*
*
- * Controller and Action Values
+ * Controller and Action Values
+ * Get the current value of controller outputs and actions.
*
* - {@link Controller.getValue|getValue}
* - {@link Controller.getAxisValue|getAxisValue}
@@ -110,7 +118,8 @@ class ScriptEngine;
* - {@link Controller.getActionValue|getActionValue}
*
*
- * Haptics
+ * Haptics
+ * Trigger haptic pulses.
*
* - {@link Controller.triggerHapticPulse|triggerHapticPulse}
* - {@link Controller.triggerHapticPulseOnDevice|triggerHapticPulseOnDevice}
@@ -118,20 +127,23 @@ class ScriptEngine;
* - {@link Controller.triggerShortHapticPulseOnDevice|triggerShortHapticPulseOnDevice}
*
*
- * Display Information
+ * Display Information
+ * Get information on the display.
*
* - {@link Controller.getViewportDimensions|getViewportDimensions}
* - {@link Controller.getRecommendedHUDRect|getRecommendedHUDRect}
*
*
- * Virtual Game Pad
+ * Virtual Game Pad
+ * Use the virtual game pad which is available on some devices.
*
* - {@link Controller.setVPadEnabled|setVPadEnabled}
* - {@link Controller.setVPadHidden|setVPadHidden}
* - {@link Controller.setVPadExtraBottomMargin|setVPadExtraBottomMargin}
*
*
- * Input Recordings
+ * Input Recordings
+ * Create and play input recordings.
*
* - {@link Controller.startInputRecording|startInputRecording}
* - {@link Controller.stopInputRecording|stopInputRecording}
@@ -142,7 +154,7 @@ class ScriptEngine;
* - {@link Controller.stopInputPlayback|stopInputPlayback}
*
*
- * Entity Methods
+ * Entity Methods
*
* The default scripts implement hand controller actions that use {@link Entities.callEntityMethod} to call entity script
* methods, if present, in the entity being interacted with.
From 5a184bd584d84d761662197d5755a385a81380ef Mon Sep 17 00:00:00 2001
From: SamGondelman
Date: Tue, 30 Apr 2019 13:38:11 -0700
Subject: [PATCH 06/11] fix model bounds
---
.../src/avatars-renderer/SkeletonModel.cpp | 2 +-
libraries/render-utils/src/CauterizedModel.cpp | 2 ++
libraries/render-utils/src/MeshPartPayload.cpp | 12 ++++++------
libraries/render-utils/src/Model.cpp | 15 ++-------------
libraries/render-utils/src/Model.h | 1 -
5 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp b/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp
index 295a0e9f52..d8f24208b0 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp
+++ b/libraries/avatars-renderer/src/avatars-renderer/SkeletonModel.cpp
@@ -164,7 +164,7 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) {
Parent::simulate(deltaTime, fullUpdate);
}
- // FIXME: This texture loading logic should probably live in Avatar, to mirror RenderableModelEntityItem and ModelOverlay,
+ // FIXME: This texture loading logic should probably live in Avatar, to mirror RenderableModelEntityItem,
// but Avatars don't get updates in the same way
if (!_texturesLoaded && getGeometry() && getGeometry()->areTexturesLoaded()) {
_texturesLoaded = true;
diff --git a/libraries/render-utils/src/CauterizedModel.cpp b/libraries/render-utils/src/CauterizedModel.cpp
index 7cad337dd5..c700f1ad3f 100644
--- a/libraries/render-utils/src/CauterizedModel.cpp
+++ b/libraries/render-utils/src/CauterizedModel.cpp
@@ -237,9 +237,11 @@ void CauterizedModel::updateRenderItems() {
if (useDualQuaternionSkinning) {
data.updateClusterBuffer(meshState.clusterDualQuaternions,
cauterizedMeshState.clusterDualQuaternions);
+ data.computeAdjustedLocalBound(meshState.clusterDualQuaternions);
} else {
data.updateClusterBuffer(meshState.clusterMatrices,
cauterizedMeshState.clusterMatrices);
+ data.computeAdjustedLocalBound(meshState.clusterMatrices);
}
Transform renderTransform = modelTransform;
diff --git a/libraries/render-utils/src/MeshPartPayload.cpp b/libraries/render-utils/src/MeshPartPayload.cpp
index 7be5f93a95..cb3aa76468 100644
--- a/libraries/render-utils/src/MeshPartPayload.cpp
+++ b/libraries/render-utils/src/MeshPartPayload.cpp
@@ -450,9 +450,9 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector& clusterMatrices) {
_adjustedLocalBound = _localBound;
if (clusterMatrices.size() > 0) {
- _adjustedLocalBound.transform(clusterMatrices[0]);
+ _adjustedLocalBound.transform(clusterMatrices.back());
- for (int i = 1; i < (int)clusterMatrices.size(); ++i) {
+ for (int i = 0; i < (int)clusterMatrices.size() - 1; ++i) {
AABox clusterBound = _localBound;
clusterBound.transform(clusterMatrices[i]);
_adjustedLocalBound += clusterBound;
@@ -463,12 +463,12 @@ void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector& clusterDualQuaternions) {
_adjustedLocalBound = _localBound;
if (clusterDualQuaternions.size() > 0) {
- Transform rootTransform(clusterDualQuaternions[0].getRotation(),
- clusterDualQuaternions[0].getScale(),
- clusterDualQuaternions[0].getTranslation());
+ Transform rootTransform(clusterDualQuaternions.back().getRotation(),
+ clusterDualQuaternions.back().getScale(),
+ clusterDualQuaternions.back().getTranslation());
_adjustedLocalBound.transform(rootTransform);
- for (int i = 1; i < (int)clusterDualQuaternions.size(); ++i) {
+ for (int i = 0; i < (int)clusterDualQuaternions.size() - 1; ++i) {
AABox clusterBound = _localBound;
Transform transform(clusterDualQuaternions[i].getRotation(),
clusterDualQuaternions[i].getScale(),
diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp
index e2d78a8d94..8b79ca2572 100644
--- a/libraries/render-utils/src/Model.cpp
+++ b/libraries/render-utils/src/Model.cpp
@@ -241,8 +241,10 @@ void Model::updateRenderItems() {
invalidatePayloadShapeKey, primitiveMode, renderItemKeyGlobalFlags, cauterized](ModelMeshPartPayload& data) {
if (useDualQuaternionSkinning) {
data.updateClusterBuffer(meshState.clusterDualQuaternions);
+ data.computeAdjustedLocalBound(meshState.clusterDualQuaternions);
} else {
data.updateClusterBuffer(meshState.clusterMatrices);
+ data.computeAdjustedLocalBound(meshState.clusterMatrices);
}
Transform renderTransform = modelTransform;
@@ -1367,8 +1369,6 @@ void Model::simulate(float deltaTime, bool fullUpdate) {
// update the world space transforms for all joints
glm::mat4 parentTransform = glm::scale(_scale) * glm::translate(_offset);
updateRig(deltaTime, parentTransform);
-
- computeMeshPartLocalBounds();
}
}
@@ -1379,17 +1379,6 @@ void Model::updateRig(float deltaTime, glm::mat4 parentTransform) {
_rig.updateAnimations(deltaTime, parentTransform, rigToWorldTransform);
}
-void Model::computeMeshPartLocalBounds() {
- for (auto& part : _modelMeshRenderItems) {
- const Model::MeshState& state = _meshStates.at(part->_meshIndex);
- if (_useDualQuaternionSkinning) {
- part->computeAdjustedLocalBound(state.clusterDualQuaternions);
- } else {
- part->computeAdjustedLocalBound(state.clusterMatrices);
- }
- }
-}
-
// virtual
void Model::updateClusterMatrices() {
DETAILED_PERFORMANCE_TIMER("Model::updateClusterMatrices");
diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h
index 1431b5e3f9..34b8a90f87 100644
--- a/libraries/render-utils/src/Model.h
+++ b/libraries/render-utils/src/Model.h
@@ -427,7 +427,6 @@ protected:
void setScaleInternal(const glm::vec3& scale);
void snapToRegistrationPoint();
- void computeMeshPartLocalBounds();
virtual void updateRig(float deltaTime, glm::mat4 parentTransform);
/// Allow sub classes to force invalidating the bboxes
From 73454b06a234488bb1bf962ab5e869ad2cd7a6cd Mon Sep 17 00:00:00 2001
From: luiscuenca
Date: Wed, 1 May 2019 08:57:09 -0700
Subject: [PATCH 07/11] Fix crash accessing _modelJointIndicesCache
---
.../src/avatars-renderer/Avatar.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
index 204ed79660..73e623223e 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
@@ -1428,7 +1428,7 @@ int Avatar::getJointIndex(const QString& name) const {
withValidJointIndicesCache([&]() {
if (_modelJointIndicesCache.contains(name)) {
- result = _modelJointIndicesCache[name] - 1;
+ result = _modelJointIndicesCache.value(name) - 1;
}
});
return result;
@@ -1439,22 +1439,22 @@ QStringList Avatar::getJointNames() const {
withValidJointIndicesCache([&]() {
// find out how large the vector needs to be
int maxJointIndex = -1;
- QHashIterator k(_modelJointIndicesCache);
- while (k.hasNext()) {
- k.next();
+ QHash::const_iterator k = _modelJointIndicesCache.constBegin();
+ while (k != _modelJointIndicesCache.constEnd()) {
int index = k.value();
if (index > maxJointIndex) {
maxJointIndex = index;
}
+ ++k;
}
// iterate through the hash and put joint names
// into the vector at their indices
QVector resultVector(maxJointIndex+1);
- QHashIterator i(_modelJointIndicesCache);
- while (i.hasNext()) {
- i.next();
+ QHash::const_iterator i = _modelJointIndicesCache.constBegin();
+ while (i != _modelJointIndicesCache.constEnd()) {
int index = i.value();
resultVector[index] = i.key();
+ ++i;
}
// convert to QList and drop out blanks
result = resultVector.toList();
From 6e2ac14c23ac91183d8b8dc30c2ade6ed9f8dc34 Mon Sep 17 00:00:00 2001
From: luiscuenca
Date: Wed, 1 May 2019 12:42:41 -0700
Subject: [PATCH 08/11] Change while loops
---
.../avatars-renderer/src/avatars-renderer/Avatar.cpp | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
index 73e623223e..cb0acd68cb 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp
@@ -1439,22 +1439,18 @@ QStringList Avatar::getJointNames() const {
withValidJointIndicesCache([&]() {
// find out how large the vector needs to be
int maxJointIndex = -1;
- QHash::const_iterator k = _modelJointIndicesCache.constBegin();
- while (k != _modelJointIndicesCache.constEnd()) {
+ for (auto k = _modelJointIndicesCache.constBegin(); k != _modelJointIndicesCache.constEnd(); k++) {
int index = k.value();
if (index > maxJointIndex) {
maxJointIndex = index;
}
- ++k;
}
// iterate through the hash and put joint names
// into the vector at their indices
QVector resultVector(maxJointIndex+1);
- QHash::const_iterator i = _modelJointIndicesCache.constBegin();
- while (i != _modelJointIndicesCache.constEnd()) {
+ for (auto i = _modelJointIndicesCache.constBegin(); i != _modelJointIndicesCache.constEnd(); i++) {
int index = i.value();
resultVector[index] = i.key();
- ++i;
}
// convert to QList and drop out blanks
result = resultVector.toList();
From a878232c6dc54ae4b0c9565d3060b1849c759732 Mon Sep 17 00:00:00 2001
From: amerhifi
Date: Wed, 1 May 2019 14:31:40 -0700
Subject: [PATCH 09/11] setting default cursor after display initialization for
systems that do not call checkcursor on startup
---
interface/src/Application.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp
index 9a2d320329..dcc91a66fc 100644
--- a/interface/src/Application.cpp
+++ b/interface/src/Application.cpp
@@ -1330,7 +1330,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
setCrashAnnotation("avatar", avatarURL.toString().toStdString());
});
-
// Inititalize sample before registering
_sampleSound = DependencyManager::get()->getSound(PathUtils::resourcesUrl("sounds/sample.wav"));
@@ -1421,6 +1420,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
initializeDisplayPlugins();
qCDebug(interfaceapp, "Initialized Display");
+ if (_displayPlugin && !_displayPlugin->isHmd()) {
+ _preferredCursor.set(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM));
+ showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get()));
+ }
// An audio device changed signal received before the display plugins are set up will cause a crash,
// so we defer the setup of the `scripting::Audio` class until this point
{
From e94cafd88ef44a50f226356a356e4318f45092f9 Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Thu, 2 May 2019 20:16:53 +1200
Subject: [PATCH 10/11] Doc review
---
libraries/controllers/src/controllers/Actions.cpp | 2 +-
.../controllers/src/controllers/ScriptingInterface.h | 8 ++++----
.../controllers/src/controllers/StandardController.cpp | 4 ++--
.../src/controllers/impl/MappingBuilderProxy.h | 10 +++++-----
.../src/input-plugins/KeyboardMouseDevice.cpp | 2 +-
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/libraries/controllers/src/controllers/Actions.cpp b/libraries/controllers/src/controllers/Actions.cpp
index ffb5bd85ad..9f9d92fed7 100644
--- a/libraries/controllers/src/controllers/Actions.cpp
+++ b/libraries/controllers/src/controllers/Actions.cpp
@@ -178,7 +178,7 @@ namespace controller {
* person view.
* CycleCamera | number | number | Cycle the camera view from first person, to
* third person, to full screen mirror, then back to first person and repeat. |
- * ContextMenu | number | number | Show / hide the tablet. |
+ * ContextMenu | number | number | Show/hide the tablet. |
* ToggleMute | number | number | Toggle the microphone mute. |
* TogglePushToTalk | number | number | Toggle push to talk. |
* ToggleOverlay | number | number | Toggle the display of overlays. |
diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h
index 688b59e18c..84396fc8be 100644
--- a/libraries/controllers/src/controllers/ScriptingInterface.h
+++ b/libraries/controllers/src/controllers/ScriptingInterface.h
@@ -210,7 +210,7 @@ namespace controller {
/**jsdoc
* Triggers a haptic pulse on connected and enabled devices that have the capability.
* @function Controller.triggerHapticPulse
- * @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
+ * @param {number} strength - The strength of the haptic pulse, range 0.0 – 1.0 .
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
* @example Trigger a haptic pulse on the right hand.
@@ -224,7 +224,7 @@ namespace controller {
/**jsdoc
* Triggers a 250ms haptic pulse on connected and enabled devices that have the capability.
* @function Controller.triggerShortHapticPulse
- * @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
+ * @param {number} strength - The strength of the haptic pulse, range 0.0 – 1.0 .
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
*/
Q_INVOKABLE bool triggerShortHapticPulse(float strength, controller::Hand hand = BOTH) const;
@@ -233,7 +233,7 @@ namespace controller {
* Triggers a haptic pulse on a particular device if connected and enabled and it has the capability.
* @function Controller.triggerHapticPulseOnDevice
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
- * @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
+ * @param {number} strength - The strength of the haptic pulse, range 0.0 – 1.0 .
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
* @example Trigger a haptic pulse on an Oculus Touch controller.
@@ -250,7 +250,7 @@ namespace controller {
* Triggers a 250ms haptic pulse on a particular device if connected and enabled and it has the capability.
* @function Controller.triggerShortHapticPulseOnDevice
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
- * @param {number} strength - The strength of the haptic pulse, 0.0 – 1.0 .
+ * @param {number} strength - The strength of the haptic pulse, range 0.0 – 1.0 .
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
*/
Q_INVOKABLE bool triggerShortHapticPulseOnDevice(unsigned int device, float strength, controller::Hand hand = BOTH)
diff --git a/libraries/controllers/src/controllers/StandardController.cpp b/libraries/controllers/src/controllers/StandardController.cpp
index a7ae1aae98..ece10ecca3 100644
--- a/libraries/controllers/src/controllers/StandardController.cpp
+++ b/libraries/controllers/src/controllers/StandardController.cpp
@@ -33,8 +33,8 @@ void StandardController::focusOutEvent() {
* identifying each output. Read-only.
* These outputs can be mapped to actions or functions in a {@link RouteObject} mapping. The data value provided by each
* control is either a number or a {@link Pose}. Numbers are typically normalized to 0.0 or 1.0 for
- * button states, the range 0.0 – 1.0 for unidirectional scales, and the range -1.0 – 1.0
- * for bidirectional scales.
+ * button states, the range 0.0 – 1.0 for unidirectional scales, and the range
+ * -1.0 – 1.0 for bidirectional scales.
* Each hardware device has a mapping from its outputs to a subset of Controller.Standard items, specified in a
* JSON file. For example,
* vive.json
diff --git a/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h b/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h
index b51f484f7d..f0a823a3de 100644
--- a/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h
+++ b/libraries/controllers/src/controllers/impl/MappingBuilderProxy.h
@@ -84,12 +84,12 @@ class UserInputMapper;
/**jsdoc
* A route in a {@link Controller.MappingJSON}.
* @typedef {object} Controller.MappingJSONRoute
- * @property {string|Controller.MappingJSONAxis} from - The name of a {@link Controller.Hardware} property name or an axis
- * made from them. If a property name, the leading "Controller.Hardware." can be omitted.
- * @property {boolean} [peek=false] - If true then peeking is enabled per {@link RouteObject#peek}.
- * @property {boolean} [debug=false] - If true then debug is enabled per {@link RouteObject#debug}.
+ * @property {string|Controller.MappingJSONAxis} from - The name of a {@link Controller.Hardware} property or an axis made from
+ * them. If a property name, the leading "Controller.Hardware." can be omitted.
+ * @property {boolean} [peek=false] - If true, then peeking is enabled per {@link RouteObject#peek}.
+ * @property {boolean} [debug=false] - If true , then debug is enabled per {@link RouteObject#debug}.
* @property {string|string[]} [when=[]] - One or more numeric {@link Controller.Hardware} property names which are evaluated
- * as booleans and ANDed together. Prepend with a ! to use the logical NOT of the property value. The leading
+ * as booleans and ANDed together. Prepend a property name with a ! to do a logical NOT. The leading
* "Controller.Hardware." can be omitted from the property names.
* @property {Controller.MappingJSONFilter|Controller.MappingJSONFilter[]} [filters=[]] - One or more filters in the route.
* @property {string} to - The name of a {@link Controller.Actions} or {@link Controller.Standard} property. The leading
diff --git a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp
index 78dd14868c..0a6c76e456 100755
--- a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp
+++ b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.cpp
@@ -270,7 +270,7 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic
* new x-coordinate value.
* MouseY | number | number | The mouse y-coordinate changed. The data value is its
* new y-coordinate value. |
- * MouseWheelRight | number | number | The mouse wheel rotated left. The data value
+ * | MouseWheelRight | number | number | The mouse wheel rotated right. The data value
* is the number of units rotated (typically 1.0 ). |
* MouseWheelLeft | number | number | The mouse wheel rotated left. The data value
* is the number of units rotated (typically 1.0 ). |
From 64bf8ec393a589c106decedf8b9ab2a429676e70 Mon Sep 17 00:00:00 2001
From: Matt Hardcastle
Date: Thu, 2 May 2019 09:46:17 -0700
Subject: [PATCH 11/11] Enable `--ci-build` setting via an environment variable
Prior to this comment the only way to enable the ci mode for the `prebuild.py` script was to pass it the `--ci-build` argument. The ci system doesn't call call prebuild directly, cmake does, so adding this argument via the CI system is impossible. This change adds the `CI_BUILD` environment variable so enabling the ci mode is possible through the CI system.
Prints timing with CI_BUILD environment variable set
% CI_BUILD=foo cmake -G "Unix Makefiles" ../hifi
['/Users/mhard/src/hifi/prebuild.py', '--build-root', '/Users/mhard/src/hifi_build_make']
1556815031 bcab3689-9ec6-49d4-bbdf-05de5840001f sha=3bb61335be
1556815031 bcab3689-9ec6-49d4-bbdf-05de5840001f start
Warning: Environment variable HIFI_VCPKG_BASE not set, using /Users/mhard/hifi/vcpkg
Using vcpkg path /Users/mhard/hifi/vcpkg/c1966b8c
[... snip ...]
Doesn't print timing when CI_BUILD environment variable is unset:
% cmake -G "Unix Makefiles" ../hifi
['/Users/mhard/src/hifi/prebuild.py', '--build-root', '/Users/mhard/src/hifi_build_make']
Warning: Environment variable HIFI_VCPKG_BASE not set, using /Users/mhard/hifi/vcpkg
Using vcpkg path /Users/mhard/hifi/vcpkg/c1966b8c
[... snip ...]
---
prebuild.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/prebuild.py b/prebuild.py
index 5325ca34bc..b401c94e7f 100644
--- a/prebuild.py
+++ b/prebuild.py
@@ -94,7 +94,7 @@ def parse_args():
parser.add_argument('--vcpkg-root', type=str, help='The location of the vcpkg distribution')
parser.add_argument('--build-root', required=True, type=str, help='The location of the cmake build')
parser.add_argument('--ports-path', type=str, default=defaultPortsPath)
- parser.add_argument('--ci-build', action='store_true')
+ parser.add_argument('--ci-build', action='store_true', default=os.getenv('CI_BUILD') is not None)
if True:
args = parser.parse_args()
else:
| |