Skip to content

Commit

Permalink
Merge pull request #153 from BastiaanOlij/fix_demo
Browse files Browse the repository at this point in the history
Bare minimum changes to demo to get errors resolved
  • Loading branch information
BastiaanOlij authored Nov 20, 2024
2 parents c959630 + f10ec9d commit 646245e
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 955 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ You must compile the `godot-cpp` submodule first by executing:

cd godot-cpp
scons platform=windows target=template_release generate_bindings=yes arch=x86_64
scons platform=windows target=template_debug arch=x86_64
cd ..

You can then compile this extension by executing:

scons
scons target=release
scons target=debug

The results will be placed within the extension's addon hierarchy in the included demo. This entire hierarchy (demo/addons/godot-openvr on downward) is then distributable.

Expand Down
58 changes: 6 additions & 52 deletions demo/Main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=24 format=3 uid="uid://ylx5afjemhln"]
[gd_scene load_steps=15 format=3 uid="uid://ylx5afjemhln"]

[ext_resource type="Script" path="res://Main.gd" id="1"]
[ext_resource type="Material" uid="uid://cok6b068i8j3m" path="res://assets/wahooney.itch.io/green_grid.tres" id="2"]
Expand All @@ -8,23 +8,7 @@
[ext_resource type="PackedScene" path="res://misc/Table.tscn" id="7"]
[ext_resource type="PackedScene" path="res://misc/Box.tscn" id="8"]
[ext_resource type="Script" path="res://player/right_controller.gd" id="8_oqay4"]
[ext_resource type="PackedScene" path="res://addons/godot-xr-tools/functions/function_teleport.tscn" id="9"]
[ext_resource type="PackedScene" uid="uid://bl2nuu3qhlb5k" path="res://addons/godot-xr-tools/functions/movement_direct.tscn" id="10"]
[ext_resource type="PackedScene" uid="uid://7q2uyb55p6e5" path="res://misc/Cup.tscn" id="11"]
[ext_resource type="PackedScene" path="res://addons/godot-xr-tools/functions/function_pickup.tscn" id="12"]
[ext_resource type="PackedScene" uid="uid://diyu06cw06syv" path="res://addons/godot-xr-tools/player/player_body.tscn" id="12_d8snu"]
[ext_resource type="PackedScene" path="res://addons/godot-xr-tools/functions/function_pointer.tscn" id="14"]
[ext_resource type="PackedScene" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="15"]
[ext_resource type="PackedScene" uid="uid://bvl8eat4blx3g" path="res://player/ButtonStates.tscn" id="16"]

[sub_resource type="QuadMesh" id="QuadMesh_2ndrj"]
size = Vector2(0.3, 0.1)

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ux7rk"]
resource_local_to_scene = true
transparency = 1
no_depth_test = true
shading_mode = 0

[sub_resource type="BoxMesh" id="BoxMesh_jxy6n"]
size = Vector3(0.01, 0.01, 0.01)
Expand Down Expand Up @@ -65,30 +49,16 @@ physics_factor = null
[node name="HUD_Anchor" parent="OVRFirstPerson" index="1"]
script = ExtResource("4_n1047")

[node name="SubViewport" type="SubViewport" parent="OVRFirstPerson/HUD_Anchor" index="0"]
disable_3d = true
transparent_bg = true
size = Vector2i(300, 100)
render_target_update_mode = 3

[node name="FPS" type="Label" parent="OVRFirstPerson/HUD_Anchor/SubViewport"]
offset_right = 40.0
offset_bottom = 23.0
theme_override_font_sizes/font_size = 72
text = "FPS: 0"

[node name="FPSQuad" type="MeshInstance3D" parent="OVRFirstPerson/HUD_Anchor" index="1"]
transform = Transform3D(0.965182, 0.11344, 0.235702, -0.0501897, 0.96464, -0.258746, -0.25672, 0.237907, 0.936747, -0.32241, 0.322052, -0.966649)
mesh = SubResource("QuadMesh_2ndrj")
surface_material_override/0 = SubResource("StandardMaterial3D_ux7rk")
[node name="FPS" type="Label3D" parent="OVRFirstPerson/HUD_Anchor" index="0"]
transform = Transform3D(0.965182, 0.11344, 0.235702, -0.0501897, 0.964641, -0.258746, -0.25672, 0.237907, 0.936747, -0.32241, 0.322052, -0.966649)
pixel_size = 0.003
text = "FPS: 00"

