altspace

The main module for the AltspaceVR SDK.

Classes

AltRenderer
Gamepad
TrackingJoint
TrackingSkeleton

Members

(static) inClient :Boolean

True if the app is running inside AltspaceVR.

Methods

(static) getEnclosure() → {Promise}

Gets the enclosure for the app. The resulting promise resolves to an Enclosure.

(static) getGamepads() → {Array}

Get a list of currently connected gamepads. Currently this requires polling this function until it returns a non-empty array. Connected gamepads are represented as Gamepad objects. This should work with a range of gamepads, but has only been tested with an Xbox One controller on Windows.

(static) getThreeJSDebugInfo() → {Promise}

Retrieves debug information about 3D objects in an app. The resulting promise resolves to an array of ThreeJSDebugInfo objects.

(static) getThreeJSRenderer() → {AltRenderer}

Gets the renderer instance for this app.

(static) getThreeJSTrackingSkeleton() → {Promise}

Get the tracking skeleton representing the body of the current user. The resulting promise resolves to a TrackingSkeleton object.

(static) getUser() → {Promise}

Gets the current user. The resulting promise resolves to a User object.

Type Definitions

Enclosure

Represents an app enclosure in AltspaceVR.

Properties:
Name Type Description
innerWidth Number

The width of the enclosure in pixels.

innerHeight Number

The height of the enclosure in pixels.

innerDepth Number

The depth of the enclosure in pixels.

pixelsPerMeter Number

The ratio of pixels to meters.

ThreeJSDebugInfo

Debug information about an object in an app.

Properties:
Name Type Description
uuid String

The Three.js UUID for this object.

vertexCount Number

Number of vertices in this object's geometry.

isVisible Boolean

If this object is visible in the scene

isMaterialVisible Boolean

If this object's material is visible.

isCulled Boolean

If this object has been culled due to it moving out of the app enclosure bounds.

position Object

The object's position vector.

quaternion Object

The object's orientation quarternion.

TouchpadEvent

The TouchpadEvent interface represents events that occur due to the user interacting with the Samsung GearVR Touchpad

The best way to think about the units returned from the displacement properties is that they are the number of pixels that would be theoretically scrolled by swiping on the touchpad. Due to built-in acceleration, this can range from approximately 300 to 700 pixels for a full swipe of the touchpad. The coordinate system can also be thought of as the value you would add to the document position to scroll due to the swipe. (left is +x, up is +y)

Properties:
Name Type Description
displacementX Number

The horizontal distance that the user has dragged their finger since pressing it on the touchpad. Sliding the finger left on the touchpad increases this value

displacementY Number

The vertical distance that the user has dragged their finger since pressing it on the touchpad. Sliding the finger up on the touchpad increases this value

User

Details of a user.

Properties:
Name Type Description
userId String

Unique id for this user.

displayName String

The user's chosen display name.

Events

touchpaddown

The touchpaddown event is fired from the altspace object when the user presses their finger down on the touchpad. The displacement for this event will always be [0, 0]

Type:

touchpadgesture

The touchpadgesture event is fired from the altspace object when the user lifts their finger off the touchpad. If it is within a minimum radius, a tap is triggered. Otherwise the primary direction of movement is used to generate a directional gesture.

Properties:
Name Type Description
gesture TouchpadGesture

One of 'tap', 'up', 'down', 'left', 'right'

touchpadmove

The touchpadmove event is fired from the altspace object while the user slides their finger across the trackpad.

Type:

touchpadup

The touchpadup event is fired from the altspace object when the user lifts their finger up from the touchpad.

Type: