Scenario Objects umajinvr

There are many objects that can be added to a scene e.g. 3d models, trigger areas, and audio. See below for full documentation of each object.

All objects have some shared properties.

Table of Contents

audio

Play an audio file.

{ "id": "bg_noise", "type": "audio", "path": "audio/bg-music.wav", "volume": 0.1, "looping": true }

image

Display an image in the scene.

{ "type": "image", "path": "images/instructions-01.jpg", "position": [-2, 1, 3], "rotation": [0, 75, 0], "slice": [40, 20, 40, 30], "height": 1.2 }

model

Display a 3D model in the scene.

{ "id": "city", "type": "model", "path": "city/model.um", "position": [0, -0.5, 15], "rotation": [0, 90, 0], "scale": 0.12 },

model_character

Display a 3D character model in the scene.

{ "id": "my_character", "type": "model_character", "path": "characters/zane", "position": [-1, -0.27, -1], "rotation": [-90, -90, 0] },

module

Load in a seperate JSON file so complex scenes can be split across files, or so specific parts can be reused in multiple scenarios.

{ "id": "street_side", "type": "module", "path": "city/static_street.json", "position": [0, 0, 0], "rotation": [0, 0, 0] }

rigid

An object that is mapped to a PhaseSpace rigid of rigid_id. The objects position and orientation is updated to match the physical prop. A model object can then be attached to the rigid object

{ "id": "box_rigid", "type": "rigid", "rigid_id": "10" }

state

Very minimal object that has no visuals but can be setup to respond to on_activate or on_deactivate.

{ "id": "state_wait_for_flowers", "type": "state", "on_activate": [{ "type": "play_animation", "ref": "my_character", "animation": "sit_down" }] }

text

Show a block of text. The width must be set so the text can be rendered and wrapped correctly.

{ "id": "help_text_1", "type": "text", "position": [0, 2, 0], "rotation": [0, 35, 0], "width": 1.5, "text": "Hello Text!\nThis is another line.", "font_size": 120, "align": "center", "color": "#FF0000" }

particle

Create a particle visual effect using an image file.

{ { "id": "particle1", "type": "particle", "path": "particle1.png", "position": [-0.42, 0.75, 1.56], "rotation": [0, 0, 0], "scale": 0.2, "effect" : "none", "quantity" : 200, "init_min_alpha" : 30, "init_max_alpha" : 50, "init_min_life" : 60, "init_max_life" : 120, "init_min_py_vel" : 0.9, "init_max_py_vel" : 1.1, "init_min_px_vel" : -0.5, "init_max_px_vel" : 0.5, "gravity" : -0.01, "particle_rate" : 0.5, "look_at": "@player_head", } }

trigger_speech

Create a trigger that triggers when it detects one on the phrases being spoken.

{ "id": "trigger_ask", "type": "trigger_speech", "public": true, "phrases": [ "What's your hurry?", "Why were you going so fast?" ], "on_speech": [ { "type": "deactivate" } ] }

trigger_ui_button

Add a button to the tablet prop, and to the viewer HUD. Pressing the button when cause the on_press event to trigger.

{ "type": "trigger_ui_button", "text": "Press Me!", "on_press": [ {"type":"comment", "message":"Button has been pressed!"}, {"type":"deactivate"} ] }

trigger_velocity

Tracks the ref scene object's movement, and fires on_over_threshold when its velocity goes over threshold, and on_under__threshold when it goes under.

{ "type": "trigger_velocity", "ref": "bouquet", "threshold": 1.0, "on_over_threshold": [ {"type":"comment", "message":"Moving too fast!"} ], "on_under_threshold": [ {"type":"comment", "message":"Not moving fast enough!"} ] }

trigger_volume_hand, trigger_volume_hand_left, trigger_volume_hand_right

Create a trigger sphere that triggers when your hand enters or leaves the radius. You can make it only trigger with a specific hand by using trigger_volume_hand_left, trigger_volume_hand_right, or either hand by using trigger_volume_hand.

{ "id": "trigger_grab_bouquet", "type": "trigger_volume_hand", "public": true, "position": [1, 2, -1], "radius": 0.5 }

trigger_volume_head

Create a trigger cylinder that triggers when your head enters or leaves the radius.

{ "id": "trigger_stand_close", "type": "trigger_volume_head", "public": true, "position": [0, 0, 0], "radius": 1.2 }

trigger_volume_object

Create a trigger sphere that triggers when a specified object enters or leaves the radius.

{ "id": "trigger_flower_pot", "type": "trigger_volume_object", "public": true, "ref": "bouquet", "position": [0, 1.2, 0], "rotation": [0, 45, 0], "radius": 0.1, "match_rotation": true, "rotation_threshold": 0.01, "on_enter": [{"type": "attach", "ref": "bouquet", "target": "trigger_flower_pot"}] }