Global

Description

Type Definitions

AACube
Type: object

An axis-aligned cube, defined as the bottom right near (minimum axes values) corner of the cube plus the dimension of its sides.

Properties

Name Type Summary
x number X coordinate of the brn corner of the cube.
y number Y coordinate of the brn corner of the cube.
z number Z coordinate of the brn corner of the cube.
scale number The dimensions of each side of the cube.
AttachmentData
Type: object

Information on an attachment worn by the avatar.

Properties

Name Type Summary
modelUrl string The URL of the model file. Models can be FBX or OBJ format.
jointName string The offset to apply to the model relative to the joint position.
translation Vec3 The offset from the joint that the attachment is positioned at.
rotation Vec3 The rotation applied to the model relative to the joint orientation.
scale number The scale applied to the attachment model.
soft boolean If true and the model has a skeleton, the bones of the attached model's skeleton are rotated to fit the avatar's current pose. If true, the translation, rotation, and scale parameters are ignored.
AvatarData
Type: object

Information about an avatar.

Properties

Name Type Summary
position Vec3 The avatar's position.
scale number The target scale of the avatar without any restrictions on permissible values imposed by the domain.
handPosition Vec3 A user-defined hand position, in world coordinates. The position moves with the avatar but is otherwise not used or changed by Interface.
bodyPitch number The pitch of the avatar's body, in degrees.
bodyYaw number The yaw of the avatar's body, in degrees.
bodyRoll number The roll of the avatar's body, in degrees.
orientation Quat The orientation of the avatar's body.
headOrientation Quat The orientation of the avatar's head.
headPitch number The pitch of the avatar's head relative to the body, in degrees.
headYaw number The yaw of the avatar's head relative to the body, in degrees.
headRoll number The roll of the avatar's head relative to the body, in degrees.
velocity Vec3 The linear velocity of the avatar.
angularVelocity Vec3 The angular velocity of the avatar.
sessionUUID Uuid The avatar's session ID.
displayName string The avatar's display name.
sessionDisplayName string The avatar's display name, sanitized and versioned, as defined by the avatar mixer. It is unique among all avatars present in the domain at the time.
isReplicated boolean Deprecated: This property is deprecated and will be removed.
lookAtSnappingEnabled boolean true if the avatar's eyes snap to look at another avatar's eyes when the other avatar is in the line of sight and also has lookAtSnappingEnabled == true.
skeletonModelURL string The avatar's FST file.
attachmentData Array.<AttachmentData> Information on the avatar's attachments.

Deprecated: This property is deprecated and will be removed. Use avatar entities instead.

jointNames Array.<string> The list of joints in the current avatar model.
audioLoudness number The instantaneous loudness of the audio input that the avatar is injecting into the domain.
audioAverageLoudness number The rolling average loudness of the audio input that the avatar is injecting into the domain.
sensorToWorldMatrix Mat4 The scale, rotation, and translation transform from the user's real world to the avatar's size, orientation, and position in the virtual world.
controllerLeftHandMatrix Mat4 The rotation and translation of the left hand controller relative to the avatar.
controllerRightHandMatrix Mat4 The rotation and translation of the right hand controller relative to the avatar.
hasPriority boolean true if the avatar is in a "hero" zone, false if it isn't.
AvatarDataRate
Type: string

The avatar mixer data comprises different types of data, with the data rates of each being tracked in kbps.

Rate NameDescription
"globalPosition"Incoming global position.
"localPosition"Incoming local position.
"handControllers"Incoming hand controllers.
"avatarBoundingBox"Incoming avatar bounding box.
"avatarOrientation"Incoming avatar orientation.
"avatarScale"Incoming avatar scale.
"lookAtPosition"Incoming look-at position.
"audioLoudness"Incoming audio loudness.
"sensorToWorkMatrix"Incoming sensor-to-world matrix.
"additionalFlags"Incoming additional avatar flags.
"parentInfo"Incoming parent information.
"faceTracker"Incoming face tracker data.
"jointData"Incoming joint data.
"jointDefaultPoseFlagsRate"Incoming joint default pose flags.
"farGrabJointRate"Incoming far grab joint.
"globalPositionOutbound"Outgoing global position.
"localPositionOutbound"Outgoing local position.
"avatarBoundingBoxOutbound"Outgoing avatar bounding box.
"avatarOrientationOutbound"Outgoing avatar orientation.
"avatarScaleOutbound"Outgoing avatar scale.
"lookAtPositionOutbound"Outgoing look-at position.
"audioLoudnessOutbound"Outgoing audio loudness.
"sensorToWorkMatrixOutbound"Outgoing sensor-to-world matrix.
"additionalFlagsOutbound"Outgoing additional avatar flags.
"parentInfoOutbound"Outgoing parent information.
"faceTrackerOutbound"Outgoing face tracker data.
"jointDataOutbound"Outgoing joint data.
"jointDefaultPoseFlagsOutbound"Outgoing joint default pose flags.
""When no rate name is specified, the total incoming data rate is provided.

