PlatformInfo

Description

The PlatformInfo API provides information about the computer and controllers being used.

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts

Methods

Name Return Value Summary
getComputer string Get the description of the Computer expected fields are: - ComputerVendor...
getCPU string Get the description of the CPU at the index parameter expected fields are: - cpuVendor...
getCPUBrand string Gets information on the CPU.

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

getDisplay string Get the description of the Display at the index parameter expected fields are: - DisplayVendor...
getGPU string Get the description of the GPU at the index parameter expected fields are: - vendor, model...
getGraphicsCardType string Gets the graphics card type.

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

getInstance None

Deprecated: This function is deprecated and will be removed.

getMasterCPU number Get the index of the master CPU.
getMasterDisplay number Get the index of the master Display.
getMasterGPU number Get the index of the master GPU.
getMemory string Get the description of the Memory expected fields are: - MemoryVendor...
getNumCPUs number Get the number of CPUs.
getNumDisplays number Get the number of Displays.
getNumGPUs number Get the number of GPUs.
getNumLogicalCores number Gets the number of logical CPU cores.

Deprecated: This function is deprecated and will be removed. use getCPU(0)["numCores"] instead

getOperatingSystemType string Gets the operating system type.

Deprecated: This function is deprecated and will be removed. use getComputer()["OS"] instead

getPlatform string Get the complete description of the Platform as an aggregated Json The expected object description is: { "computer": {...}, "memory": {...}, "cpus": [{...}, ...], "gpus": [{...}, ...], "displays": [{...}, ...] }
getPlatformTierNames string Get the Platform Tier possible Names as an array of strings Platform Tier names are: [ "UNKNOWN", "LOW", "MID", "HIGH" ]
getTierProfiled number 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
getTotalSystemMemoryMB number Returns the total system memory in megabytes.

Deprecated: This function is deprecated and will be removed. use getMemory()["memTotal"] instead

has3DHTML boolean Checks whether HTML on 3D surfaces (e.g., Web entities) is supported.
hasRiftControllers boolean Checks whether Oculus Touch controllers are connected.
hasViveControllers boolean Checks whether Vive controllers are connected.
isRenderMethodDeferredCapable bool Gets whether the current hardware can render using the Deferred method.
isStandalone boolean Checks whether Interface is running on a stand-alone HMD device (CPU incorporated into the HMD display).

Method Details

(static) getComputer( ) → {string}
Returns: The Computer description json field

Get the description of the Computer expected fields are: - ComputerVendor...

(static) getCPU( index ) → {string}
Returns: The CPU description json field

Get the description of the CPU at the index parameter expected fields are: - cpuVendor...

Parameters

Name Type Description
index The index of the CPU of the platform
(static) getCPUBrand( ) → {string}
Returns: Information on the CPU.

Gets information on the CPU.

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

Example

Report the CPU being used.

print("CPU: " + PlatformInfo.getCPUBrand());
// Example: Intel(R) Core(TM) i7-7820HK CPU @ 2.90GHz
(static) getDisplay( index ) → {string}
Returns: The Display description json field

Get the description of the Display at the index parameter expected fields are: - DisplayVendor...

Parameters

Name Type Description
index The index of the Display of the platform
(static) getGPU( index ) → {string}
Returns: The GPU description json field

Get the description of the GPU at the index parameter expected fields are: - vendor, model...

Parameters

Name Type Description
index The index of the GPU of the platform
(static) getGraphicsCardType( ) → {string}
Returns: The graphics card type.

Gets the graphics card type.

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

(static) getInstance( )

Deprecated: This function is deprecated and will be removed.

(static) getMasterCPU( ) → {number}
Returns: The index of the master CPU detected on the hardware platform.

Get the index of the master CPU.

(static) getMasterDisplay( ) → {number}
Returns: The index of the master Display detected on the hardware platform.

Get the index of the master Display.

(static) getMasterGPU( ) → {number}
Returns: The index of the master GPU detected on the hardware platform.

Get the index of the master GPU.

(static) getMemory( ) → {string}
Returns: The Memory description json field

Get the description of the Memory expected fields are: - MemoryVendor...

(static) getNumCPUs( ) → {number}
Returns: The number of CPUs detected on the hardware platform.

Get the number of CPUs.

(static) getNumDisplays( ) → {number}
Returns: The number of Displays detected on the hardware platform.

Get the number of Displays.

(static) getNumGPUs( ) → {number}
Returns: The number of GPUs detected on the hardware platform.

Get the number of GPUs.

(static) getNumLogicalCores( ) → {number}
Returns: The number of logical CPU cores.

Gets the number of logical CPU cores.

Deprecated: This function is deprecated and will be removed. use getCPU(0)["numCores"] instead

(static) getOperatingSystemType( ) → {string}
Returns: "WINDOWS", "MACOS", or "UNKNOWN".

Gets the operating system type.

Deprecated: This function is deprecated and will be removed. use getComputer()["OS"] instead

(static) getPlatform( ) → {string}
Returns: The Platform description json field

Get the complete description of the Platform as an aggregated Json The expected object description is: { "computer": {...}, "memory": {...}, "cpus": [{...}, ...], "gpus": [{...}, ...], "displays": [{...}, ...] }

(static) getPlatformTierNames( ) → {string}
Returns: The array of names matching the number returned from PlatformInfo.getTierProfiled

Get the Platform Tier possible Names as an array of strings Platform Tier names are: [ "UNKNOWN", "LOW", "MID", "HIGH" ]

(static) getTierProfiled( ) → {number}
Returns: The Platform Tier profiled on startup.

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

(static) getTotalSystemMemoryMB( ) → {number}
Returns: The total system memory in megabytes.

Returns the total system memory in megabytes.

Deprecated: This function is deprecated and will be removed. use getMemory()["memTotal"] instead

(static) has3DHTML( ) → {boolean}
Returns: true if the current display supports HTML on 3D surfaces, false if it doesn't.

Checks whether HTML on 3D surfaces (e.g., Web entities) is supported.

(static) hasRiftControllers( ) → {boolean}
Returns: true if Oculus Touch controllers are connected, false if they aren't.

Checks whether Oculus Touch controllers are connected.

(static) hasViveControllers( ) → {boolean}
Returns: true if Vive controllers are connected, false if they aren't.

Checks whether Vive controllers are connected.

(static) isRenderMethodDeferredCapable( ) → {bool}
Returns: true if the current hardware can render using the Deferred method; false otherwise.

Gets whether the current hardware can render using the Deferred method.

(static) isStandalone( ) → {boolean}
Returns: true if Interface is running on a stand-alone device, false if it isn't.

Checks whether Interface is running on a stand-alone HMD device (CPU incorporated into the HMD display).