Skip to content

Commit

Permalink
resolved conflict with GodotVR#401 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalN8m4r3 committed Mar 1, 2023
1 parent eb2657a commit 843e6d1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 36 deletions.
24 changes: 8 additions & 16 deletions addons/godot-xr-tools/objects/inventory/BackpackSnapZone.tscn
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
[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
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_": ""
}
6 changes: 5 additions & 1 deletion scenes/pickable_demo/objects/instructions_2d.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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"
64 changes: 45 additions & 19 deletions scenes/pickable_demo/pickable_demo.tscn
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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 )]

Expand Down Expand Up @@ -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 )]
Expand All @@ -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 )

Expand All @@ -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 )
Expand All @@ -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 )
Expand All @@ -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 )
Expand All @@ -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 )
Expand All @@ -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"]

0 comments on commit 843e6d1

Please sign in to comment.