AvatarEntityMap
Type: Object.<Uuid, Entities.EntityProperties>

An object with the UUIDs of avatar entities as keys and avatar entity properties objects as values.

AvatarSimulationRate
Type: string

An avatar has different types of data simulated at different rates, in Hz.

Rate NameDescription
"avatar" or ""The rate at which the avatar is updated even if not in view.
"avatarInView"The rate at which the avatar is updated if in view.
"skeletonModel"The rate at which the skeleton model is being updated, even if there are no joint data available.
"jointData"The rate at which joint data are being updated.
""When no rate name is specified, the "avatar" update rate is provided.

AvatarUpdateRate
Type: string

The avatar mixer data comprises different types of data updated at different rates, in Hz.

Rate NameDescription
"globalPosition"Global position.
"localPosition"Local position.
"handControllers"Hand controller positions and orientations.
"avatarBoundingBox"Avatar bounding box.
"avatarOrientation"Avatar orientation.
"avatarScale"Avatar scale.
"lookAtPosition"Look-at position.
"audioLoudness"Audio loudness.
"sensorToWorkMatrix"Sensor-to-world matrix.
"additionalFlags"Additional avatar flags.
"parentInfo"Parent information.
"faceTracker"Face tracker data.
"jointData"Joint data.
"farGrabJointData"Far grab joint data.
""When no rate name is specified, the overall update rate is provided.

BillboardMode
Type: string

How an entity is billboarded.

ValueDescription
"none"The entity will not be billboarded.
"yaw"The entity will yaw, but not pitch, to face the camera. Its actual rotation will be ignored.
"full"The entity will be billboarded to face the camera. Its actual rotation will be ignored.

BoxFace
Type: string

A BoxFace specifies the face of an axis-aligned (AA) box.

ValueDescription
"MIN_X_FACE"The minimum x-axis face.
"MAX_X_FACE"The maximum x-axis face.
"MIN_Y_FACE"The minimum y-axis face.
"MAX_Y_FACE"The maximum y-axis face.
"MIN_Z_FACE"The minimum z-axis face.
"MAX_Z_FACE"The maximum z-axis face.
"UNKNOWN_FACE"Unknown value.

Collision
Type: object

Details of a collision between avatars and entities.

Properties

Name Type Summary
type ContactEventType The contact type of the collision event.
idA Uuid The ID of one of the avatars or entities in the collision.
idB Uuid The ID of the other of the avatars or entities in the collision.
penetration Vec3 The amount of penetration between the two items.
contactPoint Vec3 The point of contact.
velocityChange Vec3 The change in relative velocity of the two items, in m/s.
CollisionContact
Type: object

A pair of points that represents part of an overlap between a Collision Pick and an object in the physics engine. Points which are further apart represent deeper overlap

Properties

Name Type Summary
pointOnPick Vec3 A point representing a penetration of the object's surface into the volume of the pick, in world space.
pointOnObject Vec3 A point representing a penetration of the pick's surface into the volume of the found object, in world space.
normalOnPick Vec3 The normalized vector pointing away from the pick, representing the direction of collision.
CollisionPickResult
Type: object

An intersection result for a Collision Pick.

Properties

Name Type Summary
intersects boolean If there was at least one valid intersection (intersectingObjects.length > 0)
intersectingObjects Array.<IntersectingObject> The collision information of each object which intersect with the CollisionRegion.
collisionRegion CollisionRegion The CollisionRegion that was used. Valid even if there was no intersection.
CollisionRegion
Type: object

A CollisionRegion defines a volume for checking collisions in the physics simulation.

Properties

Name Type Attributes Summary
shape Shape The information about the collision region's size and shape. Dimensions are in world space, but will scale with the parent if defined.
position Vec3 The position of the collision region, relative to a parent if defined.
orientation Quat The orientation of the collision region, relative to a parent if defined.
threshold float The approximate minimum penetration depth for a test object to be considered in contact with the collision region. The depth is measured in world space, but will scale with the parent if defined.
collisionGroup CollisionMask <optional>
The type of object this collision pick collides as. Objects whose collision masks overlap with the pick's collision group will be considered colliding with the pick.

