Merge branch 'master' of github.com:highfidelity/hifi into emojiAppAdd

This commit is contained in:
milad 2019-08-06 13:23:32 -07:00
commit 75708170dd
19 changed files with 499 additions and 233 deletions

View file

@ -97,8 +97,10 @@ public:
/**jsdoc
* Starts playing an animation on the avatar.
* @function Avatar.startAnimation
* @param {string} url - The animation file's URL. Animation files need to be in the FBX format but only need to contain
* the avatar skeleton and animation data.
* @param {string} url - The animation file's URL. Animation files need to be in glTF or FBX format but only need to
* contain the avatar skeleton and animation data. glTF models may be in JSON or binary format (".gltf" or ".glb" URLs
* respectively).
* <p><strong>Warning:</strong> glTF animations currently do not always animate correctly.</p>
* @param {number} [fps=30] - The frames per second (FPS) rate for the animation playback. 30 FPS is normal speed.
* @param {number} [priority=1] - <em>Not used.</em>
* @param {boolean} [loop=false] - <code>true</code> if the animation should loop, <code>false</code> if it shouldn't.

View file

@ -184,7 +184,7 @@ Flickable {
wrapMode: Text.Wrap
Component.onCompleted: {
var gpu = JSON.parse(PlatformInfo.getGPU(0));
var gpu = JSON.parse(PlatformInfo.getGPU(PlatformInfo.getMasterGPU()));
var gpuModel = gpu.model;
if (gpuModel.length === 0) {
gpuModel = "Unknown";
@ -313,7 +313,7 @@ Flickable {
textToCopy += "# CPU Cores: " + PlatformInfo.getNumLogicalCores() + "\n";
textToCopy += "RAM: " + PlatformInfo.getTotalSystemMemoryMB() + " MB\n";
var gpu = JSON.parse(PlatformInfo.getGPU(0));
var gpu = JSON.parse(PlatformInfo.getGPU(PlatformInfo.getMasterGPU()));
var gpuModel = gpu.model;
if (gpuModel.length === 0) {
gpuModel = "Unknown";

View file

@ -609,8 +609,10 @@ public:
* the avatar will move in unpredictable ways. For more information about avatar joint orientation standards, see
* <a href="https://docs.highfidelity.com/create/avatars/avatar-standards">Avatar Standards</a>.</p>
* @function MyAvatar.overrideAnimation
* @param {string} url - The URL to the animation file. Animation files need to be FBX format, but only need to contain the
* avatar skeleton and animation data.
* @param {string} url - The URL to the animation file. Animation files may be in glTF or FBX format, but only need to
* contain the avatar skeleton and animation data. glTF models may be in JSON or binary format (".gltf" or ".glb" URLs
* respectively).
* <p><strong>Warning:</strong> glTF animations currently do not always animate correctly.</p>
* @param {number} fps - The frames per second (FPS) rate for the animation playback. 30 FPS is normal speed.
* @param {boolean} loop - <code>true</code> if the animation should loop, <code>false</code> if it shouldn't.
* @param {number} firstFrame - The frame to start the animation at.
@ -630,8 +632,10 @@ public:
* Use {@link MyAvatar.restoreHandAnimation} to restore the default poses.
* @function MyAvatar.overrideHandAnimation
* @param isLeft {boolean} <code>true</code> to override the left hand, <code>false</code> to override the right hand.
* @param {string} url - The URL of the animation file. Animation files need to be FBX format, but only need to contain the
* avatar skeleton and animation data.
* @param {string} url - The URL of the animation file. Animation files need to be in glTF or FBX format, but only need to
* contain the avatar skeleton and animation data. glTF models may be in JSON or binary format (".gltf" or ".glb" URLs
* respectively).
* <p><strong>Warning:</strong> glTF animations currently do not always animate correctly.</p>
* @param {number} fps - The frames per second (FPS) rate for the animation playback. 30 FPS is normal speed.
* @param {boolean} loop - <code>true</code> if the animation should loop, <code>false</code> if it shouldn't.
* @param {number} firstFrame - The frame to start the animation at.
@ -702,19 +706,22 @@ public:
* <p>Each avatar has an avatar-animation.json file that defines a set of animation roles. Animation roles map to easily
* understandable actions that the avatar can perform, such as <code>"idleStand"</code>, <code>"idleTalk"</code>, or
* <code>"walkFwd"</code>. To get the full list of roles, use {@ link MyAvatar.getAnimationRoles}.
* For each role, the avatar-animation.json defines when the animation is used, the animation clip (FBX) used, and how
* animations are blended together with procedural data (such as look at vectors, hand sensors etc.).
* <code>overrideRoleAnimation()</code> is used to change the animation clip (FBX) associated with a specified animation
* role. To end the role animation and restore the default, use {@link MyAvatar.restoreRoleAnimation}.</p>
* <p>Note: Hand roles only affect the hand. Other 'main' roles, like 'idleStand', 'idleTalk', 'takeoffStand' are full body.</p>
* For each role, the avatar-animation.json defines when the animation is used, the animation clip (glTF or FBX) used, and
* how animations are blended together with procedural data (such as look at vectors, hand sensors etc.).
* <code>overrideRoleAnimation()</code> is used to change the animation clip (glTF or FBX) associated with a specified
* animation role. To end the role animation and restore the default, use {@link MyAvatar.restoreRoleAnimation}.</p>
* <p>Note: Hand roles only affect the hand. Other "main" roles, like "idleStand", "idleTalk", and "takeoffStand", are full
* body.</p>
* <p>Note: When using pre-built animation data, it's critical that the joint orientation of the source animation and target
* rig are equivalent, since the animation data applies absolute values onto the joints. If the orientations are different,
* the avatar will move in unpredictable ways. For more information about avatar joint orientation standards, see
* <a href="https://docs.highfidelity.com/create/avatars/avatar-standards">Avatar Standards</a>.
* @function MyAvatar.overrideRoleAnimation
* @param {string} role - The animation role to override
* @param {string} url - The URL to the animation file. Animation files need to be in FBX format, but only need to contain
* the avatar skeleton and animation data.
* @param {string} url - The URL to the animation file. Animation files need to be in glTF or FBX format, but only need to
* contain the avatar skeleton and animation data. glTF models may be in JSON or binary format (".gltf" or ".glb" URLs
* respectively).
* <p><strong>Warning:</strong> glTF animations currently do not always animate correctly.</p>
* @param {number} fps - The frames per second (FPS) rate for the animation playback. 30 FPS is normal speed.
* @param {boolean} loop - <code>true</code> if the animation should loop, <code>false</code> if it shouldn't.
* @param {number} firstFrame - The frame the animation should start at.
@ -739,9 +746,9 @@ public:
* <p>Each avatar has an avatar-animation.json file that defines a set of animation roles. Animation roles map to easily
* understandable actions that the avatar can perform, such as <code>"idleStand"</code>, <code>"idleTalk"</code>, or
* <code>"walkFwd"</code>. To get the full list of roles, use {@link MyAvatar.getAnimationRoles}. For each role,
* the avatar-animation.json defines when the animation is used, the animation clip (FBX) used, and how animations are
* blended together with procedural data (such as look-at vectors, hand sensors etc.). You can change the animation clip
* (FBX) associated with a specified animation role using {@link MyAvatar.overrideRoleAnimation}.
* the avatar-animation.json defines when the animation is used, the animation clip (glTF or FBX) used, and how animations
* are blended together with procedural data (such as look-at vectors, hand sensors etc.). You can change the animation
* clip (glTF or FBX) associated with a specified animation role using {@link MyAvatar.overrideRoleAnimation}.
* <code>restoreRoleAnimation()</code> is used to restore a specified animation role's default animation clip. If you have
* not specified an override animation for the specified role, this function has no effect.
* @function MyAvatar.restoreRoleAnimation
@ -2042,17 +2049,19 @@ public slots:
void setEnableDebugDrawDefaultPose(bool isEnabled);
/**jsdoc
* Displays animation debug graphics. By default it shows the animation poses used for rendering.
* However, the property MyAvatar.setDebugDrawAnimPoseName can be used to draw a specific animation node.
* Displays animation debug graphics. By default, the animation poses used for rendering are displayed. However,
* {@link MyAvatar.setDebugDrawAnimPoseName} can be used to set a specific animation node to display.
* @function MyAvatar.setEnableDebugDrawAnimPose
* @param {boolean} enabled - <code>true</code> to show the debug graphics, <code>false</code> to hide.
*/
void setEnableDebugDrawAnimPose(bool isEnabled);
/**jsdoc
* If set it determines which animation debug graphics to draw, when MyAvatar.setEnableDebugDrawAnimPose is set to true.
* Sets the animation node to display when animation debug graphics are enabled with
* {@link MyAvatar.setEnableDebugDrawAnimPose}.
* @function MyAvatar.setDebugDrawAnimPoseName
* @param {boolean} enabled - <code>true</code> to show the debug graphics, <code>false</code> to hide.
* @param {string} poseName - The name of the animation node to display debug graphics for. Use <code>""</code> to reset to
* default.
*/
void setDebugDrawAnimPoseName(QString poseName);

