diff --git a/README.md b/README.md index 81a144b4509c53f00ac09f956f5bb6a5aae33c00..d30bf57fc9e616335bcc017876afeb08ad24fc9d 100644 --- a/README.md +++ b/README.md @@ -22,57 +22,25 @@ install GdScreenVr --- -## Example instruments +## A first example ---- - -## Connecting to PureData - -### OpenSoundControl and live editing - -### Release with LibPd - ---- +### Scene creation -## Rendering - -### Mono -### SteamVR headsets - -1. Install the OpenXR addon from the AssetLib (godot-openxr) +### Patch creation -### Android based headset -1. Install the OpenXR addon from the AssetLib (godot-openxr) -2. Add an Android export (Project->Export) and choose OpenXR for the XR Mode - in XR Features -3. Install an Android compiling model (Project) -4. In the IvmiScene node, select **Open XR Hmd** in XR Mode -5. Plug-in the headset and authorize access to the headset -6. Start the application on the headset by clicking on the android logo - at the top right of the Godot window +### Design process -If you are using the **Osc** Pd Mode, make sure the headset is on the same -network as your computer. - -### Stereoscopic displays - -### AR on Mobile devices - -### WebXR - ---- - -## Networking +### Release --- ## Creating your instrument -### IVMI-scene +### Godot IvmiScene The root of your scene must extend from the IvmiScene class/script. Attach a script to it and start it with : @@ -108,7 +76,7 @@ IvmiScene provides a number of settings to help you design immersive instruments * ... -### IVMI-node +### Godot IvmiNode IVMI-node are the main components of any IVMI instruments. IVMI-node contains IVMI-properties. By inheriting IVMI-node.gd you are able to define a specific behavior/feedback for each IVMI-property change that occur within the node. You can for example write a code that change the size of the node's mesh when the node is selected. @@ -124,27 +92,36 @@ func _ready(): # Add custom properties with array of values _add_property("selected", [0]) + + # Properties are sent by default, optionnally deactivate sending + _properties["selected"].set_listen(false) + +func process(delta) : + # Call default IvmiNode processing, required for updates + super._process(delta) + func _set_property(prop, vals) : # Call default properties handling super._set_property(prop, vals) # Handle custom properties - if prop == "selected": - if vals[0]: - get_node("MeshInstance").scale.x = 3 + match prop: + "selected": + get_node("MeshInstance").scale.x = 2.0*vals[0]+1.0 ``` -### IVMI-property +### IvmiProperty -IVMI-property are the messages sent to Pure Data. -The properties are composed of : -- A name : a simple string -- Values : An array of values +IvmiProperties are composed of : +- A name : A string +- Values : An array of values (floats, ints, bools, strings, ...) -Each property change is send to Pure Data along with the name from which the property originate. +Each property change is sent to Pure Data, +when their _listen variable is set to true, +which is the case by default. ``` python # Add a new property @@ -155,9 +132,43 @@ radius = _get_property("radius")[0] set_property("radius",[0.5]) ``` +### PureData ivmi_scene + + +### PureData ivmi_node + + +### PureData ivmi_property + +--- + +## Rendering + +### Mono + +### SteamVR headsets + +TODO + +### Android based headset + +TODO + +### Stereoscopic displays + + +--- + +## Multi-user Instruments + +--- + + +## Using 3D Interaction Techniques -### Using 3D Interaction Techniques +--- +## Using PureData abstractions diff --git a/core/IvmiNode.gd b/core/IvmiNode.gd index 5061ba916d481e4aa2c59d202131551aab66af41..9a67aa06523ca8c09aa07fe86f47cde90a6b8624 100644 --- a/core/IvmiNode.gd +++ b/core/IvmiNode.gd @@ -17,17 +17,17 @@ func _ready(): add_to_group("ivmi_nodes") #add default properties - _add_property("position", [position.x, position.y, position.z]) - _add_property("global_position", [position.x, position.y, position.z]) - _add_property("scale", [scale.x, scale.y, scale.z]) - _add_property("selected", [0]) - _add_property("triggered", [0]) - _add_property("transparency", [0]) - _add_property("color_hsv", [0,0,0]) - _add_property("rotation", [rotation_degrees.x,rotation_degrees.y,rotation_degrees.z]) + _add_property("position", [position.x, position.y, position.z], false) + _add_property("global_position", [position.x, position.y, position.z], false) + _add_property("scale", [scale.x, scale.y, scale.z], false) + _add_property("selected", [0], false) + _add_property("triggered", [0], false) + _add_property("transparency", [0], false) + _add_property("color_hsv", [0,0,0], false) + _add_property("rotation", [rotation_degrees.x,rotation_degrees.y,rotation_degrees.z], false) var quat = transform.basis.get_rotation_quaternion() - _add_property("quaternion",[quat.w,quat.x,quat.y,quat.z]) - _add_property("distance_to_camera", [0]) + _add_property("quaternion",[quat.w,quat.x,quat.y,quat.z], false) + _add_property("distance_to_camera", [0], false) #retrieve full name within scene _full_name = String(get_path()).lstrip("/root/") @@ -45,9 +45,10 @@ func declare() : func _allow_send_data(value : bool): _send_data = value -func _add_property(prop, values) -> void : +func _add_property(prop, values, listen=true) -> void : _properties[prop] = IvmiProperty.new() _properties[prop].init_values(values) + _properties[prop].set_listen(listen) _properties[prop].set_ivmi_node(self) _properties[prop].set_name(prop) diff --git a/core/IvmiProperty.gd b/core/IvmiProperty.gd index 772533dda109b71779dae6522e1ca01101937237..19d26bd972241e9dff662556426c21e2eb50a746 100644 --- a/core/IvmiProperty.gd +++ b/core/IvmiProperty.gd @@ -6,7 +6,7 @@ var _name var _values = [] var _type = "" var _changed = false -var _listen = false +var _listen = true var _tags = "" var _immediate = false var _ivmi_node = null