Default Value: 8

parentID Uuid The ID of the parent, either an avatar or an entity.
parentJointIndex number The joint of the parent to parent to, for example, the joints on the model of an avatar. (default = 0, no joint)
joint string If "Mouse," parents the pick to the mouse. If "Avatar," parents the pick to MyAvatar's head. Otherwise, parents to the joint of the given name on MyAvatar.
Color
Type: object

A color vector. See also the Vec3 object.

Properties

Name Type Summary
red number Red component value. Integer in the range 0 - 255. Synonyms: r, x.
green number Green component value. Integer in the range 0 - 255. Synonyms: g, y.
blue number Blue component value. Integer in the range 0 - 255. Synonyms: b, z.
Example

Colors can be set in multiple ways and modified with their aliases, but still stringify in the same way

Entities.editEntity(<id>, { color: { x: 1, y: 2, z: 3 }});                 // { red: 1, green: 2, blue: 3 }
Entities.editEntity(<id>, { color: { r: 4, g: 5, b: 6 }});                 // { red: 4, green: 5, blue: 6 }
Entities.editEntity(<id>, { color: { red: 7, green: 8, blue: 9 }});        // { red: 7, green: 8, blue: 9 }
Entities.editEntity(<id>, { color: [10, 11, 12] });                        // { red: 10, green: 11, blue: 12 }
Entities.editEntity(<id>, { color: 13 });                                  // { red: 13, green: 13, blue: 13 }
var color = Entities.getEntityProperties(<id>).color;                      // { red: 13, green: 13, blue: 13 }
color.g = 14;                                                              // { red: 13, green: 14, blue: 13 }
color.blue = 15;                                                           // { red: 13, green: 14, blue: 15 }
Entities.editEntity(<id>, { color: "red"});                                // { red: 255, green: 0, blue: 0 }
Entities.editEntity(<id>, { color: "#00FF00"});                            // { red: 0, green: 255, blue: 0 }
ColorFloat
Type: object

A color vector. See also the Vec3 object.

Properties

Name Type Summary
red number Red component value. Real in the range 0 - 255. Synonyms: r, x.
green number Green component value. Real in the range 0 - 255. Synonyms: g, y.
blue number Blue component value. Real in the range 0 - 255. Synonyms: b, z.
Example

ColorFloats can be set in multiple ways and modified with their aliases, but still stringify in the same way

Entities.editEntity(<id>, { color: { x: 1, y: 2, z: 3 }});                 // { red: 1, green: 2, blue: 3 }
Entities.editEntity(<id>, { color: { r: 4, g: 5, b: 6 }});                 // { red: 4, green: 5, blue: 6 }
Entities.editEntity(<id>, { color: { red: 7, green: 8, blue: 9 }});        // { red: 7, green: 8, blue: 9 }
Entities.editEntity(<id>, { color: [10, 11, 12] });                        // { red: 10, green: 11, blue: 12 }
Entities.editEntity(<id>, { color: 13 });                                  // { red: 13, green: 13, blue: 13 }
var color = Entities.getEntityProperties(<id>).color;                      // { red: 13, green: 13, blue: 13 }
color.g = 14;                                                              // { red: 13, green: 14, blue: 13 }
color.blue = 15;                                                           // { red: 13, green: 14, blue: 15 }
Entities.editEntity(<id>, { color: "red"});                                // { red: 255, green: 0, blue: 0 }
Entities.editEntity(<id>, { color: "#00FF00"});                            // { red: 0, green: 255, blue: 0 }
ContactEventType
Type: number

The type of a collision contact event.

ValueDescription
0Start of the collision.
1Continuation of the collision.
2End of the collision.

EntityHostType
Type: string

How an entity is sent over the wire.

ValueDescription
domainDomain entities are sent over the entity server to everyone else
avatarAvatar entities are sent over the avatar entity and are associated with one avatar
localLocal entities are not sent over the wire and will only render for you, locally

GizmoType
Type: string

Controls how the Gizmo behaves and renders

ValueDescription
ringA ring gizmo.

HandState
Type: number

The pointing state of the hands is specified by the following values:

ValueDescription
0No hand is pointing.
1The left hand is pointing.
2The right hand is pointing.
4It is the index finger that is pointing.

The values for the hand states are added together to give the HandState value. For example, if the left hand's finger is pointing, the value is 1 + 4 == 5.

IntersectingObject
Type: object

Information about the Collision Pick's intersection with an object

Properties

