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

Fixed tunnel size and intersection

parent da5afd48
No related branches found
No related tags found
No related merge requests found
...@@ -88,8 +88,8 @@ func _physics_process(delta): ...@@ -88,8 +88,8 @@ func _physics_process(delta):
var col = r.get_parent() var col = r.get_parent()
if col.is_in_group("ivmi_nodes"): if col.is_in_group("ivmi_nodes"):
#if collision, compute position ratio #if collision, compute position ratio
var col_pos = to_local(col.global_transform.origin) var col_pos = to_local(col.global_position)
var ratio = col_pos.x+0.5 var ratio = clamp(col_pos.x+0.5,0,1)
#set all active parameters #set all active parameters
for param in tunnel_preset_array[_preset_index]: for param in tunnel_preset_array[_preset_index]:
var value var value
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
[sub_resource type="BoxShape3D" id="1"] [sub_resource type="BoxShape3D" id="1"]
resource_local_to_scene = true resource_local_to_scene = true
margin = 0.001 margin = 0.0
size = Vector3(1, 0.1, 0.1) size = Vector3(1, 0.1, 0.1)
[node name="Tunnel" type="Node3D"] [node name="Tunnel" type="Node3D"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
script = ExtResource("1") script = ExtResource("1")
[node name="Slices" type="Node3D" parent="."] [node name="Slices" type="Node3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
[node name="Area3D" type="Area3D" parent="."] [node name="Area3D" type="Area3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.01, 0, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("1") shape = SubResource("1")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment