diff --git a/example.gd/addons/tiltfive/scenes/helpers/PushBodyBase.gd b/example.gd/addons/tiltfive/scenes/helpers/PushBodyBase.gd deleted file mode 100644 index 2755e63..0000000 --- a/example.gd/addons/tiltfive/scenes/helpers/PushBodyBase.gd +++ /dev/null @@ -1,30 +0,0 @@ -extends Node3D - -@export var push_strength : float = 0.01 - -var was_parent_visible : bool = false - -func _physics_process(delta): - var is_parent_visible : bool = get_parent().visible - if !was_parent_visible and is_parent_visible: - # move it to our starting position - $Body.global_transform = global_transform - elif is_parent_visible: - # Always rotate - $Body.global_transform.basis = global_transform.basis - - # Then we do our move and collide - var motion = global_position - $Body.global_position - var collision = $Body.move_and_collide(motion, false, 0.001, false, 1) - if collision: - var with : PhysicsBody3D = collision.get_collider() - - if with and with is RigidBody3D: - var rb : RigidBody3D = with - - var pos = collision.get_position() - rb.global_position - var impulse = -collision.get_normal() * (push_strength * motion.length() / delta) - - rb.apply_impulse(impulse, pos) - - was_parent_visible = is_parent_visible diff --git a/example.gd/addons/tiltfive/scenes/helpers/PushBodyBase.tscn b/example.gd/addons/tiltfive/scenes/helpers/PushBodyBase.tscn deleted file mode 100644 index 5232f53..0000000 --- a/example.gd/addons/tiltfive/scenes/helpers/PushBodyBase.tscn +++ /dev/null @@ -1,13 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://ctf3nwkxqos0s"] - -[ext_resource type="Script" path="res://addons/tiltfive/scenes/helpers/PushBodyBase.gd" id="1_m2asu"] - -[node name="PushBodyBase" type="Node3D"] -script = ExtResource("1_m2asu") - -[node name="Body" type="CharacterBody3D" parent="."] -top_level = true -collision_layer = 512 -collision_mask = 2 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="Body"] diff --git a/example.gd/main.tscn b/example.gd/main.tscn index 501cb36..cf921a2 100644 --- a/example.gd/main.tscn +++ b/example.gd/main.tscn @@ -2,9 +2,9 @@ [ext_resource type="Script" path="res://main.gd" id="1_xvgge"] [ext_resource type="Script" path="res://addons/tiltfive/T5Manager.gd" id="2_dibvp"] -[ext_resource type="PackedScene" uid="uid://dl3mv76qkuscf" path="res://ExampleXRRig.tscn" id="3_i6xar"] -[ext_resource type="Script" path="res://addons/tiltfive/scenes/helpers/SelectableBody.gd" id="3_jespo"] -[ext_resource type="Material" uid="uid://blq3i2qbhoyum" path="res://addons/tiltfive/materials/highlight_overlay_material.tres" id="5_cq8r1"] +[ext_resource type="PackedScene" uid="uid://dl3mv76qkuscf" path="res://scenes/ExampleXRRig.tscn" id="3_8a4oa"] +[ext_resource type="Script" path="res://scenes/SelectableBody.gd" id="4_wxdse"] +[ext_resource type="Material" uid="uid://blq3i2qbhoyum" path="res://materials/highlight_overlay_material.tres" id="5_2i4f6"] [sub_resource type="BoxMesh" id="BoxMesh_gbwc2"] @@ -39,7 +39,7 @@ script = ExtResource("1_xvgge") [node name="T5Manager" type="Node" parent="." node_paths=PackedStringArray("start_location")] script = ExtResource("2_dibvp") -glasses_scene = ExtResource("3_i6xar") +glasses_scene = ExtResource("3_8a4oa") start_location = NodePath("../T5Gameboard") [node name="T5Gameboard" type="T5Gameboard" parent="."] @@ -51,11 +51,11 @@ transform = Transform3D(0.952497, -0.0534809, 0.299816, -0.283211, 0.206458, 0.9 [node name="Boxes" type="Node3D" parent="."] [node name="CenterBody" type="StaticBody3D" parent="Boxes"] -script = ExtResource("3_jespo") +script = ExtResource("4_wxdse") grow_amount = 0.05 [node name="Center" type="MeshInstance3D" parent="Boxes/CenterBody"] -material_overlay = ExtResource("5_cq8r1") +material_overlay = ExtResource("5_2i4f6") mesh = SubResource("BoxMesh_gbwc2") skeleton = NodePath("../..") surface_material_override/0 = SubResource("StandardMaterial3D_iuako") @@ -65,7 +65,7 @@ shape = SubResource("BoxShape3D_pbofy") [node name="PositiveYBody" type="StaticBody3D" parent="Boxes"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0) -script = ExtResource("3_jespo") +script = ExtResource("4_wxdse") grow_amount = 0.05 [node name="Positive Y" type="MeshInstance3D" parent="Boxes/PositiveYBody"] diff --git a/example.gd/addons/tiltfive/materials/highlight_overlay_material.tres b/example.gd/materials/highlight_overlay_material.tres similarity index 100% rename from example.gd/addons/tiltfive/materials/highlight_overlay_material.tres rename to example.gd/materials/highlight_overlay_material.tres diff --git a/example.gd/Controls.tscn b/example.gd/scenes/Controls.tscn similarity index 100% rename from example.gd/Controls.tscn rename to example.gd/scenes/Controls.tscn diff --git a/example.gd/ExampleXRRig.tscn b/example.gd/scenes/ExampleXRRig.tscn similarity index 83% rename from example.gd/ExampleXRRig.tscn rename to example.gd/scenes/ExampleXRRig.tscn index 06fc2dc..b55cb6a 100644 --- a/example.gd/ExampleXRRig.tscn +++ b/example.gd/scenes/ExampleXRRig.tscn @@ -1,12 +1,12 @@ [gd_scene load_steps=17 format=3 uid="uid://dl3mv76qkuscf"] -[ext_resource type="Script" path="res://XROrigin3D.gd" id="1_qprko"] -[ext_resource type="PackedScene" uid="uid://je0clrdu7o76" path="res://addons/tiltfive/scenes/T5XRRig.tscn" id="1_uq4nw"] -[ext_resource type="Script" path="res://pointer_control.gd" id="2_qcruj"] -[ext_resource type="PackedScene" uid="uid://dnx42xctfl3mx" path="res://Controls.tscn" id="3_udc3i"] -[ext_resource type="PackedScene" uid="uid://b1cd3jc00rhal" path="res://addons/tiltfive/assets/T5GlassesModel.tscn" id="3_xuir6"] -[ext_resource type="Script" path="res://addons/tiltfive/scenes/T5Pointer.gd" id="5_j0d0b"] -[ext_resource type="PackedScene" uid="uid://fipea8dbocg4" path="res://addons/tiltfive/assets/T5WandModel.tscn" id="5_u5ikf"] +[ext_resource type="PackedScene" uid="uid://je0clrdu7o76" path="res://addons/tiltfive/scenes/T5XRRig.tscn" id="1_mer1r"] +[ext_resource type="Script" path="res://scenes/XROrigin3D.gd" id="2_ovq7h"] +[ext_resource type="PackedScene" uid="uid://b1cd3jc00rhal" path="res://addons/tiltfive/assets/T5GlassesModel.tscn" id="3_dh820"] +[ext_resource type="Script" path="res://scenes/pointer_control.gd" id="4_bhwvx"] +[ext_resource type="Script" path="res://scenes/T5Pointer.gd" id="5_1korn"] +[ext_resource type="PackedScene" uid="uid://fipea8dbocg4" path="res://addons/tiltfive/assets/T5WandModel.tscn" id="6_mg3yb"] +[ext_resource type="PackedScene" uid="uid://dnx42xctfl3mx" path="res://scenes/Controls.tscn" id="7_p34a2"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgatm"] albedo_color = Color(0.0823529, 0.243137, 1, 1) @@ -31,28 +31,28 @@ albedo_color = Color(0.862745, 0, 0.0235294, 1) [sub_resource type="BoxMesh" id="BoxMesh_aaxuw"] -[node name="T5Glasses" instance=ExtResource("1_uq4nw")] +[node name="T5Glasses" instance=ExtResource("1_mer1r")] [node name="Origin" parent="." index="0"] -script = ExtResource("1_qprko") +script = ExtResource("2_ovq7h") -[node name="T5-glasses" parent="Origin/Camera" index="0" instance=ExtResource("3_xuir6")] +[node name="T5-glasses" parent="Origin/Camera" index="0" instance=ExtResource("3_dh820")] transform = Transform3D(16, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0) [node name="Wand_1" parent="Origin" index="1"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0) -script = ExtResource("2_qcruj") +script = ExtResource("4_bhwvx") selected_mat = SubResource("StandardMaterial3D_cgatm") unselected_mat = SubResource("StandardMaterial3D_vjp8o") [node name="RayCast3D" type="RayCast3D" parent="Origin/Wand_1" index="0"] target_position = Vector3(0, 0, -100) -script = ExtResource("5_j0d0b") +script = ExtResource("5_1korn") -[node name="T5-wand" parent="Origin/Wand_1" index="1" instance=ExtResource("5_u5ikf")] +[node name="T5-wand" parent="Origin/Wand_1" index="1" instance=ExtResource("6_mg3yb")] transform = Transform3D(16, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0) -[node name="Controls" parent="Origin/Wand_1" index="2" instance=ExtResource("3_udc3i")] +[node name="Controls" parent="Origin/Wand_1" index="2" instance=ExtResource("7_p34a2")] transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0.583, -0.002, 0.01) [node name="Center" type="MeshInstance3D" parent="Origin/Wand_1" index="3"] diff --git a/example.gd/addons/tiltfive/scenes/helpers/SelectableBody.gd b/example.gd/scenes/SelectableBody.gd similarity index 90% rename from example.gd/addons/tiltfive/scenes/helpers/SelectableBody.gd rename to example.gd/scenes/SelectableBody.gd index 98722a9..f1351a1 100644 --- a/example.gd/addons/tiltfive/scenes/helpers/SelectableBody.gd +++ b/example.gd/scenes/SelectableBody.gd @@ -13,7 +13,7 @@ var highlight_material : StandardMaterial3D var pointers_entered : Array func _ready(): - var material : StandardMaterial3D = preload("res://addons/tiltfive/materials/highlight_overlay_material.tres") + var material : StandardMaterial3D = preload("res://materials/highlight_overlay_material.tres") highlight_material = material.duplicate(true) highlight_material.grow_amount = grow_amount diff --git a/example.gd/addons/tiltfive/scenes/T5Pointer.gd b/example.gd/scenes/T5Pointer.gd similarity index 100% rename from example.gd/addons/tiltfive/scenes/T5Pointer.gd rename to example.gd/scenes/T5Pointer.gd diff --git a/example.gd/XROrigin3D.gd b/example.gd/scenes/XROrigin3D.gd similarity index 100% rename from example.gd/XROrigin3D.gd rename to example.gd/scenes/XROrigin3D.gd diff --git a/example.gd/pointer_control.gd b/example.gd/scenes/pointer_control.gd similarity index 100% rename from example.gd/pointer_control.gd rename to example.gd/scenes/pointer_control.gd