Name Type Summary
id QUuid The ID of the object.
type number The type of the object, either Picks.INTERSECTED_ENTITY() or Picks.INTERSECTED_AVATAR()
collisionContacts Array.<CollisionContact> Pairs of points representing penetration information between the pick and the object
KeyboardModifiers
Type: number

A KeyboardModifiers value is used to specify which modifier keys on the keyboard are pressed. The value is the sum (bitwise OR) of the relevant combination of values from the following table:

KeyHexadecimal valueDecimal valueDescription
Shift0x0200000033554432 A Shift key on the keyboard is pressed.
Control0x0400000067108864 A control key on the keyboard is pressed. On Windows the "control" key is the Ctrl key; on OSX it is the Command key.
Alt0x08000000134217728 An Alt key on the keyboard is pressed.
Meta0x10000000268435456 A meta key on the keyboard is pressed. On Windows the "meta" key is the Windows key; on OSX it is the Control (Splat) key.
Keypad0x20000000536870912 A keypad button is pressed.
Group0x400000001073741824 X11 operating system only: An AltGr / Mode_switch key on the keyboard is pressed.

KeyEvent
Type: object

A keyboard key event.

Properties

Name Type Summary
key number The Qt keyboard code of the key pressed. For a list of keyboard codes, see http://doc.qt.io/qt-5/qt.html#Key-enum.
text string A string describing the key. For example, "a" for the "A" key if the Shift is not pressed, "F1" for the F1 key, "SPACE" for the space bar.
isShifted boolean true if a Shift key was pressed when the event was generated, otherwise false.
isMeta boolean true if a meta key was pressed when the event was generated, otherwise false. On Windows the "meta" key is the Windows key; on OSX it is the Control (Splat) key.
isControl boolean true if a control key was pressed when the event was generated, otherwise false. On Windows the "control" key is the Ctrl key; on OSX it is the Command key.
isAlt boolean true if an Alt key was pressed when the event was generated, otherwise false.
isKeypad boolean true if the key is on the numeric keypad, otherwise false.
isAutoRepeat boolean true if the event is a repeat for key that is being held down, otherwise false.
Example

Report the KeyEvent details for each key press.

Controller.keyPressEvent.connect(function (event) {
    print(JSON.stringify(event));
});
 
Mat4
Type: object

A 4 x 4 matrix, typically containing a scale, rotation, and translation transform. See also the Mat4 object.

Properties

Name Type Summary
r0c0 number Row 0, column 0 value.
r1c0 number Row 1, column 0 value.
r2c0 number Row 2, column 0 value.
r3c0 number Row 3, column 0 value.
r0c1 number Row 0, column 1 value.
r1c1 number Row 1, column 1 value.
r2c1 number Row 2, column 1 value.
r3c1 number Row 3, column 1 value.
r0c2 number Row 0, column 2 value.
r1c2 number Row 1, column 2 value.
r2c2 number Row 2, column 2 value.
r3c2 number Row 3, column 2 value.
r0c3 number Row 0, column 3 value.
r1c3 number Row 1, column 3 value.
r2c3 number Row 2, column 3 value.
r3c3 number Row 3, column 3 value.
Material
Type: object

A material such as may be used by a Material entity.

Properties

Name Type Summary
model string Different material models support different properties and rendering modes. Supported models are: "hifi_pbr"

Default Value: "hifi_pbr"

name string A name for the material. Supported by all material models.

Default Value: ""

emissive Color | RGBS | string The emissive color, i.e., the color that the material emits. A Color value is treated as sRGB. A RGBS value can be either RGB or sRGB. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
opacity number | string The opacity, 0.01.0. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.

Default Value: 1.0

unlit boolean | string If true, the material is not lit. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.

Default Value: false

albedo Color | RGBS | string The albedo color. A Color value is treated as sRGB. A RGBS value can be either RGB or sRGB. Set to "fallthrough" to fallthrough to the material below. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
roughness number | string The roughness, 0.01.0. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
metallic number | string The metallicness, 0.01.0. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
scattering number | string The scattering, 0.01.0. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
emissiveMap string URL of emissive texture image. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
albedoMap string URL of albedo texture image. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
opacityMap string URL of opacity texture image. Set value the same as the albedoMap value for transparency. "hifi_pbr" model only.
roughnessMap string URL of roughness texture image. Can use this or glossMap, but not both. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
glossMap string URL of gloss texture image. Can use this or roughnessMap, but not both. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
metallicMap string URL of metallic texture image. Can use this or specularMap, but not both. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
specularMap string URL of specular texture image. Can use this or metallicMap, but not both. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
normalMap string URL of normal texture image. Can use this or bumpMap, but not both. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
bumpMap string URL of bump texture image. Can use this or normalMap, but not both. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
occlusionMap string URL of occlusion texture image. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
scatteringMap string URL of scattering texture image. Only used if normalMap or bumpMap is specified. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
lightMap string URL of light map texture image. Currently not used.. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
texCoordTransform0 string The transform to use for all of the maps besides occlusionMap and lightMap. Currently unused. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
texCoordTransform1 string The transform to use for occlusionMap and lightMap. Currently unused. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
lightmapParams string Parameters for controlling how lightMap is used. Currently unused. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
materialParams string Parameters for controlling the material projection and repition. Currently unused. Set to "fallthrough" to fallthrough to the material below. "hifi_pbr" model only.
defaultFallthrough bool If true, all properties will fallthrough to the material below unless they are set. If false, they will respect the individual properties' fallthrough state. "hifi_pbr" model only.

