fix collision system and keyboard caps

This commit is contained in:
Nitwel 2023-11-28 15:14:21 +01:00
parent 38774b6195
commit f2dbcf072d
15 changed files with 83 additions and 31 deletions

View File

@ -91,6 +91,7 @@ bottom_radius = 0.006
height = 0.004
[node name="Light" type="StaticBody3D" groups=["entity"]]
collision_mask = 0
script = ExtResource("1_ykxy3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
@ -127,6 +128,7 @@ libraries = {
[node name="Rod" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.0903599)
collision_mask = 0
[node name="MeshInstance3D" type="MeshInstance3D" parent="Rod"]
mesh = SubResource("CylinderMesh_j3pn3")

View File

@ -8,6 +8,7 @@
size = Vector3(0.23, 0.142768, 0.01)
[node name="MediaPlayer" type="StaticBody3D" groups=["entity"]]
collision_mask = 0
script = ExtResource("1_ame17")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
@ -16,19 +17,16 @@ shape = SubResource("BoxShape3D_vi3eg")
[node name="Previous" parent="." instance=ExtResource("1_8opk3")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -0.07, 0, 0)
focusable = true
label = "skip_previous"
icon = true
[node name="Play" parent="." instance=ExtResource("1_8opk3")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -4.65661e-08, 0, 0)
focusable = true
label = "pause"
icon = true
[node name="Next" parent="." instance=ExtResource("1_8opk3")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.07, 0, 0)
focusable = true
label = "skip_next"
icon = true

View File

@ -7,6 +7,7 @@
radius = 0.1
[node name="Sensor" type="StaticBody3D" groups=["entity"]]
collision_mask = 0
script = ExtResource("1_57ac8")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]

View File

@ -1,8 +1,8 @@
[gd_scene load_steps=7 format=3 uid="uid://cscl5k7lhopj5"]
[ext_resource type="Script" path="res://content/entities/switch/switch.gd" id="1_8ffhi"]
[ext_resource type="Texture2D" uid="uid://b72vsbcvqqxg7" path="res://assets/materials/swich_on.png" id="1_w68gw"]
[ext_resource type="Texture2D" uid="uid://cvc0o6dsktnvl" path="res://assets/materials/switch_off.png" id="2_86ba1"]
[ext_resource type="Texture2D" uid="uid://br3p0c2foputg" path="res://assets/materials/swich_on.png" id="1_w68gw"]
[ext_resource type="Texture2D" uid="uid://co2ishj2hx57p" path="res://assets/materials/switch_off.png" id="2_86ba1"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="4_6xr03"]
[sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"]
@ -23,6 +23,7 @@ animations = [{
}]
[node name="Switch" type="StaticBody3D" groups=["entity"]]
collision_mask = 0
script = ExtResource("1_8ffhi")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]

View File

@ -111,6 +111,7 @@ transform = Transform3D(0.03, 0, 0, 0, 0.03, 0, 0, 0, 0.03, 0.106903, -0.228617,
[node name="Area3D" type="Area3D" parent="trash_bin"]
transform = Transform3D(25, 0, 0, 0, 25, 0, 0, 0, 25, 0, 0, 0)
collision_layer = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="trash_bin/Area3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0542412, 0)

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=3 uid="uid://bsx12q23v8apy"]
[gd_scene load_steps=6 format=3 uid="uid://bsx12q23v8apy"]
[ext_resource type="Script" path="res://content/system/hands/hands.gd" id="1_c4f76"]
[ext_resource type="PackedScene" uid="uid://c0kow4g10wolq" path="res://assets/models/hands_steam/right_hand.glb" id="1_uekbj"]
@ -8,6 +8,9 @@
radius = 0.001
height = 0.02
[sub_resource type="BoxShape3D" id="BoxShape3D_1pxrt"]
size = Vector3(0.14, 0.0577792, 0.169383)
[node name="Hands" type="Node3D"]
script = ExtResource("1_c4f76")
@ -30,8 +33,8 @@ gizmo_extents = 0.02
[node name="TouchArea" type="Area3D" parent="XRHandLeft/IndexTip"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
collision_layer = 2
collision_mask = 2
collision_layer = 0
collision_mask = 4
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandLeft/IndexTip/TouchArea"]
@ -60,14 +63,26 @@ gizmo_extents = 0.02
[node name="TouchArea" type="Area3D" parent="XRHandLeft/MiddleTip"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
collision_layer = 2
collision_mask = 2
collision_layer = 0
collision_mask = 4
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandLeft/MiddleTip/TouchArea"]
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
shape = SubResource("CapsuleShape3D_dopke")
[node name="AnimatableBody3D" type="AnimatableBody3D" parent="XRHandLeft"]
transform = Transform3D(1, 8.67362e-19, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
collision_layer = 8
collision_mask = 8
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandLeft/AnimatableBody3D"]
transform = Transform3D(1, 8.67362e-19, 4.75779e-13, -2.32831e-10, 1, -1.77636e-14, -4.97946e-12, 1.77636e-15, 1, -7.7486e-07, 1.33878e-09, -0.030436)
shape = SubResource("BoxShape3D_1pxrt")
[node name="RemoteTransform3D" type="RemoteTransform3D" parent="XRHandLeft"]
remote_path = NodePath("../AnimatableBody3D")
[node name="XRHandRight" type="OpenXRHand" parent="."]
transform = Transform3D(0.999998, -0.000567105, -2.5179e-05, -2.51789e-05, 4.39886e-08, -0.999999, 0.000567104, 0.999999, 2.97064e-08, 0.264391, 0, 0)
hand = 1
@ -76,6 +91,9 @@ hand_skeleton = NodePath("right_hand/Armature/Skeleton3D")
[node name="right_hand" parent="XRHandRight" instance=ExtResource("1_uekbj")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.033)
[node name="vr_glove_right_slim" parent="XRHandRight/right_hand/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 4.7579e-13, 0, 1, 0, -1.34149e-12, 1.77636e-15, 1, 0, 0, 0)
[node name="IndexTip" type="BoneAttachment3D" parent="XRHandRight"]
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.00254008)
bone_name = "Index_Tip_R"
@ -88,8 +106,8 @@ gizmo_extents = 0.02
[node name="TouchArea" type="Area3D" parent="XRHandRight/IndexTip"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
collision_layer = 2
collision_mask = 2
collision_layer = 0
collision_mask = 4
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandRight/IndexTip/TouchArea"]
@ -118,13 +136,25 @@ gizmo_extents = 0.02
[node name="TouchArea" type="Area3D" parent="XRHandRight/MiddleTip"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
collision_layer = 2
collision_mask = 2
collision_layer = 0
collision_mask = 4
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandRight/MiddleTip/TouchArea"]
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
shape = SubResource("CapsuleShape3D_dopke")
[node name="AnimatableBody3D" type="AnimatableBody3D" parent="XRHandRight"]
transform = Transform3D(1, 0, 4.7579e-13, -5.82077e-11, 1, 0, -4.97947e-12, 1.77636e-15, 1, 0, 0, 0)
collision_layer = 8
collision_mask = 8
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandRight/AnimatableBody3D"]
transform = Transform3D(1, 0, 4.75779e-13, -2.32831e-10, 1, -1.77636e-14, -4.97946e-12, 1.77636e-15, 1, -7.7486e-07, 1.33878e-09, -0.030436)
shape = SubResource("BoxShape3D_1pxrt")
[node name="RemoteTransform3D" type="RemoteTransform3D" parent="XRHandRight"]
remote_path = NodePath("../AnimatableBody3D")
[editable path="XRHandLeft/left_hand"]
[editable path="XRHandRight/right_hand"]

View File

@ -79,11 +79,10 @@ func create_key(key: Key):
func update_labels():
for key_button in keys.get_children():
var label = key_button.get_children()[key_button.get_children().size() - 1]
if caps:
label.text = label.text.to_upper()
key_button.label = key_button.label.to_upper()
else:
label.text = label.text.to_lower()
key_button.label = key_button.label.to_lower()
func _emit_event(type: String, key: Key):
var event = EventKey.new()

View File

@ -13,6 +13,8 @@ size = Vector3(0.79, 0.01, 0.26)
[node name="Keyboard" type="StaticBody3D" groups=["ui_focus_stop"]]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
collision_layer = 2
collision_mask = 2
script = ExtResource("1_maojw")
[node name="Backspace" parent="." instance=ExtResource("1_xdpwr")]

View File

@ -6,6 +6,7 @@
[node name="Raycast" type="RayCast3D"]
transform = Transform3D(0.999999, -1.39624e-11, 0, 9.48108e-12, 0.999999, 0, 0, 4.54747e-13, 0.999998, -0.000467122, 0.00228411, -0.0016689)
target_position = Vector3(0, 0, -5)
collision_mask = 19
script = ExtResource("1_gp8nv")
[node name="Decal" type="Decal" parent="."]

View File

@ -77,6 +77,8 @@ label = "Example Text"
[node name="Body" type="StaticBody3D" parent="." groups=["ui_focus_skip"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.01, 0)
collision_layer = 2
collision_mask = 0
[node name="MeshInstance3D" type="MeshInstance3D" parent="Body"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.005, 0)
@ -103,8 +105,8 @@ libraries = {
[node name="FingerArea" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0101447, 0)
collision_layer = 2
collision_mask = 2
collision_layer = 4
collision_mask = 0
monitoring = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="FingerArea"]

View File

@ -53,6 +53,8 @@ _data = {
}
[node name="Input" type="StaticBody3D" groups=["ui_focus"]]
collision_layer = 2
collision_mask = 0
script = ExtResource("1_uml3t")
width = 0.2
text = "Example"

View File

@ -27,10 +27,17 @@ func _ready():
add_corner(event.ray.get_collision_point())
)
toggle_edit_button.get_node("Clickable").on_press_up.connect(func(event):
edit_enabled = event.target.active
toggle_edit_button.on_button_down.connect(func():
edit_enabled = true
wall_corners.visible = true
wall_edges.visible = true
wall_mesh.visible = false
)
toggle_edit_button.on_button_up.connect(func():
edit_enabled = false
if edit_enabled == false:
wall_corners.visible = false
wall_edges.visible = false
wall_mesh.mesh = generate_mesh()
@ -45,14 +52,13 @@ func _ready():
for collision in collisions:
var static_body = StaticBody3D.new()
static_body.set_collision_layer_value(4, true)
static_body.set_collision_layer_value(5, true)
static_body.collision_mask = 0
static_body.add_child(collision)
wall_collisions.add_child(static_body)
wall_mesh.visible = true
else:
wall_corners.visible = true
wall_edges.visible = true
wall_mesh.visible = false
)
func generate_mesh():

View File

@ -18,8 +18,8 @@ script = ExtResource("1_ch4jb")
[node name="TeleportRoot" type="Node3D" parent="."]
[node name="Ground" type="StaticBody3D" parent="TeleportRoot"]
collision_layer = 5
collision_mask = 5
collision_layer = 24
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="TeleportRoot/Ground"]
shape = SubResource("WorldBoundaryShape3D_08sv0")
@ -46,7 +46,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.01, 0)
[node name="ToggleEdit" parent="Interface" instance=ExtResource("3_whl7a")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.05, 0, 0.05)
focusable = true
label = "room_preferences"
icon = true
toggleable = true

View File

@ -9,8 +9,8 @@ bounce = 0.7
radius = 0.08
[node name="Ball" type="RigidBody3D"]
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 24
physics_material_override = SubResource("PhysicsMaterial_f6jtg")
angular_damp = 4.0

View File

@ -36,6 +36,14 @@ import/fbx/enabled=false
theme/custom_font="res://assets/fonts/ui_font_500.tres"
[layer_names]
3d_physics/layer_1="entities"
3d_physics/layer_2="interface"
3d_physics/layer_3="touch"
3d_physics/layer_4="physics"
3d_physics/layer_5="room"
[rendering]
renderer/rendering_method="mobile"