[node name="TestCube" type="MeshInstance3D" parent="OVRFirstPerson/Left_Hand" index="1"]
mesh = SubResource("BoxMesh_jxy6n")
skeleton = NodePath("../../Right_Hand")

[node name="Function_Direct_movement" parent="OVRFirstPerson/Right_Hand" index="0" instance=ExtResource("10")]

[node name="TestCube" type="MeshInstance3D" parent="OVRFirstPerson/Right_Hand" index="2"]
[node name="TestCube" type="MeshInstance3D" parent="OVRFirstPerson/Right_Hand" index="1"]
mesh = SubResource("BoxMesh_jxy6n")

[node name="aim_left_hand" type="XRController3D" parent="OVRFirstPerson"]
Expand All @@ -100,12 +70,6 @@ pose = &"aim"
mesh = SubResource("BoxMesh_ynikn")
skeleton = NodePath("../../aim_right_hand")

[node name="Function_Teleport" parent="OVRFirstPerson/aim_left_hand" instance=ExtResource("9")]
collision_mask = 1022

[node name="Function_pointer" parent="OVRFirstPerson/aim_left_hand" instance=ExtResource("14")]
collision_mask = 2048

[node name="aim_right_hand" type="XRController3D" parent="OVRFirstPerson"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 1.25, 0)
tracker = &"right_hand"
Expand All @@ -115,16 +79,6 @@ script = ExtResource("8_oqay4")
[node name="TestCube" type="MeshInstance3D" parent="OVRFirstPerson/aim_right_hand"]
mesh = SubResource("BoxMesh_ynikn")

[node name="Viewport2Din3D" parent="OVRFirstPerson/aim_right_hand" instance=ExtResource("15")]
transform = Transform3D(0.960079, 0.211887, -0.182625, -0.163522, 0.954819, 0.248155, 0.226955, -0.208384, 0.95135, 0.167837, 0, 0)
screen_size = Vector2(0.3, 0.2)
collision_layer = 2048
scene = ExtResource("16")

[node name="Function_Pickup" parent="OVRFirstPerson/aim_right_hand" instance=ExtResource("12")]

[node name="PlayerBody" parent="OVRFirstPerson" instance=ExtResource("12_d8snu")]

[node name="Floor" type="StaticBody3D" parent="."]
collision_layer = 2
collision_mask = 0
Expand Down
3 changes: 1 addition & 2 deletions demo/misc/Cup.tscn
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[gd_scene load_steps=4 format=3 uid="uid://7q2uyb55p6e5"]

[ext_resource type="PackedScene" uid="uid://c8l60rnugru40" path="res://addons/godot-xr-tools/objects/pickable.tscn" id="1"]
[ext_resource type="ArrayMesh" path="res://assets/kenney.nl/mug.tres" id="2"]

[sub_resource type="CylinderShape3D" id="1"]
margin = 0.01
height = 0.109187
radius = 0.0630744

[node name="Cup" instance=ExtResource("1")]
[node name="Cup" type="RigidBody3D"]
picked_up_layer = 1024

[node name="CollisionShape3D" parent="." index="0"]
Expand Down
2 changes: 1 addition & 1 deletion demo/misc/SmallCube.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extends "res://addons/godot-xr-tools/objects/Object_pickable.gd"
extends RigidBody3D

var color_idx = 0
var colors = [ Color(1.0, 0.0, 0.0, 1.0), Color(0.0, 1.0, 0.0, 1.0), Color(0.0, 0.0, 1.0, 1.0) ]
Expand Down
3 changes: 1 addition & 2 deletions demo/misc/SmallCube.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[gd_scene load_steps=8 format=2]

[ext_resource path="res://addons/godot-xr-tools/objects/Object_pickable.tscn" type="PackedScene" id=1]
[ext_resource path="res://misc/SmallCube.gd" type="Script" id=3]
[ext_resource path="res://assets/wahooney.itch.io/white_grid.png" type="Texture" id=4]

Expand All @@ -17,7 +16,7 @@ albedo_texture = ExtResource( 4 )
uv1_scale = Vector3( 4, 4, 4 )
uv1_triplanar = true

[node name="SmallCube" instance=ExtResource( 1 )]
[node name="SmallCube" type="RigidBody3D"]
collision_layer = 4
script = ExtResource( 3 )
reset_transform_on_pickup = false
Expand Down
Loading

0 comments on commit 646245e

Please sign in to comment.