Default Value: false

MaterialResource
Type: object

A material or set of materials such as may be used by a Material entity.

Properties

Name Type Summary
materialVersion number The version of the material. Currently not used.

Default Value: 1

materials Material | Array.<Material> The details of the material or materials.
MouseEvent
Type: object

A controller mouse movement or button event.

Properties

Name Type Summary
x number Integer x-coordinate of the event on the Interface window or HMD HUD.
y number Integer y-coordinate of the event on the Interface window or HMD HUD.
button string "LEFT", "MIDDLE", or "RIGHT" if a button press or release caused the event, otherwise "NONE".
isLeftButton boolean true if the left button was pressed when the event was generated, otherwise false.
isMiddleButton boolean true if the middle button was pressed when the event was generated, otherwise false.
isRightButton boolean true if the right button was pressed when the event was generated, otherwise false.
isShifted boolean true if the Shift key was pressed when the event was generated, otherwise false.
isMeta boolean true if the "meta" key was pressed when the event was generated, otherwise false. On Windows the "meta" key is the Windows key; on OSX it is the Control (Splat) key.
isControl boolean true if the "control" key was pressed when the event was generated, otherwise false. On Windows the "control" key is the Ctrl key; on OSX it is the Command key.
isAlt boolean true if the Alt key was pressed when the event was generated, otherwise false.
Example

Report the MouseEvent details for each mouse move.

Controller.mouseMoveEvent.connect(function (event) {
    print(JSON.stringify(event));
});
 
ParabolaPickResult
Type: object

An intersection result for a Parabola Pick.

Properties

Name Type Summary
type number The intersection type.
intersects boolean If there was a valid intersection (type != INTERSECTED_NONE)
objectID Uuid The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections.
distance number The distance to the intersection point from the origin of the parabola, not along the parabola.
parabolicDistance number The distance to the intersection point from the origin of the parabola, along the parabola.
intersection Vec3 The intersection point in world-space.
surfaceNormal Vec3 The surface normal at the intersected point. All NANs if type == INTERSECTED_HUD.
extraInfo Variant Additional intersection details when available for Model objects.
parabola PickParabola The PickParabola that was used. Valid even if there was no intersection.
PickParabola
Type: object

A PickParabola defines a parabola with a starting point, intitial velocity, and acceleration.

Properties

Name Type Summary
origin Vec3 The starting position of the PickParabola.
velocity Vec3 The starting velocity of the parabola.
acceleration Vec3 The acceleration that the parabola experiences.
PickRay
Type: object

A PickRay defines a vector with a starting point. It is used, for example, when finding entities or avatars that lie under a mouse click or intersect a laser beam.

Properties

Name Type Summary
origin Vec3 The starting position of the PickRay.
direction Vec3 The direction that the PickRay travels.
PickType
Type: number

ValueDescription
PickType.Ray
PickType.Stylus
PickType.Parabola
PickType.Collision

PointerEvent
Type: object

A PointerEvent defines a 2D or 3D mouse or similar pointer event.

Properties

Name Type Summary
type string The type of event: "Press", "DoublePress", "Release", or "Move".
id number Integer number used to identify the pointer: 0 = hardware mouse, 1 = left controller, 2 = right controller.
pos2D Vec2 The 2D position of the event on the intersected object XY plane, where applicable.
pos3D Vec3 The 3D position of the event on the intersected object, where applicable.
normal Vec3 The surface normal at the intersection point.
direction Vec3 The direction of the intersection ray.
button string The name of the button pressed: None, Primary, Secondary, or Tertiary.
isPrimaryButton boolean true if the button pressed was the primary button, otherwise undefined;
isLeftButton boolean true if the button pressed was the primary button, otherwise undefined;
isSecondaryButton boolean true if the button pressed was the secondary button, otherwise undefined;
isRightButton boolean true if the button pressed was the secondary button, otherwise undefined;
isTertiaryButton boolean true if the button pressed was the tertiary button, otherwise undefined;
isMiddleButton boolean true if the button pressed was the tertiary button, otherwise undefined;
isPrimaryHeld boolean true if the primary button is currently being pressed, otherwise false
isSecondaryHeld boolean true if the secondary button is currently being pressed, otherwise false
isTertiaryHeld boolean true if the tertiary button is currently being pressed, otherwise false
keyboardModifiers KeyboardModifiers Integer value with bits set according to which keyboard modifier keys were pressed when the event was generated.
Pose
Type: object

