Skip to content
Snippets Groups Projects
Commit 68e743c9 authored by Florent Berthaut's avatar Florent Berthaut
Browse files

Merge branch 'godot4' of https://gitlab.univ-lille.fr/ivmi/ivmi-builder into godot4

parents a52fd1ed 794ae788
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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)
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment