From 843e6d155ca2b2f7773be5c76eddfd7e1af75657 Mon Sep 17 00:00:00 2001 From: "D@re" <56046022+DigitalN8m4r3@users.noreply.github.com> Date: Thu, 2 Mar 2023 00:07:16 +0100 Subject: [PATCH] resolved conflict with #401 merge --- .../objects/inventory/BackpackSnapZone.tscn | 24 +++---- .../objects/instructions_2d.tscn | 6 +- scenes/pickable_demo/pickable_demo.tscn | 64 +++++++++++++------ 3 files changed, 58 insertions(+), 36 deletions(-) diff --git a/addons/godot-xr-tools/objects/inventory/BackpackSnapZone.tscn b/addons/godot-xr-tools/objects/inventory/BackpackSnapZone.tscn index 98a9d7d6..2a8fd02d 100644 --- a/addons/godot-xr-tools/objects/inventory/BackpackSnapZone.tscn +++ b/addons/godot-xr-tools/objects/inventory/BackpackSnapZone.tscn @@ -1,20 +1,8 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=3 format=2] -[ext_resource path="res://addons/godot-xr-tools/objects/highlight/highlight_ring.tscn" type="PackedScene" id=1] +[ext_resource path="res://addons/godot-xr-tools/objects/inventory/textures/ring_small.png" type="Texture" id=1] [ext_resource path="res://addons/godot-xr-tools/objects/snap_zone.tscn" type="PackedScene" id=2] -[sub_resource type="SpatialMaterial" id=1] -flags_transparent = true -params_cull_mode = 1 -albedo_color = Color( 0.0627451, 0.905882, 0.886275, 0.545098 ) - -[sub_resource type="SphereMesh" id=2] -material = SubResource( 1 ) -radius = 0.05 -height = 0.1 -radial_segments = 32 -rings = 16 - [node name="BackpackSnapZone" groups=["ShoulderHolster"] instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.3, 0.3 ) grab_distance = 0.1 @@ -22,6 +10,10 @@ snap_require = "Backpack" [node name="Sphere" type="MeshInstance" parent="." index="1"] cast_shadow = 0 -mesh = SubResource( 2 ) -[node name="HighlightRing" parent="." index="2" instance=ExtResource( 1 )] +[node name="HighlightRing" type="Sprite3D" parent="." index="2"] +transform = Transform( 0.075, 0, 0, 0, -3.27835e-09, -1, 0, 0.075, -4.37114e-08, 0, 0, 0 ) +texture = ExtResource( 1 ) +__meta__ = { +"_editor_description_": "" +} diff --git a/scenes/pickable_demo/objects/instructions_2d.tscn b/scenes/pickable_demo/objects/instructions_2d.tscn index beb43b92..b6d02d32 100644 --- a/scenes/pickable_demo/objects/instructions_2d.tscn +++ b/scenes/pickable_demo/objects/instructions_2d.tscn @@ -26,4 +26,8 @@ This scene contains objects that the player can pick up including: - Cubes with hand-bone interactions - Teacups with hand-grab-points and multiple snap-points - Snap-toys that can be snapped into holders - - Snap-holders that can be enabled/disabled by pointer" + - Snap-holders that can be enabled/disabled by pointer + - Snap-backpack to store items/weapons: + a) circle shaped zones are scaling the items + b) oval shaped zones got no scaling applied + c) inventory can be set to drop and return to snapzone" diff --git a/scenes/pickable_demo/pickable_demo.tscn b/scenes/pickable_demo/pickable_demo.tscn index 8381e17d..282dbd84 100644 --- a/scenes/pickable_demo/pickable_demo.tscn +++ b/scenes/pickable_demo/pickable_demo.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=27 format=2] +[gd_scene load_steps=29 format=2] [ext_resource path="res://addons/godot-xr-tools/staging/scene_base.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/maps/basic_map.tscn" type="PackedScene" id=2] @@ -22,14 +22,16 @@ [ext_resource path="res://scenes/pickable_demo/objects/saucer.tscn" type="PackedScene" id=20] [ext_resource path="res://scenes/pickable_demo/objects/teacup_stand.tscn" type="PackedScene" id=21] [ext_resource path="res://scenes/pickable_demo/objects/instructions.tscn" type="PackedScene" id=22] +[ext_resource path="res://scenes/pickable_demo/objects/BeltSnapZone.tscn" type="PackedScene" id=23] [ext_resource path="res://scenes/pickable_demo/objects/knife.tscn" type="PackedScene" id=24] -[ext_resource path="res://addons/godot-xr-tools/objects/inventory/inventory_backpack.tscn" type="PackedScene" id=25] -[ext_resource path="res://addons/godot-xr-tools/objects/inventory/BackpackSnapZone.tscn" type="PackedScene" id=26] +[ext_resource path="res://addons/godot-xr-tools/objects/return_to_snap_zone.gd" type="Script" id=25] +[ext_resource path="res://addons/godot-xr-tools/objects/inventory/inventory_backpack.tscn" type="PackedScene" id=26] [ext_resource path="res://scenes/pickable_demo/objects/snap_backpack.tscn" type="PackedScene" id=27] +[ext_resource path="res://addons/godot-xr-tools/objects/inventory/BackpackSnapZone.tscn" type="PackedScene" id=28] [node name="PickableDemo" instance=ExtResource( 1 )] -[node name="BackpackSnapZone" parent="ARVROrigin/ARVRCamera" index="0" instance=ExtResource( 26 )] +[node name="BackpackSnapZone" parent="ARVROrigin/ARVRCamera" index="0" instance=ExtResource( 28 )] [node name="LeftPhysicsHand" parent="ARVROrigin/LeftHand" index="0" instance=ExtResource( 3 )] @@ -65,26 +67,43 @@ laser_length = 1 [node name="PlayerBody" parent="ARVROrigin" index="3" instance=ExtResource( 9 )] -[node name="InventoryBackpack" parent="ARVROrigin" index="4" instance=ExtResource( 25 )] -backpack_path = NodePath("SnapBackpack") +[node name="BeltSnapZone01" parent="ARVROrigin/PlayerBody" index="0" instance=ExtResource( 23 )] +transform = Transform( 0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, -0.176713, 1, -0.176713 ) +visible = false -[node name="SnapBackpack" parent="ARVROrigin/InventoryBackpack" index="0" instance=ExtResource( 27 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.502358, 1.18107, -3 ) +[node name="BeltSnapZone02" parent="ARVROrigin/PlayerBody" index="1" instance=ExtResource( 23 )] +transform = Transform( 0.92388, 0, 0.382683, 0, 1, 0, -0.382683, 0, 0.92388, -0.0956363, 1, -0.230887 ) +visible = false -[node name="BasicMap" parent="." index="1" instance=ExtResource( 2 )] +[node name="BeltSnapZone03" parent="ARVROrigin/PlayerBody" index="2" instance=ExtResource( 23 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 7.45058e-09, 1, -0.24991 ) +visible = false -[node name="Teleport" parent="." index="2" instance=ExtResource( 5 )] +[node name="BeltSnapZone04" parent="ARVROrigin/PlayerBody" index="3" instance=ExtResource( 23 )] +transform = Transform( 0.92388, 0, -0.382683, 0, 1, 0, 0.382683, 0, 0.92388, 0.0956363, 1, -0.230887 ) +visible = false + +[node name="BeltSnapZone05" parent="ARVROrigin/PlayerBody" index="4" instance=ExtResource( 23 )] +transform = Transform( 0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 0.176713, 1, -0.176713 ) +visible = false + +[node name="InventoryBackpack" parent="." index="1" instance=ExtResource( 26 )] +backpack_path = NodePath("../SnapToys/SnapBackpack") + +[node name="BasicMap" parent="." index="2" instance=ExtResource( 2 )] + +[node name="Teleport" parent="." index="3" instance=ExtResource( 5 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4 ) scene_base = NodePath("..") title = ExtResource( 6 ) -[node name="Instructions" parent="." index="3" instance=ExtResource( 22 )] +[node name="Instructions" parent="." index="4" instance=ExtResource( 22 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -5 ) -[node name="Table2" parent="." index="4" instance=ExtResource( 15 )] +[node name="Table2" parent="." index="5" instance=ExtResource( 15 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, -3 ) -[node name="Table1" parent="." index="5" instance=ExtResource( 15 )] +[node name="Table1" parent="." index="6" instance=ExtResource( 15 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -3 ) [node name="Saucer" parent="Table1" index="10" instance=ExtResource( 20 )] @@ -99,6 +118,10 @@ initial_object = NodePath("../Teacup") [node name="Teacup" parent="Table1/TeacupStand" index="8" instance=ExtResource( 19 )] transform = Transform( -4.37114e-08, 0, -1, 1, -4.37114e-08, -4.37114e-08, -4.37114e-08, -1, 1.91069e-15, 0.08, 0.204674, 0.0395086 ) +[node name="XRToolsReturnToSnapZone" type="Node" parent="Table1/TeacupStand/Teacup" index="6"] +script = ExtResource( 25 ) +snap_zone_path = NodePath("../../SnapZone1") + [node name="Teacup" parent="Table1" index="12" instance=ExtResource( 19 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.234713, 0.824552, 0.266177 ) @@ -111,7 +134,7 @@ transform = Transform( 1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08 [node name="Knife3" parent="Table1" index="15" instance=ExtResource( 24 )] transform = Transform( 1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 0, -4.37114e-08, -0.493906, 0.834034, 2.38419e-07 ) -[node name="RemoteGrabBalls" type="Spatial" parent="." index="6"] +[node name="RemoteGrabBalls" type="Spatial" parent="." index="7"] [node name="Ball1" parent="RemoteGrabBalls" index="0" instance=ExtResource( 13 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.6, 0.2, -2.6 ) @@ -122,7 +145,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.6, 0.2, -3.2 ) [node name="Ball3" parent="RemoteGrabBalls" index="2" instance=ExtResource( 13 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 0.2, -2.9 ) -[node name="Hammers" type="Spatial" parent="." index="7"] +[node name="Hammers" type="Spatial" parent="." index="8"] [node name="Hammer" parent="Hammers" index="0" instance=ExtResource( 17 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0.15, -3.6 ) @@ -136,7 +159,7 @@ transform = Transform( 0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, - [node name="Hammer3" parent="Hammers" index="3" instance=ExtResource( 17 )] transform = Transform( 0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, -2.2, 0.15, -3.3 ) -[node name="GrabCubes" type="Spatial" parent="." index="8"] +[node name="GrabCubes" type="Spatial" parent="." index="9"] [node name="Cube1" parent="GrabCubes" index="0" instance=ExtResource( 14 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.1, 0.875, -2.8 ) @@ -147,7 +170,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9, 0.875, -2.8 ) [node name="Cube3" parent="GrabCubes" index="2" instance=ExtResource( 14 )] transform = Transform( 0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, -1, 0.975, -2.8 ) -[node name="SnapToys" type="Spatial" parent="." index="9"] +[node name="SnapToys" type="Spatial" parent="." index="10"] [node name="SnapTray1" parent="SnapToys" index="0" instance=ExtResource( 16 )] transform = Transform( 0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 1.5, 1, -2.9 ) @@ -157,9 +180,12 @@ tray_active = true transform = Transform( 0.996195, 0, -0.0871558, 0, 1, 0, 0.0871558, 0, 0.996195, 1.1, 1, -3 ) [node name="SnapToyRed" parent="SnapToys" index="2" instance=ExtResource( 11 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.891369, 0.9, -2.65446 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.827095, 0.9, -2.6569 ) [node name="SnapToyYellow" parent="SnapToys" index="3" instance=ExtResource( 12 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.0274, 0.9, -2.64271 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.02709, 0.9, -2.6569 ) + +[node name="SnapBackpack" parent="SnapToys" index="4" instance=ExtResource( 27 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.501471, 1.19525, -3 ) [editable path="Table1/TeacupStand"]