The pose of a joint or other item relative to the world or a parent.

Properties

Name Type Summary
translation Vec3 Translation.
rotation Quat Rotation.
velocity Vec3 Velocity in m/s.
angularVelocity Vec3 Angular velocity in rad/s.
valid boolean true if the pose is valid, otherwise false.
PrimitiveMode
Type: string

How the geometry of the entity is rendered.

ValueDescription
solidThe entity will be drawn as a solid shape.
linesThe entity will be drawn as wireframe.

PulseMode
Type: string

Pulse modes for color and alpha pulsing.

ValueDescription
noneNo pulsing.
inPulse in phase with the pulse period.
outPulse out of phase with the pulse period.

Quat
Type: object

A quaternion value. See also the Quat object.

Properties

Name Type Summary
x number Imaginary component i.
y number Imaginary component j.
z number Imaginary component k.
w number Real component.
RayPickResult
Type: object

An intersection result for a Ray Pick.

Properties

Name Type Summary
type number The intersection type.
intersects boolean If there was a valid intersection (type != INTERSECTED_NONE)
objectID Uuid The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections.
distance number The distance to the intersection point from the origin of the ray.
intersection Vec3 The intersection point in world-space.
surfaceNormal Vec3 The surface normal at the intersected point. All NANs if type == INTERSECTED_HUD.
extraInfo Variant Additional intersection details when available for Model objects.
searchRay PickRay The PickRay that was used. Valid even if there was no intersection.
RayToAvatarIntersectionResult
Type: object

Information about a ray-to-avatar intersection.

Properties

Name Type Summary
intersects boolean true if an avatar is intersected, false if it isn't.
avatarID string The ID of the avatar that is intersected.
distance number The distance from the ray origin to the intersection.
face string The name of the box face that is intersected; "UNKNOWN_FACE" if mesh was picked against.
intersection Vec3 The ray intersection point in world coordinates.
surfaceNormal Vec3 The surface normal at the intersection point.
jointIndex number The index of the joint intersected.
extraInfo SubmeshIntersection Extra information on the mesh intersected if mesh was picked against, {} if it wasn't.
Rect
Type: object

Defines a rectangular portion of an image or screen, or similar.

Properties

Name Type Summary
x number Left, x-coordinate value.
y number Top, y-coordinate value.
width number Width of the rectangle.
height number Height of the rectangle.
RenderLayer
Type: string

In which layer an entity is rendered.

ValueDescription
worldThe entity will be drawn in the world with everything else.
frontThe entity will be drawn on top of the world layer, but behind the HUD sphere.
hudThe entity will be drawn on top of other layers and the HUD sphere.

RGBS
Type: array

An RGB or SRGB color value.

IndexTypeAttributesDefaultValue
0number Red component value. Number in the range 0.01.0.
1number Green component value. Number in the range 0.01.0.
2number Blue component value. Number in the range 0.01.0.
3boolean<optional>false If true then the color is an SRGB color.

Shape
Type: object

A Shape defines a physical volume.

Properties

Name Type Summary
shapeType string The type of shape to use. Can be one of the following: "box", "sphere", "capsule-x", "capsule-y", "capsule-z", "cylinder-x", "cylinder-y", "cylinder-z"
dimensions Vec3 The size to scale the shape to.
ShapeType
Type: string

A ShapeType defines the shape used for collisions or zones.

ValueDescription
"none"No shape.
"box"A cube.
"sphere"A sphere.
"capsule-x"A capsule (cylinder with spherical ends) oriented on the x-axis.
"capsule-y"A capsule (cylinder with spherical ends) oriented on the y-axis.
"capsule-z"A capsule (cylinder with spherical ends) oriented on the z-axis.
"cylinder-x"A cylinder oriented on the x-axis.
"cylinder-y"A cylinder oriented on the y-axis.
"cylinder-z"A cylinder oriented on the z-axis.
"hull"Not used.
"compound"A compound convex hull specified in an OBJ file.
"simple-hull"A convex hull automatically generated from the model.
"simple-compound"A compound convex hull automatically generated from the model, using sub-meshes.
"static-mesh"The exact shape of the model.
"plane"A plane.
"multisphere"A convex hull generated from a set of spheres.