View file

@ -66,15 +66,19 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable {
* @property {boolean} pushToTalkHMD - <code>true</code> if HMD push-to-talk is enabled, otherwise <code>false</code>.
* @property {boolean} pushingToTalk - <code>true</code> if the user is currently pushing-to-talk, otherwise
* <code>false</code>.
* @property {number} avatarGain - The gain (relative volume) that avatars' voices are played at. This gain is used at the server.
* @property {number} localInjectorGain - The gain (relative volume) that local injectors (local environment sounds) are played at.
* @property {number} serverInjectorGain - The gain (relative volume) that server injectors (server environment sounds) are played at. This gain is used at the server.
* @property {number} systemInjectorGain - The gain (relative volume) that system sounds are played at.
* @property {number} pushingToTalkOutputGainDesktop - The gain (relative volume) that all sounds are played at when the user is holding
* the push-to-talk key in Desktop mode.
* @property {boolean} acousticEchoCancellation - <code>true</code> if audio-echo-cancellation is enabled, otherwise
* <code>false</code>. When enabled, sound from the audio output will be suppressed when it echos back to the
* input audio signal.
* @property {number} avatarGain - The gain (relative volume in dB) that avatars' voices are played at. This gain is used
* at the server.
* @property {number} localInjectorGain - The gain (relative volume in dB) that local injectors (local environment sounds)
* are played at.
* @property {number} serverInjectorGain - The gain (relative volume in dB) that server injectors (server environment
* sounds) are played at. This gain is used at the server.
* @property {number} systemInjectorGain - The gain (relative volume in dB) that system sounds are played at.
* @property {number} pushingToTalkOutputGainDesktop - The gain (relative volume in dB) that all sounds are played at when
* the user is holding the push-to-talk key in desktop mode.
* @property {boolean} acousticEchoCancellation - <code>true</code> if acoustic echo cancellation is enabled, otherwise
* <code>false</code>. When enabled, sound from the audio output is suppressed when it echos back to the input audio
* signal.
*
* @comment The following properties are from AudioScriptingInterface.h.
* @property {boolean} isStereoInput - <code>true</code> if the input audio is being used in stereo, otherwise
@ -301,18 +305,18 @@ public:
Q_INVOKABLE bool getRecording();
/**jsdoc
* Sets the output volume gain that will be used when the user is holding the Push to Talk key.
* Sets the output volume gain that will be used when the user is holding the push-to-talk key.
* Should be negative.
* @function Audio.setPushingToTalkOutputGainDesktop
* @param {number} gain - The output volume gain (dB) while using PTT.
* @param {number} gain - The output volume gain (dB) while using push-to-talk.
*/
Q_INVOKABLE void setPushingToTalkOutputGainDesktop(float gain);
/**jsdoc
* Gets the output volume gain that is used when the user is holding the Push to Talk key.
* Gets the output volume gain that is used when the user is holding the push-to-talk key.
* Should be negative.
* @function Audio.getPushingToTalkOutputGainDesktop
* @returns {number} gain - The output volume gain (dB) while using PTT.
* @returns {number} gain - The output volume gain (dB) while using push-to-talk.
*/
Q_INVOKABLE float getPushingToTalkOutputGainDesktop();
@ -457,7 +461,7 @@ signals:
/**jsdoc
* Triggered when the avatar gain changes.
* @function Audio.avatarGainChanged
* @param {number} gain - The new avatar gain value.
* @param {number} gain - The new avatar gain value (dB).
* @returns {Signal}
*/
void avatarGainChanged(float gain);
@ -465,7 +469,7 @@ signals:
/**jsdoc
* Triggered when the local injector gain changes.
* @function Audio.localInjectorGainChanged
* @param {number} gain - The new local injector gain value.
* @param {number} gain - The new local injector gain value (dB).
* @returns {Signal}
*/
void localInjectorGainChanged(float gain);
@ -473,7 +477,7 @@ signals:
/**jsdoc
* Triggered when the server injector gain changes.
* @function Audio.serverInjectorGainChanged
* @param {number} gain - The new server injector gain value.
* @param {number} gain - The new server injector gain value (dB).
* @returns {Signal}
*/
void serverInjectorGainChanged(float gain);
@ -481,7 +485,7 @@ signals:
/**jsdoc
* Triggered when the system injector gain changes.
* @function Audio.systemInjectorGainChanged
* @param {number} gain - The new system injector gain value.
* @param {number} gain - The new system injector gain value (dB).
* @returns {Signal}
*/
void systemInjectorGainChanged(float gain);
@ -489,7 +493,7 @@ signals:
/**jsdoc
* Triggered when the push to talk gain changes.
* @function Audio.pushingToTalkOutputGainDesktopChanged
* @param {number} gain - The new output gain value.
* @param {number} gain - The new output gain value (dB).
* @returns {Signal}
*/
void pushingToTalkOutputGainDesktopChanged(float gain);

View file

@ -15,7 +15,7 @@
class QScriptValue;
/**jsdoc
* The <code>PlatformInfo</code> API provides information about the computer and controllers being used.
* The <code>PlatformInfo</code> API provides information about the hardware platform being used.
*
* @namespace PlatformInfo
*
@ -31,6 +31,21 @@ public:
PlatformInfoScriptingInterface();
virtual ~PlatformInfoScriptingInterface();
/**jsdoc
* <p>The platform tier of a computer is an indication of its rendering capability.</p>
* <table>
* <thead>
* <tr><th>Value</th><th>Name</th><th>Description</th></tr>
* </thead>
* <tbody>
* <tr><td><code>0</code></td><td>UNKNOWN</td><td>Unknown rendering capability.</td></tr>
* <tr><td><code>1</code></td><td>LOW</td><td>Low-end PC, capable of rendering low-quality graphics.</td></tr>
* <tr><td><code>2</code></td><td>MID</td><td>Business-class PC, capable of rendering medium-quality graphics.</td></tr>
* <tr><td><code>3</code></td><td>HIGH</td><td>High-end PC, capable of rendering high-quality graphics.</td></tr>
* </tbody>
* </table>
* @typedef {number} PlatformInfo.PlatformTier
*/
// Platform tier enum type
enum PlatformTier {
UNKNOWN = platform::Profiler::Tier::UNKNOWN,
@ -50,23 +65,18 @@ public slots:
/**jsdoc
* Gets the operating system type.
* @function PlatformInfo.getOperatingSystemType
* @returns {string} <code>"WINDOWS"</code>, <code>"MACOS"</code>, or <code>"UNKNOWN"</code>.
* @returns {string} The operating system type: <code>"WINDOWS"</code>, <code>"MACOS"</code>, or <code>"UNKNOWN"</code>.
* @deprecated This function is deprecated and will be removed.
* use getComputer()["OS"] instead
* Use <code>JSON.parse({@link PlatformInfo.getComputer|PlatformInfo.getComputer()}).OS</code> instead.
*/
QString getOperatingSystemType();
/**jsdoc
* Gets information on the CPU.
* Gets information on the CPU model.
* @function PlatformInfo.getCPUBrand
* @returns {string} Information on the CPU.
* @example <caption>Report the CPU being used.</caption>
* print("CPU: " + PlatformInfo.getCPUBrand());
* // Example: Intel(R) Core(TM) i7-7820HK CPU @ 2.90GHz
* @deprecated This function is deprecated and will be removed.
* use getNumCPUs() to know the number of CPUs in the hardware, at least one is expected
* use getCPU(0)["vendor"] to get the brand of the vendor
* use getCPU(0)["model"] to get the model name of the cpu
* Use <code>JSON.parse({@link PlatformInfo.getCPU|PlatformInfo.getCPU(0)}).model</code> instead.
*/
QString getCPUBrand();
@ -75,27 +85,27 @@ public slots:
* @function PlatformInfo.getNumLogicalCores
* @returns {number} The number of logical CPU cores.
* @deprecated This function is deprecated and will be removed.
* use getCPU(0)["numCores"] instead
* Use <code>JSON.parse({@link PlatformInfo.getCPU|PlatformInfo.getCPU(0)}).numCores</code> instead.
*/
unsigned int getNumLogicalCores();
/**jsdoc
* Returns the total system memory in megabytes.
* Gets the total amount of usable physical memory, in MB.
* @function PlatformInfo.getTotalSystemMemoryMB
* @returns {number} The total system memory in megabytes.
* @deprecated This function is deprecated and will be removed.
* use getMemory()["memTotal"] instead
* Use <code>JSON.parse({@link PlatformInfo.getMemory|PlatformInfo.getMemory()}).memTotal</code> instead.
*/
int getTotalSystemMemoryMB();
/**jsdoc
* Gets the graphics card type.
* Gets the model of the graphics card currently being used.
* @function PlatformInfo.getGraphicsCardType
* @returns {string} The graphics card type.
* @returns {string} The model of the graphics card currently being used.
* @deprecated This function is deprecated and will be removed.
* use getNumGPUs() to know the number of GPUs in the hardware, at least one is expected
* use getGPU(getMasterGPU())["vendor"] to get the brand of the vendor
* use getGPU(getMasterGPU())["model"] to get the model name of the gpu
* Use <code>JSON.parse({@link PlatformInfo.getGPU|PlatformInfo.getGPU(}
* {@link PlatformInfo.getMasterGPU|PlatformInfo.getMasterGPU() )}).model</code>
* instead.
*/
QString getGraphicsCardType();
@ -117,139 +127,150 @@ public slots:
* Checks whether HTML on 3D surfaces (e.g., Web entities) is supported.
* @function PlatformInfo.has3DHTML
* @returns {boolean} <code>true</code> if the current display supports HTML on 3D surfaces, <code>false</code> if it
* doesn't.
* doesn't.
*/
bool has3DHTML();
/**jsdoc
* Checks whether Interface is running on a stand-alone HMD device (CPU incorporated into the HMD display).
* @function PlatformInfo.isStandalone
* @returns {boolean} <code>true</code> if Interface is running on a stand-alone device, <code>false</code> if it isn't.
* @returns {boolean} <code>true</code> if Interface is running on a stand-alone HMD device, <code>false</code> if it isn't.
*/
bool isStandalone();
/**jsdoc
* Get the number of CPUs.
* @function PlatformInfo.getNumCPUs
* @returns {number} The number of CPUs detected on the hardware platform.
*/
* Gets the number of CPUs.
* @function PlatformInfo.getNumCPUs
* @returns {number} The number of CPUs.
*/
int getNumCPUs();
/**jsdoc
* Get the index of the master CPU.
* @function PlatformInfo.getMasterCPU
* @returns {number} The index of the master CPU detected on the hardware platform.
*/
* Gets the index number of the master CPU.
* @function PlatformInfo.getMasterCPU
* @returns {number} The index of the master CPU.
*/
int getMasterCPU();
/**jsdoc
* Get the description of the CPU at the index parameter
* expected fields are:
* - cpuVendor...
* @param index The index of the CPU of the platform
* @function PlatformInfo.getCPU
* @returns {string} The CPU description json field
*/
* Gets the platform description of a CPU.
* @function PlatformInfo.getCPU
* @param {number} index - The index number of the CPU.
* @returns {string} The CPU's {@link PlatformInfo.CPUDescription|CPUDescription} information as a JSON string.
* @example <caption>Report details of the computer's CPUs.</caption>
* var numCPUs = PlatformInfo.getNumCPUs();
* print("Number of CPUs: " + numCPUs);
* for (var i = 0; i < numCPUs; i++) {
* var cpuDescription = PlatformInfo.getCPU(i);
* print("CPU " + i + ": " + cpuDescription);
* }
*/
QString getCPU(int index);
/**jsdoc
* Get the number of GPUs.
* Gets the number of GPUs.
* @function PlatformInfo.getNumGPUs
* @returns {number} The number of GPUs detected on the hardware platform.
* @returns {number} The number of GPUs.
*/
int getNumGPUs();
/**jsdoc
* Get the index of the master GPU.
* @function PlatformInfo.getMasterGPU
* @returns {number} The index of the master GPU detected on the hardware platform.
*/
* Gets the index number of the master GPU.
* @function PlatformInfo.getMasterGPU
* @returns {number} The index of the master GPU.
*/
int getMasterGPU();
/**jsdoc
* Get the description of the GPU at the index parameter
* expected fields are:
* - vendor, model...
* @param index The index of the GPU of the platform
* Gets the platform description of a GPU.
* @param {number} index - The index number of the GPU.
* @function PlatformInfo.getGPU
* @returns {string} The GPU description json field
* @returns {string} The GPU's {@link PlatformInfo.GPUDescription|GPUDescription} information as a JSON string.
* @example <caption>Report details of the computer's GPUs.</caption>
* var numGPUs = PlatformInfo.getNumGPUs();
* print("Number of GPUs: " + numGPUs);
* for (var i = 0; i < numGPUs; i++) {
* var gpuDescription = PlatformInfo.getGPU(i);
* print("GPU " + i + ": " + gpuDescription);
* }
*/
QString getGPU(int index);
/**jsdoc
* Get the number of Displays.
* @function PlatformInfo.getNumDisplays
* @returns {number} The number of Displays detected on the hardware platform.
*/
* Gets the number of displays.
* @function PlatformInfo.getNumDisplays
* @returns {number} The number of displays.
*/
int getNumDisplays();
/**jsdoc
* Get the index of the master Display.
* @function PlatformInfo.getMasterDisplay
* @returns {number} The index of the master Display detected on the hardware platform.
*/
* Gets the index number of the master display.
* @function PlatformInfo.getMasterDisplay
* @returns {number} The index of the master display.
*/
int getMasterDisplay();
/**jsdoc
* Get the description of the Display at the index parameter
* expected fields are:
* - DisplayVendor...
* @param index The index of the Display of the platform
* @function PlatformInfo.getDisplay
* @returns {string} The Display description json field
*/
* Gets the platform description of a display.
* @param {number} index - The index number of the display.
* @function PlatformInfo.getDisplay
* @returns {string} The display's {@link PlatformInfo.DisplayDescription|DisplayDescription} information as a JSON string.
* @example <caption>Report details of the systems's displays.</caption>
* var numDisplays = PlatformInfo.getNumDisplays();
* print("Number of displays: " + numDisplays);
* for (var i = 0; i < numDisplays; i++) {
* var displayDescription = PlatformInfo.getDisplay(i);
* print("Display " + i + ": " + displayDescription);
* }
*/
QString getDisplay(int index);
/**jsdoc
* Get the description of the Memory
* expected fields are:
* - MemoryVendor...
* @function PlatformInfo.getMemory
* @returns {string} The Memory description json field
*/
* Gets the platform description of computer memory.
* @function PlatformInfo.getMemory
* @returns {string} The computer's {@link PlatformInfo.MemoryDescription|MemoryDescription} information as a JSON string.
* @example <caption>Report details of the computer's memory.</caption>
* print("Memory: " + PlatformInfo.getMemory());
*/
QString getMemory();
/**jsdoc
* Get the description of the Computer
* expected fields are:
* - ComputerVendor...
* @function PlatformInfo.getComputer
* @returns {string} The Computer description json field
*/
* Gets the platform description of the computer.
* @function PlatformInfo.getComputer
* @returns {string} The {@link PlatformInfo.ComputerDescription|ComputerDescription} information as a JSON string.
*/
QString getComputer();
/**jsdoc
* Get the complete description of the Platform as an aggregated Json
* The expected object description is:
* { "computer": {...}, "memory": {...}, "cpus": [{...}, ...], "gpus": [{...}, ...], "displays": [{...}, ...] }
* @function PlatformInfo.getPlatform
* @returns {string} The Platform description json field
*/
* Gets the complete description of the computer as a whole.
* @function PlatformInfo.getPlatform
* @returns {string} The {@link PlatformInfo.PlatformDescription|PlatformDescription} information as a JSON string.
*/
QString getPlatform();
/**jsdoc
* Get the Platform TIer profiled on startup of the Computer
* Platform Tier is an integer/enum value:
* UNKNOWN = 0, LOW = 1, MID = 2, HIGH = 3
* @function PlatformInfo.getTierProfiled
* @returns {number} The Platform Tier profiled on startup.
*/
* Gets the platform tier of the computer, profiled at Interface start-up.
* @function PlatformInfo.getTierProfiled
* @returns {PlatformInfo.PlatformTier} The platform tier of the computer.
* @example <caption>Report the platform tier of the computer.</caption>
* var platformTier = PlatformInfo.getTierProfiled();
* var platformTierName = PlatformInfo.getPlatformTierNames()[platformTier];
* print("Platform tier: " + platformTier + ", " + platformTierName);
*/
PlatformTier getTierProfiled();
/**jsdoc
* Get the Platform Tier possible Names as an array of strings
* Platform Tier names are:
* [ "UNKNOWN", "LOW", "MID", "HIGH" ]
* @function PlatformInfo.getPlatformTierNames
* @returns {string} The array of names matching the number returned from PlatformInfo.getTierProfiled
*/
* Gets the names of the possible platform tiers, per {@link PlatformInfo.PlatformTier}.
* @function PlatformInfo.getPlatformTierNames
* @returns {string[]} The names of the possible platform tiers.
*/
QStringList getPlatformTierNames();
/**jsdoc
* Gets whether the current hardware can render using the Deferred method.
* @function PlatformInfo.isRenderMethodDeferredCapable
* @returns {bool} <code>true</code> if the current hardware can render using the Deferred method; <code>false</code> otherwise.
*/
* Gets whether the current hardware can use deferred rendering.
* @function PlatformInfo.isRenderMethodDeferredCapable
* @returns {boolean} <code>true</code> if the current hardware can use deferred rendering, <code>false</code> if it can't.
*/
bool isRenderMethodDeferredCapable();
};

View file

@ -15,13 +15,20 @@
#include "RenderForward.h"
/**jsdoc
* The <code>Render</code> API allows you to configure the graphics engine
* The <code>Render</code> API enables you to configure the graphics engine.
*
* @namespace Render
*
* @hifi-interface
* @hifi-client-entity
* @hifi-avatar
*
* @property {Render.RenderMethod} renderMethod - The render method being used.
* @property {boolean} shadowsEnabled - <code>true</code> if shadows are enabled, <code>false</code> if they're disabled.
* @property {boolean} ambientOcclusionEnabled - <code>true</code> if ambient occlusion is enabled, <code>false</code> if it's
* disabled.
* @property {boolean} antialiasingEnabled - <code>true</code> if anti-aliasing is enabled, <code>false</code> if it's disabled.
* @property {number} viewportResolutionScale - The view port resolution scale, <code>&gt; 0.0</code>.
*/
class RenderScriptingInterface : public QObject {
Q_OBJECT
@ -36,6 +43,21 @@ public:
static RenderScriptingInterface* getInstance();
/**jsdoc
* <p>The rendering method is specified by the following values:</p>
* <table>
* <thead>
* <tr><th>Value</th><th>Name</th><th>Description</th>
* </thead>
* <tbody>
* <tr><td><code>0</code></td><td>DEFERRED</td><td>More complex rendering pipeline where lighting is applied to the
* scene as a whole after all objects have been rendered.</td></tr>
* <tr><td><code>1</code></td><td>FORWARD</td><td>Simpler rendering pipeline where each object in the scene, in turn,
* is rendered and has lighting applied.</td></tr>
* </tbody>
* </table>
* @typedef {number} Render.RenderMethod
*/
// RenderMethod enum type
enum class RenderMethod {
DEFERRED = render::Args::RenderMethod::DEFERRED,
@ -52,95 +74,114 @@ public:
public slots:
/**jsdoc
* Get a config for a job by name
* Gets the configuration for a rendering job by name.
* <p><strong>Warning:</strong> For internal, debugging purposes. Subject to change.</p>
* @function Render.getConfig
* @param {string} name - Can be:
* - <job_name>: Search for the first job named job_name traversing the the sub graph of task and jobs (from this task as root)
* - <parent_name>.[<sub_parent_names>.]<job_name>: Allows you to first look for the parent_name job (from this task as root) and then search from there for the
* optional sub_parent_names and finally from there looking for the job_name (assuming every job in the path is found)
* @returns {object} The sub job config.
* @param {string} name - The name of the rendering job.
* @returns {object} The configuration for the rendering job.
*/
QObject* getConfig(const QString& name) { return qApp->getRenderEngine()->getConfiguration()->getConfig(name); }
/**jsdoc
* Gets the current render method
* Gets the render method being used.
* @function Render.getRenderMethod
* @returns {number} <code>"DEFERRED"</code> or <code>"FORWARD"</code>
* @returns {Render.RenderMethod} The render method being used.
* @example <caption>Report the current render method.</caption>
* var renderMethod = Render.getRenderMethod();
* print("Current render method: " + Render.getRenderMethodNames()[renderMethod]);
*/
RenderMethod getRenderMethod() const;
/**jsdoc
* Sets the current render method
* Sets the render method to use.
* @function Render.setRenderMethod
* @param {number} renderMethod - <code>"DEFERRED"</code> or <code>"FORWARD"</code>
* @param {Render.RenderMethod} renderMethod - The render method to use.
*/
void setRenderMethod(RenderMethod renderMethod);
/**jsdoc
* Gets the possible enum names of the RenderMethod type
* @function Render.getRenderMethodNames
* @returns [string] [ <code>"DEFERRED"</code>, <code>"FORWARD"</code> ]
*/
* Gets the names of the possible render methods, per {@link Render.RenderMethod}.
* @function Render.getRenderMethodNames
* @returns {string[]} The names of the possible render methods.
* @example <caption>Report the names of the possible render methods.</caption>
* var renderMethods = Render.getRenderMethodNames();
* print("Render methods:");
* for (var i = 0; i < renderMethods.length; i++) {
* print("- " + renderMethods[i]);
* }
*/
QStringList getRenderMethodNames() const;
/**jsdoc
* Whether or not shadows are enabled
* Gets whether or not shadows are enabled.
* @function Render.getShadowsEnabled
* @returns {bool} <code>true</code> if shadows are enabled, otherwise <code>false</code>
* @returns {boolean} <code>true</code> if shadows are enabled, <code>false</code> if they're disabled.
*/
bool getShadowsEnabled() const;
/**jsdoc
* Enables or disables shadows
* Sets whether or not shadows are enabled.
* @function Render.setShadowsEnabled
* @param {bool} enabled - <code>true</code> to enable shadows, <code>false</code> to disable them
* @param {boolean} enabled - <code>true</code> to enable shadows, <code>false</code> to disable.
*/
void setShadowsEnabled(bool enabled);
/**jsdoc
* Whether or not ambient occlusion is enabled
* Gets whether or not ambient occlusion is enabled.
* @function Render.getAmbientOcclusionEnabled
* @returns {bool} <code>true</code> if ambient occlusion is enabled, otherwise <code>false</code>
* @returns {boolean} <code>true</code> if ambient occlusion is enabled, <code>false</code> if it's disabled.
*/
bool getAmbientOcclusionEnabled() const;
/**jsdoc
* Enables or disables ambient occlusion
* Sets whether or not ambient occlusion is enabled.
* @function Render.setAmbientOcclusionEnabled
* @param {bool} enabled - <code>true</code> to enable ambient occlusion, <code>false</code> to disable it
* @param {boolean} enabled - <code>true</code> to enable ambient occlusion, <code>false</code> to disable.
*/
void setAmbientOcclusionEnabled(bool enabled);
/**jsdoc
* Whether or not anti-aliasing is enabled
* Gets whether or not anti-aliasing is enabled.
* @function Render.getAntialiasingEnabled
* @returns {bool} <code>true</code> if anti-aliasing is enabled, otherwise <code>false</code>
* @returns {boolean} <code>true</code> if anti-aliasing is enabled, <code>false</code> if it's disabled.
*/
bool getAntialiasingEnabled() const;
/**jsdoc
* Enables or disables anti-aliasing
* Sets whether or not anti-aliasing is enabled.
* @function Render.setAntialiasingEnabled
* @param {bool} enabled - <code>true</code> to enable anti-aliasing, <code>false</code> to disable it
* @param {boolean} enabled - <code>true</code> to enable anti-aliasing, <code>false</code> to disable.
*/
void setAntialiasingEnabled(bool enabled);
/**jsdoc
* Gets the current viewport resolution scale
* Gets the view port resolution scale.
* @function Render.getViewportResolutionScale
* @returns {number}
* @returns {number} The view port resolution scale, <code>&gt; 0.0</code>.
*/
float getViewportResolutionScale() const;
/**jsdoc
* Sets the current viewport resolution scale
* Sets the view port resolution scale.
* @function Render.setViewportResolutionScale
* @param {number} resolutionScale - between epsilon and 1.0
* @param {number} resolutionScale - The view port resolution scale to set, <code>&gt; 0.0</code>.
*/
void setViewportResolutionScale(float resolutionScale);
signals:
/**jsdoc
* Triggered when one of the <code>Render</code> API's properties changes.
* @function Render.settingsChanged
* @returns {Signal}
* @example <caption>Report when a render setting changes.</caption>
* Render.settingsChanged.connect(function () {
* print("Render setting changed");
* });
* // Toggle Developer > Render > Shadows or similar to trigger.
*/
void settingsChanged();
private:

View file

@ -1740,7 +1740,9 @@ QVector<QUuid> Overlays::findOverlays(const glm::vec3& center, float radius) {
* parented to if <code>parentID</code> is set. Use 65535 or -1 to parent to the parent's position and orientation rather
* than a joint.
*
* @property {string} url - The URL of the FBX or OBJ model used for the overlay.
* @property {string} url - The URL of the glTF, FBX, or OBJ model used for the overlay. glTF models may be in JSON or binary
* format (".gltf" or ".glb" URLs respectively). Baked models' URLs have ".baked" before the file type. Model files may
* also be compressed in GZ format, in which case the URL ends in ".gz".
* @property {number} loadPriority=0.0 - The priority for loading and displaying the overlay. Overlays with higher values load
* first. <em>Currently not used.</em>
* @property {Object.<string, string>|string} textures - Texture name, URL pairs used when rendering the model in place of the

View file

@ -2860,7 +2860,8 @@ glm::vec3 AvatarData::getAbsoluteJointTranslationInObjectFrame(int index) const
/**jsdoc
* Information on an attachment worn by the avatar.
* @typedef {object} AttachmentData
* @property {string} modelUrl - The URL of the model file. Models can be FBX or OBJ format.
* @property {string} modelUrl - The URL of the glTF, FBX, or OBJ model file. glTF models may be in JSON or binary format
* (".gltf" or ".glb" URLs respectively).
* @property {string} jointName - The name of the joint that the attachment is parented to.
* @property {Vec3} translation - The offset from the joint that the attachment is positioned at.
* @property {Vec3} rotation - The rotation applied to the model relative to the joint orientation.

View file

@ -117,8 +117,7 @@ const int COLLIDE_WITH_OTHER_AVATARS = 11; // 12th bit
const int HAS_HERO_PRIORITY = 12; // 13th bit (be scared)
/**jsdoc
* <p>The pointing state of the hands is specified by the following values:
</p>
* <p>The pointing state of the hands is specified by the following values:</p>
* <table>
* <thead>
* <tr><th>Value</th><th>Description</th>
@ -1268,12 +1267,11 @@ public:
/**jsdoc
* Attaches a model to your avatar. For example, you can give your avatar a hat to wear, a guitar to hold, or a surfboard to
* stand on.
* <p>Note: Attached models are models only; they are not entities and can not be manipulated using the {@link Entities} API.
* Nor can you use this function to attach an entity (such as a sphere or a box) to your avatar.</p>
* @function Avatar.attach
* @param {string} modelURL - The URL of the model to attach. Models can be .FBX or .OBJ format.
* @param {string} [jointName=""] - The name of the avatar joint (see {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}) to attach the model
* to.
* @param {string} modelURL - The URL of the glTF, FBX, or OBJ model to attach. glTF models may be in JSON or binary format
* (".gltf" or ".glb" URLs respectively).
* @param {string} [jointName=""] - The name of the avatar joint (see {@link MyAvatar.getJointNames} or
* {@link Avatar.getJointNames}) to attach the model to.
* @param {Vec3} [translation=Vec3.ZERO] - The offset to apply to the model relative to the joint position.
* @param {Quat} [rotation=Quat.IDENTITY] - The rotation to apply to the model relative to the joint orientation.
* @param {number} [scale=1.0] - The scale to apply to the model.

View file

@ -50,8 +50,10 @@ bool operator!=(const AnimationPropertyGroup& a, const AnimationPropertyGroup& b
/**jsdoc
* An animation is configured by the following properties:
* @typedef {object} Entities.AnimationProperties
* @property {string} url="" - The URL of the FBX file that has the animation.
* @property {boolean} allowTranslation=true - <code>true</code> to enable translations contained in the animation to be
* @property {string} url="" - The URL of the glTF or FBX file that has the animation. glTF files may be in JSON or binary
* format (".gltf" or ".glb" URLs respectively).
* <p><strong>Warning:</strong> glTF animations currently do not always animate correctly.</p>
* @property {boolean} allowTranslation=true - <code>true</code> to enable translations contained in the animation to be
* played, <code>false</code> to disable translations.
* @property {number} fps=30 - The speed in frames/s that the animation is played at.
* @property {number} firstFrame=0 - The first frame to play in the animation.

View file

@ -980,8 +980,8 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* value is specified then the model is automatically sized to its
* <code>{@link Entities.EntityProperties|naturalDimensions}</code>.
* @property {string} modelURL="" - The URL of the glTF, FBX, or OBJ model. glTF models may be in JSON or binary format
* (".gltf" or ".glb" URLs respectively). Baked FBX models' URLs end in ".baked.fbx". Model files may also be compressed in GZ
* format, in which case the URL ends in ".gz".
* (".gltf" or ".glb" URLs respectively). Baked models' URLs have ".baked" before the file type. Model files may also be
* compressed in GZ format, in which case the URL ends in ".gz".
* @property {Vec3} modelScale - The scale factor applied to the model's dimensions.
* <p class="important">Deprecated: This property is deprecated and will be removed.</p>
* @property {string} textures="" - A JSON string of texture name, URL pairs used when rendering the model in place of the
@ -1307,11 +1307,11 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* @property {number} rightMargin=0.0 - The right margin, in meters.
* @property {number} topMargin=0.0 - The top margin, in meters.
* @property {number} bottomMargin=0.0 - The bottom margin, in meters.
* @property {boolean} unlit=false - <code>true</code> if the entity should be unaffected by lighting. Otherwise, the text
* is lit by the keylight and local lights.
* @property {string} font="" - The text is rendered with this font. Can be one of the following: <code>Courier</code,
* <code>Inconsolata</code>, <code>Roboto</code>, <code>Timeless</code>, or a path to a .sdff file.
* @property {TextEffect} textEffect="none" - The effect that is applied to the text.
* @property {boolean} unlit=false - <code>true</code> if the entity is unaffected by lighting, <code>false</code> if it is lit
* by the key light and local lights.
* @property {string} font="" - The font to render the text with. It can be one of the following: <code>"Courier"</code,
* <code>"Inconsolata"</code>, <code>"Roboto"</code>, <code>"Timeless"</code>, or a path to a .sdff file.
* @property {Entities.TextEffect} textEffect="none" - The effect that is applied to the text.
* @property {Color} textEffectColor=255,255,255 - The color of the effect.
* @property {number} textEffectThickness=0.2 - The magnitude of the text effect, range <code>0.0</code> &ndash; <code>0.5</code>.
* @property {BillboardMode} billboardMode="none" - Whether the entity is billboarded to face the camera.

View file

@ -59,7 +59,7 @@ public:
* <code>"Sphere"</code>. If an entity of type <code>Box</code> or <code>Shape</code> has its <code>shape</code> set
* to <code>"Sphere"</code> then its <code>type</code> will be reported as <code>"Sphere"</code>.
* <td>{@link Entities.EntityProperties-Sphere|EntityProperties-Sphere}</td></tr>
* <tr><td><code>"Model"</code></td><td>A mesh model from a glTf, FBX, or OBJ file.</td>
* <tr><td><code>"Model"</code></td><td>A mesh model from a glTF, FBX, or OBJ file.</td>
* <td>{@link Entities.EntityProperties-Model|EntityProperties-Model}</td></tr>
* <tr><td><code>"Text"</code></td><td>A pane of text oriented in space.</td>
* <td>{@link Entities.EntityProperties-Text|EntityProperties-Text}</td></tr>

View file

@ -37,10 +37,10 @@ class ReadBitstreamToTreeParams;
* are cast by avatars, plus {@link Entities.EntityProperties-Model|Model} and
* {@link Entities.EntityProperties-Shape|Shape} entities that have their
* <code>{@link Entities.EntityProperties|canCastShadow}</code> property set to <code>true</code>.
* @property {number} shadowBias=0.5 - The bias of the shadows cast by the light. Use this to fine-tune your shadows to your scene
* to prevent shadow acne and peter panning. In the range <code>0.0</code> &ndash; <code>1.0</code>.
* @property {number} shadowMaxDistance=40.0 - The max distance from your view at which shadows will be computed. Higher values will
* cover more of your scene, but with less precision. In the range <code>1.0</code> &ndash; <code>250.0</code>.
* @property {number} shadowBias=0.5 - The bias of the shadows cast by the light, range <code>0.0</code> &ndash;
* <code>1.0</code>. This fine-tunes shadows cast by the light, to prevent shadow acne and peter panning.
* @property {number} shadowMaxDistance=40.0 - The maximum distance from the camera position at which shadows will be computed,
* range <code>1.0</code> &ndash; <code>250.0</code>. Higher values cover more of the scene but with less precision.
*/
class KeyLightPropertyGroup : public PropertyGroup {
public:

View file

@ -120,7 +120,8 @@ NetworkMaterialResource::ParsedMaterials NetworkMaterialResource::parseJSONMater
* Set to <code>"fallthrough"</code> to fall through to the material below. <code>"hifi_pbr"</code> model only.
* @property {number|string} opacity=1.0 - The opacity, range <code>0.0</code> &ndash; <code>1.0</code>.
* Set to <code>"fallthrough"</code> to fall through to the material below. <code>"hifi_pbr"</code> model only.
* @property {boolean|string} unlit=false - <code>true</code> if the material is not lit, <code>false</code> if it is.
* @property {boolean|string} unlit=false - <code>true</code> if the material is unaffected by lighting, <code>false</code> if
* it is lit by the key light and local lights.
* Set to <code>"fallthrough"</code> to fall through to the material below. <code>"hifi_pbr"</code> model only.
* @property {ColorFloat|RGBS|string} albedo - The albedo color. A {@link ColorFloat} value is treated as sRGB and must have
* component values in the range <code>0.0</code> &ndash; <code>1.0</code>. A {@link RGBS} value can be either RGB or sRGB.

View file

@ -10,19 +10,52 @@
#include "../Platform.h"
#include "../PlatformKeys.h"
/**jsdoc
* Information on the computer platform as a whole.
* @typedef {object} PlatformInfo.PlatformDescription
* @property {PlatformInfo.ComputerDescription} computer - Information on the computer.
* @property {PlatformInfo.CPUDescription[]} cpus - Information on the computer's CPUs.
* @property {PlatformInfo.DisplayDescription[]} displays - Information on the computer's displays.
* @property {PlatformInfo.GPUDescription[]} gpus - Information on the computer's GPUs.
* @property {PlatformInfo.GraphicsAPIDescription[]} graphicsAPIs - Information on the computer's graphics APIs.
* @property {PlatformInfo.MemoryDescription} memory - Information on the computer's memory.
* @property {PlatformInfo.NICDescription} nics - Information on the computer's network cards.
*/
namespace platform { namespace keys {
const char* UNKNOWN = "UNKNOWN";
/**jsdoc
* Information on a CPU.
* @typedef {object} PlatformInfo.CPUDescription
* @property {string} vendor - The CPU vendor (e.g., <code>"Intel"</code> or <code>"AMD"</code>).
* @property {string} model - The CPU model.
* @property {number} numCores - The number of logical cores.
* @property {boolean} isMaster - <code>true</code> if the CPU is the "master" or primary CPU, <code>false</code> or
* <code>undefined</code> if it isn't.
*/
namespace cpu {
const char* vendor = "vendor";
const char* vendor_Intel = "Intel";
const char* vendor_AMD = "AMD";
const char* model = "model";
const char* clockSpeed = "clockSpeed";
const char* clockSpeed = "clockSpeed"; // FIXME: Not used.
const char* numCores = "numCores";
const char* isMaster = "isMaster";
}
/**jsdoc
* Information on a GPU.
* @typedef {object} PlatformInfo.GPUDescription
* @property {string} vendor - The GPU vendor (e.g., <code>"NVIDIA"</code>, <code>"AMD"</code>, or <code>"Intel"</code>).
* @property {string} model - The GPU model.
* @property {string} driver - The GPU driver version.
* @property {number} videoMemory - The size of the GPU's video memory, in MB.
* @property {number[]} displays - The index numbers of the displays currently being driven by the GPU. An empty array if
* the GPU is currently not driving any displays.
* @property {boolean} isMaster - <code>true</code> if the GPU is the "master" or primary GPU, <code>false</code> or
* <code>undefined</code> if it isn't.
*/
namespace gpu {
const char* vendor = "vendor";
const char* vendor_NVIDIA = "NVIDIA";
@ -35,6 +68,45 @@ namespace platform { namespace keys {
const char* displays = "displays";
const char* isMaster = "isMaster";
}
/**jsdoc
* Information on a graphics API.
* @typedef {object} PlatformInfo.GraphicsAPIDescription
* @property {string} name - The name of the graphics API.
* @property {string} version - The version of the graphics API.
*
* @property {string} [renderer] - If an OpenGL API, then the graphics card that performs the rendering.
* @property {string} [vendor] - If an OpenGL API, then the OpenGL vendor.
* @property {string} [shadingLanguageVersion] - If an OpenGL API, then the shading language version.
* @property {string[]} [extensions] - If an OpenGL API, then the list of OpenGL extensions supported.
*
* @property {PlatformInfo.VulkanAPIDescription[]} [devices] - If a Vulkan API, then the devices provided in the API.
*/
/**jsdoc
* Information on a Vulkan graphics API.
* @typedef {object} PlatformInfo.VulkanAPIDescription
* @property {string}
* @property {string} driverVersion - The driver version.
* @property {string} apiVersion - The API version.
* @property {string} deviceType - The device type.
* @property {string} vendor - The device vendor.
* @property {string} name - The device name.
* @property {string[]} extensions - The list of Vulkan extensions supported.
* @property {PlatformInfo.VulkanQueueDescription[]} queues - The Vulkan queues available.
* @property {PlatformInfo.VulkanHeapDescription[]} heaps - The Vulkan heaps available.
*/
/**jsdoc
* Information on a Vulkan queue.
* @typedef {object} PlatformInfo.VulkanQueueDescription
* @property {string} flags - The Vulkan queue flags.
* @property {number} count - The queue count.
*/
/**jsdoc
* Information on a Vulkan heap.
* @typedef {object} PlatformInfo.VulkanHeapDescription
* @property {string} flags - The Vulkan heap flags.
* @property {number} size - The heap size.
*/
namespace graphicsAPI {
const char* name = "name";
const char* version = "version";
@ -74,10 +146,38 @@ namespace platform { namespace keys {
}
}
}
/**jsdoc
* Information on a network card.
* @typedef {object} PlatformInfo.NICDescription
* @property {string} name - The name of the network card.
* @property {string} mac - The MAC address of the network card.
*/
namespace nic {
const char* mac = "mac";
const char* name = "name";
}
/**jsdoc
* Information on a display.
* @typedef {object} PlatformInfo.DisplayDescription
* @property {string} description - The display's description.
* @property {string} deviceName - The display's device name.
* @property {number} boundsLeft - The pixel coordinate of the left edge of the display (e.g., <code>0</code>).
* @property {number} boundsRight - The pixel coordinate of the right edge of the display (e.g., <code>1920</code>).
* @property {number} boundsTop - The pixel coordinate of the top edge of the display (e.g., <code>0</code>).
* @property {number} boundsBottom - The pixel coordinate of the bottom edge of the display (e.g., <code>1080</code>).
* @property {number} gpu - The index number of the GPU that's driving the display.
* @property {number} ppi - The physical dots per inch of the display.
* @property {number} ppiDesktop - The logical dots per inch of the desktop as used by the operating system.
* @property {number} physicalWidth - The physical width of the display, in inches.
* @property {number} physicalHeight - The physical height of the display, in inches.
* @property {number} modeRefreshrate - The refresh rate of the current display mode, in Hz.
* @property {number} modeWidth - The width of the current display mode, in pixels.
* @property {number} modeHeight - The height of the current display mode, in pixels.
* @property {boolean} isMaster - <code>true</code> if the GPU is the "master" or primary display, <code>false</code> or
* <code>undefined</code> if it isn't.
*/
namespace display {
const char* description = "description";
const char* name = "deviceName";
@ -95,9 +195,40 @@ namespace platform { namespace keys {
const char* modeHeight = "modeHeight";
const char* isMaster = "isMaster";
}
/**jsdoc
* Information on the computer's memory.
* @typedef {object} PlatformInfo.MemoryDescription
* @property {number} memTotal - The total amount of usable physical memory, in MB.
*/
namespace memory {
const char* memTotal = "memTotal";
}
/**jsdoc
* Information on the computer.
* @typedef {object} PlatformInfo.ComputerDescription
* @property {PlatformInfo.ComputerOS} OS - The operating system.
* @property {string} OSversion - The operating system version.
* @property {string} vendor - The computer vendor.
* @property {string} model - The computer model.
* @property {PlatformInfo.PlatformTier} profileTier - The platform tier of the computer, profiled at Interface start-up.
*/
/**jsdoc
* <p>The computer operating system.</p>
* <table>
* <thead>
* <tr><th>Value</th><th>Description</th></tr>
* </thead>
* <tbody>
* <tr><td><code>"WINDOWS"</code></td><td>Windows.</td></tr>
* <tr><td><code>"MACOS"</code></td><td>Mac OS.</td></tr>
* <tr><td><code>"LINUX"</code></td><td>Linux.</td></tr>
* <tr><td><code>"ANDROID"</code></td><td>Android.</td></tr>
* </tbody>
* </table>
* @typedef {string} PlatformInfo.ComputerOS
*/
namespace computer {
const char* OS = "OS";
const char* OS_WINDOWS = "WINDOWS";

View file

@ -22,8 +22,9 @@
#include <QString>
/**jsdoc
* Helper functions to render ephemeral debug markers and lines.
* DebugDraw markers and lines are only visible locally, they are not visible by other users.
* The <code>DebugDraw</code> API renders debug markers and lines. These markers are only visible locally; they are not visible
* to other users.
*
* @namespace DebugDraw
*
* @hifi-interface
@ -41,57 +42,107 @@ public:
~DebugDraw();
/**jsdoc
* Draws a line in world space, but it will only be visible for a single frame.
* Draws a line in world space, visible for a single frame. To make the line visually persist, you need to repeatedly draw
* it.
* @function DebugDraw.drawRay
* @param {Vec3} start - start position of line in world space.
* @param {Vec3} end - end position of line in world space.
* @param {Vec4} color - color of line, each component should be in the zero to one range. x = red, y = blue, z = green, w = alpha.
* @param {Vec3} start - The start position of the line, in world coordinates.
* @param {Vec3} end - The end position of the line, in world coordinates.
* @param {Vec4} color - The color of the line. Each component should be in the range <code>0.0</code> &ndash;
* <code>1.0</code>, with <code>x</code> = red, <code>y</code> = green, <code>z</code> = blue, and <code>w</code> = alpha.
* @example <caption>Draw a red ray from your initial avatar position to 10m in front of it.</caption>
* var start = MyAvatar.position;
* var end = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -10 }));
* var color = { x: 1.0, y: 0.0, z: 0.0, w: 1.0 };
*
* Script.update.connect(function () {
* DebugDraw.drawRay(start, end, color);
* });
*/
Q_INVOKABLE void drawRay(const glm::vec3& start, const glm::vec3& end, const glm::vec4& color);
/**jsdoc
* Draws a line in world space, but it will only be visible for a single frame.
* @function DebugDraw.drawRay
* @param {Vec3} start - start position of line in world space.
* @param {Vec3} end - end position of line in world space.
* @param {Vec4} color - color of line, each component should be in the zero to one range. x = red, y = blue, z = green, w = alpha.
*/
* Draws lines in world space, visible for a single frame. To make the lines visually persist, you need to repeatedly draw
* them.
* <p><strong>Note:</strong> Currently doesn't work.
* @function DebugDraw.drawRays
* @param {Vec3Pair[]} lines - The start and end points of the lines to draw.
* @param {Vec4} color - The color of the lines. Each component should be in the range <code>0.0</code> &ndash;
* <code>1.0</code>, with <code>x</code> = red, <code>y</code> = green, <code>z</code> = blue, and <code>w</code> = alpha.
* @param {Vec3} [translation=0,0,0] - A translation applied to each line.
* @param {Quat} [rotation=Quat.IDENTITY] - A rotation applied to each line.
* @example <caption>Draw a red "V" in front of your initial avatar position.</caption>
* var lines = [
* [{ x: -1, y: 0.5, z: 0 }, { x: 0, y: 0, z: 0 }],
* [{ x: 0, y: 0, z: 0 }, { x: 1, y: 0.5, z: 0 }]
* ];
* var color = { x: 1, y: 0, z: 0, w: 1 };
* var translation = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -5 }));
* var rotation = MyAvatar.orientation;
*
* Script.update.connect(function () {
* DebugDraw.drawRays(lines, color, translation, rotation);
* });
*/
Q_INVOKABLE void drawRays(const std::vector<std::pair<glm::vec3, glm::vec3>>& lines, const glm::vec4& color,
const glm::vec3& translation = glm::vec3(0.0f, 0.0f, 0.0f), const glm::quat& rotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f));
/**jsdoc
* Adds a debug marker to the world. This marker will be drawn every frame until it is removed with DebugDraw.removeMarker.
* This can be called repeatedly to change the position of the marker.
* Adds or updates a debug marker in world coordinates. This marker is drawn every frame until it is removed using
* {@link DebugDraw.removeMarker|removeMarker}. If a world coordinates debug marker of the specified <code>name</code>
* already exists, its parameters are updated.
* @function DebugDraw.addMarker
* @param {string} key - name to uniquely identify this marker, later used for DebugDraw.removeMarker.
* @param {Quat} rotation - start position of line in world space.
* @param {Vec3} position - position of the marker in world space.
* @param {Vec4} color - color of the marker.
* @param {string} key - A name that uniquely identifies the marker.
* @param {Quat} rotation - The orientation of the marker in world coordinates.
* @param {Vec3} position - The position of the market in world coordinates.
* @param {Vec4} color - The color of the marker.
* @example <caption>Briefly draw a debug marker in front of your avatar, in world coordinates.</caption>
* var MARKER_NAME = "my marker";
* DebugDraw.addMarker(
* MARKER_NAME,
* Quat.ZERO,
* Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -5})),
* { red: 255, green: 0, blue: 0 }
* );
* Script.setTimeout(function () {
* DebugDraw.removeMarker(MARKER_NAME);
* }, 5000);
*/
Q_INVOKABLE void addMarker(const QString& key, const glm::quat& rotation, const glm::vec3& position, const glm::vec4& color);
/**jsdoc
* Removes debug marker from the world. Once a marker is removed, it will no longer be visible.
* Removes a debug marker that was added in world coordinates.
* @function DebugDraw.removeMarker
* @param {string} key - name of marker to remove.
* @param {string} key - The name of the world coordinates debug marker to remove.
*/
Q_INVOKABLE void removeMarker(const QString& key);
/**jsdoc
* Adds a debug marker to the world, this marker will be drawn every frame until it is removed with DebugDraw.removeMyAvatarMarker.
* This can be called repeatedly to change the position of the marker.
* Adds or updates a debug marker to the world in avatar coordinates. This marker is drawn every frame until it is removed
* using {@link DebugDraw.removeMyAvatarMarker|removeMyAvatarMarker}. If an avatar coordinates debug marker of the
* specified <code>name</code> already exists, its parameters are updated. The debug marker moves with your avatar.
* @function DebugDraw.addMyAvatarMarker
* @param {string} key - name to uniquely identify this marker, later used for DebugDraw.removeMyAvatarMarker.
* @param {Quat} rotation - start position of line in avatar space.
* @param {Vec3} position - position of the marker in avatar space.
* @param {string} key - A name that uniquely identifies the marker.
* @param {Quat} rotation - The orientation of the marker in avatar coordinates.
* @param {Vec3} position - The position of the market in avatar coordinates.
* @param {Vec4} color - color of the marker.
* @example <caption>Briefly draw a debug marker in front of your avatar, in avatar coordinates.</caption>
* var MARKER_NAME = "My avatar marker";
* DebugDraw.addMyAvatarMarker(
* MARKER_NAME,
* Quat.ZERO,
* { x: 0, y: 0, z: -5 },
* { red: 255, green: 0, blue: 0 }
* );
* Script.setTimeout(function () {
* DebugDraw.removeMyAvatarMarker(MARKER_NAME);
* }, 5000);
*/
Q_INVOKABLE void addMyAvatarMarker(const QString& key, const glm::quat& rotation, const glm::vec3& position, const glm::vec4& color);
/**jsdoc
* Removes debug marker from the world. Once a marker is removed, it will no longer be visible
* Removes a debug marker that was added in avatar coordinates.
* @function DebugDraw.removeMyAvatarMarker
* @param {string} key - name of marker to remove.
* @param {string} key - The name of the avatar coordinates debug marker to remove.
*/
Q_INVOKABLE void removeMyAvatarMarker(const QString& key);

View file

@ -1229,8 +1229,10 @@ AnimationDetails::AnimationDetails(QString role, QUrl url, float fps, float prio
* The details of an animation that is playing.
* @typedef {object} Avatar.AnimationDetails
* @property {string} role - <em>Not used.</em>
* @property {string} url - The URL to the animation file. Animation files need to be in .FBX format but only need to contain
* the avatar skeleton and animation data.
* @property {string} url - The URL to the animation file. Animation files need to be in glTF or FBX format but only need to
* contain the avatar skeleton and animation data. glTF models may be in JSON or binary format (".gltf" or ".glb" URLs
* respectively).
* <p><strong>Warning:</strong> glTF animations currently do not always animate correctly.</p>
* @property {number} fps - The frames per second(FPS) rate for the animation playback. 30 FPS is normal speed.
* @property {number} priority - <em>Not used.</em>
* @property {boolean} loop - <code>true</code> if the animation should loop, <code>false</code> if it shouldn't.

View file

@ -109,14 +109,14 @@ public:
virtual void setPresetList(const QJsonObject& object);
/**jsdoc
* @function Render.toJSON
* @function Workload.toJSON
* @returns {string}
*/
// This must be named toJSON to integrate with the global scripting JSON object
Q_INVOKABLE QString toJSON() { return QJsonDocument(toJsonValue(*this).toObject()).toJson(QJsonDocument::Compact); }
/**jsdoc
* @function Render.load
* @function Workload.load
* @param {object} map
*/
Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); }
@ -130,25 +130,25 @@ public:
// Describe the node graph data connections of the associated Job/Task
/**jsdoc
* @function Render.isTask
* @function Workload.isTask
* @returns {boolean}
*/
Q_INVOKABLE virtual bool isTask() const { return false; }
/**jsdoc
* @function Render.getSubConfigs
* @function Workload.getSubConfigs
* @returns {object[]}
*/
Q_INVOKABLE virtual QObjectList getSubConfigs() const { return QObjectList(); }
/**jsdoc
* @function Render.getNumSubs
* @function Workload.getNumSubs
* @returns {number}
*/
Q_INVOKABLE virtual int getNumSubs() const { return 0; }
/**jsdoc
* @function Render.getSubConfig
* @function Workload.getSubConfig
* @param {number} index
* @returns {object}
*/
@ -162,32 +162,32 @@ public:
public slots:
/**jsdoc
* @function Render.load
* @function Workload.load
* @param {object} map
*/
void load(const QJsonObject& val) { qObjectFromJsonValue(val, *this); emit loaded(); }
/**jsdoc
* @function Render.refresh
* @function Workload.refresh
*/
void refresh();
signals:
/**jsdoc
* @function Render.loaded
* @function Workload.loaded
* @returns {Signal}
*/
void loaded();
/**jsdoc
* @function Render.newStats
* @function Workload.newStats
* @returns {Signal}
*/
void newStats();
/**jsdoc
* @function Render.dirtyEnabled
* @function Workload.dirtyEnabled
* @returns {Signal}
*/
void dirtyEnabled();
@ -202,7 +202,7 @@ public:
/**jsdoc
* @namespace Render
* @namespace Workload
*
* @hifi-interface
* @hifi-client-entity
@ -221,7 +221,7 @@ public:
TaskConfig(bool enabled) : JobConfig(enabled) {}
/**jsdoc
* @function Render.getConfig
* @function Workload.getConfig
* @param {string} name
* @returns {object}
*/

View file

@ -56,6 +56,7 @@ exports.handlers = {
'../../libraries/networking/src',
'../../libraries/octree/src',
'../../libraries/physics/src',
'../../libraries/platform/src/platform/backend',
'../../libraries/plugins/src/plugins',
'../../libraries/pointers/src',
'../../libraries/render-utils/src',