diff --git a/app/content/system/hands/hands.tscn b/app/content/system/hands/hands.tscn
index b3ecf48..517a26b 100644
--- a/app/content/system/hands/hands.tscn
+++ b/app/content/system/hands/hands.tscn
@@ -51,7 +51,7 @@ transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0,
shape = SubResource("CapsuleShape3D_dopke")
[node name="ThumbTip" type="BoneAttachment3D" parent="XRHandLeft"]
-transform = Transform3D(0.937246, 0.0284254, -0.347508, 0.0184905, 0.991216, 0.130949, 0.348178, -0.129157, 0.928487, 0.0498668, 0.0560917, -0.112777)
+transform = Transform3D(0.937246, 0.0284254, -0.347508, 0.0184905, 0.991216, 0.130949, 0.348178, -0.129157, 0.928488, 0.0498668, 0.0560917, -0.112777)
bone_name = "Thumb_Tip_L"
bone_idx = 4
use_external_skeleton = true
@@ -61,7 +61,7 @@ external_skeleton = NodePath("../left_hand/Armature_001/Skeleton3D")
gizmo_extents = 0.02
[node name="MiddleTip" type="BoneAttachment3D" parent="XRHandLeft"]
-transform = Transform3D(0.0812012, -0.650531, -0.755125, 0.996576, 0.064817, 0.051326, 0.0155558, -0.756708, 0.653567, 0.032112, 0.00654224, -0.171612)
+transform = Transform3D(0.0812012, -0.650531, -0.755125, 0.996577, 0.064817, 0.051326, 0.0155558, -0.756708, 0.653568, 0.032112, 0.00654224, -0.171612)
bone_name = "Middle_Tip_L"
bone_idx = 14
use_external_skeleton = true
@@ -112,7 +112,7 @@ transform = Transform3D(1, 0, 4.7579e-13, 0, 1, 0, -1.34149e-12, 1.77636e-15, 1,
material_override = SubResource("StandardMaterial3D_n27ki")
[node name="IndexTip" type="BoneAttachment3D" parent="XRHandRight"]
-transform = Transform3D(0.19221, 0.669966, 0.717078, -0.091543, -0.715277, 0.69282, 0.977075, -0.19881, -0.0761527, -0.0345978, -0.164767, -0.0355401)
+transform = Transform3D(0.19221, 0.669966, 0.717079, -0.091543, -0.715277, 0.69282, 0.977075, -0.19881, -0.0761527, -0.0345977, -0.164767, -0.0355401)
bone_name = "Index_Tip_R"
bone_idx = 9
use_external_skeleton = true
@@ -142,7 +142,7 @@ external_skeleton = NodePath("../right_hand/Armature/Skeleton3D")
gizmo_extents = 0.02
[node name="MiddleTip" type="BoneAttachment3D" parent="XRHandRight"]
-transform = Transform3D(0.0812011, 0.650531, 0.755126, -0.0155557, -0.756708, 0.653568, 0.996576, -0.0648169, -0.0513262, -0.032112, -0.171612, -0.00654216)
+transform = Transform3D(0.0812011, 0.650531, 0.755126, -0.0155557, -0.756709, 0.653568, 0.996576, -0.0648169, -0.0513262, -0.032112, -0.171612, -0.00654216)
bone_name = "Middle_Tip_R"
bone_idx = 14
use_external_skeleton = true
diff --git a/app/content/system/house/mini/miniature.gd b/app/content/system/house/mini/miniature.gd
index 77eedba..8079754 100644
--- a/app/content/system/house/mini/miniature.gd
+++ b/app/content/system/house/mini/miniature.gd
@@ -8,8 +8,10 @@ const temperature_gradient = preload ("./temp_gradient.tres")
@onready var body = $Body
@onready var small_node = $Body/Small
@onready var model = $Body/Small/Model
+@onready var player = $Body/Small/Player
@onready var collision_shape = $Body/CollisionShape3D
@onready var entity_select = $Body/EntitySelect
+@onready var main = $"/root/Main"
enum HeatmapType {
NONE = 0,
@@ -71,6 +73,7 @@ func _ready():
# Update Size
R.effect(func(_arg):
collision_shape.disabled=small.value == false
+ player.visible=small.value
var tween:=create_tween()
tween.set_parallel(true)
@@ -131,6 +134,12 @@ func _ready():
wall_material.set_shader_parameter("alpha", opacity.value / 100.0)
)
+func _process(delta):
+ var cam_pos = main.camera.global_position
+ cam_pos.y += 0.1
+ player.mesh.height = cam_pos.y
+ player.position = Vector3(cam_pos.x, cam_pos.y / 2, cam_pos.z)
+
const SensorEntity = preload ("res://content/entities/sensor/sensor.gd")
func get_base_scale() -> Vector2:
diff --git a/app/content/system/house/mini/miniature.tscn b/app/content/system/house/mini/miniature.tscn
index f89f869..b59783c 100644
--- a/app/content/system/house/mini/miniature.tscn
+++ b/app/content/system/house/mini/miniature.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=5 format=3 uid="uid://ds60i5n211hi3"]
+[gd_scene load_steps=7 format=3 uid="uid://ds60i5n211hi3"]
[ext_resource type="Script" path="res://content/system/house/mini/miniature.gd" id="1_b53yn"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="2_x7oed"]
@@ -6,6 +6,15 @@
[sub_resource type="BoxShape3D" id="BoxShape3D_bckw3"]
+[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_npsgb"]
+resource_local_to_scene = true
+transparency = 1
+albedo_color = Color(0.404, 0.22, 0.627, 0.5)
+
+[sub_resource type="CapsuleMesh" id="CapsuleMesh_f3avi"]
+radius = 0.3
+height = 1.75
+
[node name="Miniature" type="Node3D"]
script = ExtResource("1_b53yn")
@@ -25,6 +34,10 @@ restricted = true
[node name="Dots" type="Node3D" parent="Body/Small"]
+[node name="Player" type="MeshInstance3D" parent="Body/Small"]
+material_override = SubResource("StandardMaterial3D_npsgb")
+mesh = SubResource("CapsuleMesh_f3avi")
+
[node name="EntitySelect" type="Marker3D" parent="Body"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.757576, 0)
gizmo_extents = 0.1
diff --git a/app/content/ui/components/button/button.tscn b/app/content/ui/components/button/button.tscn
index 0570053..f18baf5 100644
--- a/app/content/ui/components/button/button.tscn
+++ b/app/content/ui/components/button/button.tscn
@@ -4,7 +4,7 @@
[ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="2_db5by"]
[ext_resource type="Script" path="res://content/ui/components/panel/panel.gd" id="3_skm86"]
-[sub_resource type="ShaderMaterial" id="ShaderMaterial_tulmb"]
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_n8om1"]
resource_local_to_scene = true
render_priority = 10
shader = ExtResource("2_db5by")
@@ -19,7 +19,7 @@ shader_parameter/corner_radius = 0.2
shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
-[sub_resource type="QuadMesh" id="QuadMesh_hvywi"]
+[sub_resource type="QuadMesh" id="QuadMesh_dxm1i"]
size = Vector2(0.04, 0.04)
[sub_resource type="BoxShape3D" id="BoxShape3D_xwopm"]
@@ -42,8 +42,8 @@ collision_mask = 0
[node name="Panel3D" type="MeshInstance3D" parent="Body"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.005)
-material_override = SubResource("ShaderMaterial_tulmb")
-mesh = SubResource("QuadMesh_hvywi")
+material_override = SubResource("ShaderMaterial_n8om1")
+mesh = SubResource("QuadMesh_dxm1i")
skeleton = NodePath("../..")
script = ExtResource("3_skm86")
size = Vector2(0.04, 0.04)
diff --git a/app/content/ui/components/input/input.tscn b/app/content/ui/components/input/input.tscn
index e175269..8ecf22b 100644
--- a/app/content/ui/components/input/input.tscn
+++ b/app/content/ui/components/input/input.tscn
@@ -5,7 +5,7 @@
[ext_resource type="FontVariation" uid="uid://d2ofyimg5s65q" path="res://assets/fonts/ui_font_500.tres" id="3_ij5fh"]
[ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="3_nl02b"]
-[sub_resource type="ShaderMaterial" id="ShaderMaterial_md6kx"]
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_a00dk"]
resource_local_to_scene = true
render_priority = 10
shader = ExtResource("3_nl02b")
@@ -20,7 +20,7 @@ shader_parameter/corner_radius = 0.2
shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
-[sub_resource type="QuadMesh" id="QuadMesh_btoa3"]
+[sub_resource type="QuadMesh" id="QuadMesh_har6y"]
size = Vector2(0.15, 0.03)
[sub_resource type="BoxShape3D" id="BoxShape3D_x4yp8"]
@@ -83,8 +83,8 @@ collision_mask = 6
[node name="Panel3D" type="MeshInstance3D" parent="Body"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.005)
-material_override = SubResource("ShaderMaterial_md6kx")
-mesh = SubResource("QuadMesh_btoa3")
+material_override = SubResource("ShaderMaterial_a00dk")
+mesh = SubResource("QuadMesh_har6y")
script = ExtResource("3_3bvrj")
size = Vector2(0.15, 0.03)
diff --git a/app/content/ui/components/panel/panel.tscn b/app/content/ui/components/panel/panel.tscn
index ecf1008..b5cf52a 100644
--- a/app/content/ui/components/panel/panel.tscn
+++ b/app/content/ui/components/panel/panel.tscn
@@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://content/ui/components/panel/panel.gd" id="1_2jq4a"]
[ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="1_mpdsy"]
-[sub_resource type="ShaderMaterial" id="ShaderMaterial_jbi6t"]
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_2wxf7"]
resource_local_to_scene = true
render_priority = 10
shader = ExtResource("1_mpdsy")
@@ -18,12 +18,12 @@ shader_parameter/corner_radius = 0.04
shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
-[sub_resource type="QuadMesh" id="QuadMesh_vcnnc"]
+[sub_resource type="QuadMesh" id="QuadMesh_r8ntw"]
size = Vector2(0.04, 0.04)
[node name="Panel" type="MeshInstance3D"]
-material_override = SubResource("ShaderMaterial_jbi6t")
-mesh = SubResource("QuadMesh_vcnnc")
+material_override = SubResource("ShaderMaterial_2wxf7")
+mesh = SubResource("QuadMesh_r8ntw")
script = ExtResource("1_2jq4a")
size = Vector2(0.04, 0.04)
corner_radius = null
diff --git a/docs/.vitepress/data/sidebar.ts b/docs/.vitepress/data/sidebar.ts
index c468167..a61fcc2 100644
--- a/docs/.vitepress/data/sidebar.ts
+++ b/docs/.vitepress/data/sidebar.ts
@@ -70,6 +70,14 @@ export default {
text: 'Event System',
link: '/development/event-system'
},
+ {
+ text: 'Interaction System',
+ link: '/development/interaction'
+ },
+ {
+ text: 'Force Feedback',
+ link: '/development/force-feedback'
+ },
{
text: 'Node Functions',
link: '/development/functions'
diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css
index 5b7630c..ee068f4 100644
--- a/docs/.vitepress/theme/style.css
+++ b/docs/.vitepress/theme/style.css
@@ -141,4 +141,8 @@
iframe {
aspect-ratio: 16 / 9;
width: 100%;
+}
+
+img {
+ max-height: 400px;
}
\ No newline at end of file
diff --git a/docs/development/event-system.md b/docs/development/event-system.md
index 0a7ee6f..b7c1f71 100644
--- a/docs/development/event-system.md
+++ b/docs/development/event-system.md
@@ -2,6 +2,10 @@
While Godot ships with it's own event system, we have implemented our own event system to make it more similar to the event system in Browsers and to streamline event handling in the app.
+There are two types of base events, [Events](/reference/Event.html) which get directly emitted by the [EventSystem](/reference/lib--globals--event_system.html) and [BubbleEvents](/reference/EventBubble.html) which first walk through the scene tree starting at the [target](/reference/EventBubble.html#prop-target) node until the root node is reached and then get emitted by the [EventSystem](/reference/lib--globals--event_system.html). This can be seen in the diagram below.
+
+![Event System](/img/event-walking.svg)
+
Full reference can be found in the [Event System](/reference/lib--globals--event_system.html) documentation.
## Focus handling
diff --git a/docs/development/force-feedback.md b/docs/development/force-feedback.md
new file mode 100644
index 0000000..07ae8d0
--- /dev/null
+++ b/docs/development/force-feedback.md
@@ -0,0 +1,17 @@
+# Force Feedback
+
+In order to make interactions with hands feel more natural and immersive, multiple techniques can be applied to provide a sensor of haptic feedback while not directly simulating physical touch.
+
+The first technique is to overlay a virtual copy of the physical hand as hand tracking still has a bit of latency and jitter. The virtual hand reduces confusion when interacting with objects as the user can reference the virtual hand to compensate for these issues.
+
+The second technique is to allow the virtual hand to collide with virtual objects in the scene. This is done to trick the brain into thinking that the hand is touching something. The brain perceives the virtual hand as its own hand and thus the collision with virtual objects feels like touching a real object.
+
+## Implementation
+
+There are several techniques for making the virtual hand collide with virtual objects. The one we chose to implement is to use a free floating spherical collision shape. Each physics frame a strong force is applied to the collision shape into the direction of the tip of the finger.
+
+![Force Feedback](/img/force-feedback.svg)
+
+The virtual hand is moved so that the tip of the finger is at the position of the collision shape.
+
+In case that the distance between the collision shape and the physical hand becomes too large, the collision shape is teleported back to the tip of the finger. That way we make sure that your virtual hand never gets stuck in the scene.
diff --git a/docs/development/functions.md b/docs/development/functions.md
index c552901..f54edcd 100644
--- a/docs/development/functions.md
+++ b/docs/development/functions.md
@@ -12,9 +12,4 @@ Useful for connection to events that happen on other nodes.
### Movable
Adds the ability to move the node using the controller or hands.
-The parent needs to be a `StaticBody3D`.
-
-### Occludable
-
-Hides the node when it is occluded by another node like walls.
-
+The parent needs to be a `StaticBody3D`.
\ No newline at end of file
diff --git a/docs/development/interaction.md b/docs/development/interaction.md
new file mode 100644
index 0000000..04c3992
--- /dev/null
+++ b/docs/development/interaction.md
@@ -0,0 +1,31 @@
+# Interaction System
+
+The app currently supports 3 different types of interaction techniques:
+
+- **Using controllers with raycast**
+- **Using hands with raycast**
+- **Using hands with direct touch**
+
+The interaction system, like the [Event System](/development/event-system.html), is heavily inspired by the interaction system in browsers. Interaction Events can be broken down into 2 categories, [Pointer Events](/reference/EventPointer.html) initiated by a raycast and [Touch Events](/reference/EventTouch.html) initiated by a collision shape in the tip of the fingers. Pointer Events](/reference/EventPointer.html)
+
+## Pointer Events
+
+When pressing the trigger button on the back of a controller or doing a pinch gesture with thumb and index finer an `on_press_down` event is triggered containing a [EventPointer](/reference/EventPointer.html) which holds information about the ray and initiator of the event. If the trigger button or pinch gesture is released before 400ms pass, an `on_press_up` and `on_click` event is triggered. If the trigger button or pinch gesture is held for more than 400ms, an `on_press_move` event is triggered each physics process and when releasing, only the `on_press_up` event is triggered.
+
+![Event Order](/img/event-order.svg)
+
+The same logic can be applied to **grab** (`on_grab_down`, `on_grab_move` and `on_grab_up`) events, here the event family is triggered by the grip button on the controller or by doing a pinch gesture with thumb and middle finger.
+
+### Pinch Gesture
+
+The pinch gesture is implemented by checking the distance between the thumb and each finger and if the distance is smaller than 3cm, the pinch gesture is detected.
+
+## Touch Events
+
+Touch events are triggered when the collision shape present in the tip of the fingers enters another collision area. The `on_touch_enter` event is triggered when the collision shape enters the area, the `on_touch_move` event is triggered each physics process while the collision shape is inside the area and the `on_touch_leave` event is triggered when the collision shape leaves the area.
+
+![Touch Event Order](/img/touch-event.svg)
+
+## Hover (ray) Events
+
+Each frame the ray is casted from the controller or hand and in case that the ray collides with a collision node, the `on_ray_enter` event is triggered. If the ray was already colliding with another object the previous frame, the `on_ray_leave` event is triggered on the old node.
\ No newline at end of file
diff --git a/docs/img/event-order.svg b/docs/img/event-order.svg
new file mode 100644
index 0000000..1a54e4f
--- /dev/null
+++ b/docs/img/event-order.svg
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/docs/img/event-walking.svg b/docs/img/event-walking.svg
new file mode 100644
index 0000000..6747172
--- /dev/null
+++ b/docs/img/event-walking.svg
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/docs/img/force-feedback.svg b/docs/img/force-feedback.svg
new file mode 100644
index 0000000..1f94b83
--- /dev/null
+++ b/docs/img/force-feedback.svg
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/docs/img/touch-event.svg b/docs/img/touch-event.svg
new file mode 100644
index 0000000..960f138
--- /dev/null
+++ b/docs/img/touch-event.svg
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/docs/reference/EntityFactory.md b/docs/reference/EntityFactory.md
index 60f1346..5a227d8 100644
--- a/docs/reference/EntityFactory.md
+++ b/docs/reference/EntityFactory.md
@@ -9,9 +9,10 @@ This class is used to create entities based on their type
## Methods
-| Returns | Name |
-| ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
-| [Variant](https://docs.godotengine.org/de/4.x/classes/class_variant.html) | [create_entity](#create-entity) ( id: [String](https://docs.godotengine.org/de/4.x/classes/class_string.html) ) |
+| Returns | Name |
+| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| [Variant](https://docs.godotengine.org/de/4.x/classes/class_variant.html) | [create_entity](#create-entity) ( id: [String](https://docs.godotengine.org/de/4.x/classes/class_string.html), type: [Variant](https://docs.godotengine.org/de/4.x/classes/class_variant.html) ) |
+| [String](https://docs.godotengine.org/de/4.x/classes/class_string.html) | [get_entity_icon](#get-entity-icon) ( type: [String](https://docs.godotengine.org/de/4.x/classes/class_string.html) ) |
@@ -47,10 +48,18 @@ No description provided yet.
No description provided yet.
+### LineGraphEntity = `