Size
Type: object

A 2D size value.

Properties

Name Type Summary
height number The height value.
width number The width value.
StylusPickResult
Type: object

An intersection result for a Stylus Pick.

Properties

Name Type Summary
type number The intersection type.
intersects boolean If there was a valid intersection (type != INTERSECTED_NONE)
objectID Uuid The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections.
distance number The distance to the intersection point from the origin of the ray.
intersection Vec3 The intersection point in world-space.
surfaceNormal Vec3 The surface normal at the intersected point. All NANs if type == INTERSECTED_HUD.
extraInfo Variant Additional intersection details when available for Model objects.
stylusTip StylusTip The StylusTip that was used. Valid even if there was no intersection.
StylusTip
Type: object

A StylusTip defines the tip of a stylus.

Properties

Name Type Summary
side number The hand the tip is attached to: 0 for left, 1 for right.
tipOffset Vec3 the position offset of the stylus tip.
position Vec3 The position of the stylus tip.
orientation Quat The orientation of the stylus tip.
velocity Vec3 The velocity of the stylus tip.
SubmeshIntersection
Type: object

Information about a submesh intersection point.

Properties

Name Type Summary
worldIntersectionPoint Vec3 The intersection point in world coordinates.
meshIntersectionPoint Vec3 The intersection point in model coordinates.
partIndex number The index of the intersected mesh part within the submesh.
shapeID number The index of the mesh part within the model.
subMeshIndex number The index of the intersected submesh within the model.
subMeshName string The name of the intersected submesh.
subMeshTriangleWorld Triangle The vertices of the intersected mesh part triangle in world coordinates.
subMeshNormal Vec3 The normal of the intersected mesh part triangle in model coordinates.
subMeshTriangle Triangle The vertices of the intersected mesh part triangle in model coordinates.
TouchEvent
Type: object

A display or device touch event.

Properties

Name Type Summary
x number Integer x-coordinate of the average position of the touch events.
y number Integer y-coordinate of the average position of the touch events.
isPressed boolean true if the touch point has just been pressed, otherwise false.
isMoved boolean true if the touch point has moved, otherwise false.
isStationary boolean true if the touch point has not moved, otherwise false.
isReleased boolean true if the touch point has just been released, otherwise false.
isShifted boolean true if the Shift key was pressed when the event was generated, otherwise false.
isMeta boolean true if the "meta" key was pressed when the event was generated, otherwise false. On Windows the "meta" key is the Windows key; on OSX it is the Control (Splat) key.
isControl boolean true if the "control" key was pressed when the event was generated, otherwise false. On Windows the "control" key is the Ctrl key; on OSX it is the Command key.
isAlt boolean true if the Alt key was pressed when the event was generated, otherwise false.
touchPoints number Integer number of touch points.
points Array.<Vec2> The coordinates of the touch points.
radius number The radius of a circle centered on their average position that encompasses the touch points.
isPinching boolean true if the radius has reduced since the most recent touch event with a different radius value, otherwise false.
isPinchOpening boolean true if the radius has increased since the most recent touch event with a different radius value, otherwise false.
angle number An angle calculated from the touch points, in degrees.
deltaAngle number The change in the angle value since the previous touch event, in degrees, if the number of touch points is the same, otherwise 0.0.
angles Array.<number> The angles of each touch point about the center of all the touch points, in degrees.
isRotating boolean true if the angle of the touch event has changed since the previous touch event and the number of touch points is the same, otherwise false.
rotating string "clockwise" or "counterClockwise" if the angle of the touch event has changed since the previous touch event and the number of touch points is the same, otherwise "none".
Example

Report the TouchEvent details when a touch event starts.

Controller.touchBeginEvent.connect(function (event) {
    print(JSON.stringify(event));
});
 
Triangle
Type: object

A triangle in a mesh.

Properties

Name Type Summary
v0 Vec3 The position of vertex 0 in the triangle.
v1 Vec3 The position of vertex 1 in the triangle.
v2 Vec3 The position of vertex 2 in the triangle.
Vec2
Type: object

A 2-dimensional vector.

Properties

Name Type Summary
x number X-coordinate of the vector. Synonyms: u.
y number Y-coordinate of the vector. Synonyms: v.
Example

Vec2s can be set in multiple ways and modified with their aliases, but still stringify in the same way

Entities.editEntity(<id>, { materialMappingPos: { x: 0.1, y: 0.2 }});          // { x: 0.1, y: 0.2 }
Entities.editEntity(<id>, { materialMappingPos: { u: 0.3, v: 0.4 }});          // { x: 0.3, y: 0.4 }
Entities.editEntity(<id>, { materialMappingPos: [0.5, 0.6] });                 // { x: 0.5, y: 0.6 }
Entities.editEntity(<id>, { materialMappingPos: 0.7 });                        // { x: 0.7, y: 0.7 }
var color = Entities.getEntityProperties(<id>).materialMappingPos;             // { x: 0.7, y: 0.7 }
color.v = 0.8;                                                                 // { x: 0.7, y: 0.8 }
Vec3
Type: object

A 3-dimensional vector. See also the Vec3 object.

Properties

Name Type Summary
x number X-coordinate of the vector. Synonyms: r, red.
y number Y-coordinate of the vector. Synonyms: g, green.
z number Z-coordinate of the vector. Synonyms: b, blue.
Example

Vec3s can be set in multiple ways and modified with their aliases, but still stringify in the same way

Entities.editEntity(<id>, { position: { x: 1, y: 2, z: 3 }});                 // { x: 1, y: 2, z: 3 }
Entities.editEntity(<id>, { position: { r: 4, g: 5, b: 6 }});                 // { x: 4, y: 5, z: 6 }
Entities.editEntity(<id>, { position: { red: 7, green: 8, blue: 9 }});        // { x: 7, y: 8, z: 9 }
Entities.editEntity(<id>, { position: [10, 11, 12] });                        // { x: 10, y: 11, z: 12 }
Entities.editEntity(<id>, { position: 13 });                                  // { x: 13, y: 13, z: 13 }
var position = Entities.getEntityProperties(<id>).position;                   // { x: 13, y: 13, z: 13 }
position.g = 14;                                                              // { x: 13, y: 14, z: 13 }
position.blue = 15;                                                           // { x: 13, y: 14, z: 15 }
Entities.editEntity(<id>, { position: "red"});                                // { x: 255, y: 0, z: 0 }
Entities.editEntity(<id>, { position: "#00FF00"});                            // { x: 0, y: 255, z: 0 }
Vec4
Type: object

A 4-dimensional vector.

Properties

Name Type Summary
x number X-coordinate of the vector.
y number Y-coordinate of the vector.
z number Z-coordinate of the vector.
w number W-coordinate of the vector.
ViewFrustum
Type: object

A ViewFrustum has a "keyhole" shape: a regular frustum for stuff that is visible plus a central sphere for stuff that is nearby (for physics simulation).

Properties

Name Type Summary
position Vec3 The location of the frustum's apex.
orientation Quat The direction that the frustum is looking at.
centerRadius number Center radius of the keyhole in meters.
fieldOfView number Horizontal field of view in degrees.
aspectRatio number Aspect ratio of the frustum.
projection Mat4 The projection matrix for the view defined by the frustum.
WebInputMode
Type: string

Controls how the web surface processed PointerEvents

ValueDescription
touchEvents are processed as touch events.
mouseEvents are processed as mouse events.

WheelEvent
Type: object

A mouse wheel event.

Properties

Name Type Summary
x number Integer x-coordinate of the event on the Interface window or HMD HUD.
y number Integer y-coordinate of the event on the Interface window or HMD HUD.
delta number Integer number indicating the direction and speed to scroll: positive numbers to scroll up, and negative numers to scroll down.
orientation string The orientation of the wheel: "VERTICAL" for a typical mouse; "HORIZONTAL" for a "horizontal" wheel.
isLeftButton boolean true if the left button was pressed when the event was generated, otherwise false.
isMiddleButton boolean true if the middle button was pressed when the event was generated, otherwise false.
isRightButton boolean true if the right button was pressed when the event was generated, otherwise false.
isShifted boolean true if the Shift key was pressed when the event was generated, otherwise false.
isMeta boolean true if the "meta" key was pressed when the event was generated, otherwise false. On Windows the "meta" key is the Windows key; on OSX it is the Control (Splat) key.
isControl boolean true if the "control" key was pressed when the event was generated, otherwise false. On Windows the "control" key is the Ctrl key; on OSX it is the Command key.
isAlt boolean true if the Alt key was pressed when the event was generated, otherwise false.
Example

Report the WheelEvent details for each wheel rotation.

Controller.wheelEvent.connect(function (event) {
    print(JSON.stringify(event));
});