Skip to content

Commit

Permalink
Merge pull request #1 from BastiaanOlij/part2
Browse files Browse the repository at this point in the history
Part2
  • Loading branch information
BastiaanOlij authored Jan 6, 2023
2 parents a527136 + 4298dec commit deb5ec4
Show file tree
Hide file tree
Showing 290 changed files with 27,866 additions and 1,028 deletions.
70 changes: 55 additions & 15 deletions Main.tscn
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[gd_scene load_steps=13 format=2]
[gd_scene load_steps=15 format=2]

[ext_resource path="res://assets/wahooney.itch.io/green_grid.tres" type="Material" id=1]
[ext_resource path="res://addons/godot-openxr/scenes/first_person_controller_vr.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/godot-xr-tools/assets/player_body.gd" type="Script" id=3]
[ext_resource path="res://addons/godot-xr-tools/assets/left_hand.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/right_hand_low.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/godot-xr-tools/functions/movement_direct.tscn" type="PackedScene" id=5]
[ext_resource path="res://addons/godot-xr-tools/assets/right_hand.tscn" type="PackedScene" id=6]
[ext_resource path="res://objects/Table.tscn" type="PackedScene" id=6]
[ext_resource path="res://addons/godot-xr-tools/misc/vr_common_shader_cache.tscn" type="PackedScene" id=7]
[ext_resource path="res://addons/godot-xr-tools/functions/movement_turn.tscn" type="PackedScene" id=8]
[ext_resource path="res://addons/godot-xr-tools/functions/function_teleport.tscn" type="PackedScene" id=9]
[ext_resource path="res://addons/godot-xr-tools/assets/player_body.tscn" type="PackedScene" id=10]
[ext_resource path="res://addons/godot-xr-tools/player/player_body.tscn" type="PackedScene" id=10]
[ext_resource path="res://objects/part2/Cube.tscn" type="PackedScene" id=11]
[ext_resource path="res://addons/godot-xr-tools/functions/function_pickup.tscn" type="PackedScene" id=12]

[sub_resource type="PlaneMesh" id=1]
size = Vector2( 1000, 1000 )
Expand All @@ -21,24 +23,25 @@ extents = Vector3( 500, 1, 500 )

[node name="FPController" parent="." instance=ExtResource( 2 )]

[node name="Configuration" parent="FPController" index="0"]
color_space = 0
refresh_rate = 0.0
[node name="ARVRCamera" parent="FPController" index="1"]
far = 1000.0

[node name="VRCommonShaderCache" parent="FPController/ARVRCamera" index="0" instance=ExtResource( 7 )]

[node name="LeftHandController" parent="FPController" index="2"]
visible = true

[node name="LeftHand" parent="FPController/LeftHandController" index="0" instance=ExtResource( 4 )]
[node name="LeftHand" parent="FPController/LeftHandController" index="0" instance=ExtResource( 3 )]

[node name="FunctionTeleport" parent="FPController/LeftHandController" index="1" instance=ExtResource( 9 )]
camera = NodePath("../../ARVRCamera")

[node name="FunctionPickup" parent="FPController/LeftHandController" index="2" instance=ExtResource( 12 )]
ranged_angle = 15.0

[node name="RightHandController" parent="FPController" index="3"]
visible = true

[node name="RightHand" parent="FPController/RightHandController" index="0" instance=ExtResource( 6 )]
[node name="RightHand" parent="FPController/RightHandController" index="0" instance=ExtResource( 4 )]

[node name="MovementDirect" parent="FPController/RightHandController" index="1" instance=ExtResource( 5 )]
enabled = true
Expand All @@ -47,9 +50,23 @@ max_speed = 10.0
strafe = false

[node name="MovementTurn" parent="FPController/RightHandController" index="2" instance=ExtResource( 8 )]
turn_mode = 2

[node name="FunctionPickup" parent="FPController/RightHandController" index="3" instance=ExtResource( 12 )]
ranged_angle = 15.0

[node name="PlayerBody" type="Node" parent="FPController" instance=ExtResource( 10 )]
script = ExtResource( 3 )
[node name="PlayerBody" parent="FPController" instance=ExtResource( 10 )]
player_radius = 0.2
eye_forward_offset = 0.2

[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( -0.866025, 0.383022, 0.321394, 5.61943e-08, -0.642788, 0.766044, 0.5, 0.663414, 0.55667, 0, 5, 0 )
shadow_enabled = true
shadow_bias = 0.01
directional_shadow_split_1 = 0.05
directional_shadow_split_2 = 0.15
directional_shadow_normal_bias = 0.15
directional_shadow_max_distance = 25.0

[node name="Floor" type="StaticBody" parent="."]

Expand All @@ -61,7 +78,30 @@ material/0 = ExtResource( 1 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
shape = SubResource( 2 )

[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( -1, 3.55271e-15, -8.74228e-08, -5.61428e-08, 0.766538, 0.642199, 6.70129e-08, 0.642199, -0.766538, 0, 7.74445, 0 )
[node name="Tables" type="Spatial" parent="."]

[node name="Table01" parent="Tables" instance=ExtResource( 6 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -2 )

[node name="Cube01" parent="Tables/Table01" instance=ExtResource( 11 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.37623e-08, 1.06276, -0.271809 )

[node name="Cube02" parent="Tables/Table01" instance=ExtResource( 11 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.1888, 1.06276, -0.271809 )

[node name="Cube03" parent="Tables/Table01" instance=ExtResource( 11 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.315299, 1.06276, -0.271809 )

[node name="Cube04" parent="Tables/Table01" instance=ExtResource( 11 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.260241, 1.16977, -0.271809 )

[node name="Table02" parent="Tables" instance=ExtResource( 6 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 2.5, 0, -2 )

[node name="Table03" parent="Tables" instance=ExtResource( 6 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -2.5, 0, -2 )

[node name="Table04" parent="Tables" instance=ExtResource( 6 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -3.5, 0, -2 )

[editable path="FPController"]
24 changes: 24 additions & 0 deletions addons/godot-openxr/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
Changes to the Godot OpenXR asset
=================================

1.3.0
-------------------
- Added default interaction profiles for Samsung Odyssey, HTC Cosmos, HTC Focus and Huawei controllers.
- Added logic to enable publishing of the Godot OpenXR Android library to MavenCentral.
- Fixed invalid pose data when controllers are becoming inactive.
- Added Quest 2 controller models to the demo.
- Add support for the hand tracking aim state extension.
- OpenXR updated to 1.0.24
- Oculus OpenXR mobile SDK version 40 update.
- Added workaround for swapchain release issue.
- Added signals for all session state changes.
- Fix issue with configuring play space.

1.2.0
-------------------
- Added interaction profile for the HP Reverb G2 controllers.
- Removed deprecated `com.samsung.android.vr.application.mode` meta-data tag.
- Updated repo `README`.
- Added controller tracking confidence
- Use correct predictive timing for controllers.
- Renamed `FPSController` node of the first person controller scene to `FPController`.
- Fixed output range for the trigger and grip values.
- Improvements to swapchain format selection.

1.1.1
-------------------
- Organised all third party resources into a thirdparty folder for easy maintenance.
Expand Down
8 changes: 4 additions & 4 deletions addons/godot-openxr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Versions

Requires Godot 3.3 or later, does not (yet) work with Godot 4.
Only supports Windows and Linux.
Requires Godot 3.4 or later. OpenXR support in Godot 4 is now available in the core without the need of a plugin.
Only supports Windows (SteamVR, Oculus runtime), Linux (SteamVR, Monado) and Meta Quest.

## Using this plugin
To use this plugin make sure it is installed in `addons/godot-openxr` inside of your Godot project. Make sure to enabled the plugin in the projects dialog.

See https://github.com/GodotVR/godot_openxr/wiki for further details.
See [the Godot official documentation website](https://docs.godotengine.org/en/stable/tutorials/vr/openxr/index.html) for further details.

## Getting help
The best place to get help in using this plugin is on the very active Godot Discord #xr channel. You can find the invite link here: https://godotengine.org/community
The best place to get help in using this plugin is on the very active Godot Discord #xr channel. You can find the invite link on [the Godot community page](https://godotengine.org/community).

Please report issues here: https://github.com/GodotVR/godot_openxr/issues

Expand Down
Binary file modified addons/godot-openxr/assets/valve_hand_models/blinn1.material
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ nodes/use_legacy_names=false
materials/location=1
materials/storage=1
materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true
meshes/ensure_tangents=true
meshes/storage=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ nodes/use_legacy_names=false
materials/location=1
materials/storage=1
materials/keep_on_reimport=true
meshes/octahedral_compression=true
meshes/compress=true
meshes/ensure_tangents=true
meshes/storage=0
Expand Down
Binary file modified addons/godot-openxr/bin/android/libgodot_openxr.so
Binary file not shown.
Binary file modified addons/godot-openxr/bin/android/libopenxr_loader.so
Binary file not shown.
Binary file modified addons/godot-openxr/bin/linux/libgodot_openxr.so
Binary file not shown.
Binary file modified addons/godot-openxr/bin/win64/libgodot_openxr.dll
Binary file not shown.
Binary file modified addons/godot-openxr/bin/win64/openxr_loader.dll
Binary file not shown.
1 change: 0 additions & 1 deletion addons/godot-openxr/icon.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
2 changes: 1 addition & 1 deletion addons/godot-openxr/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Godot OpenXR"
description="Godot OpenXR plugin"
author="Christoph Haag and Bastiaan Olij"
version="1.1.0"
version="1.3.0"
script="plugin.gd"
25 changes: 19 additions & 6 deletions addons/godot-openxr/scenes/controller.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@ extends ARVRController
signal activated
signal deactivated

export var hide_for_no_tracking_confidence = false

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var should_be_visible = true
if get_is_active():
if !visible:
visible = true
if hide_for_no_tracking_confidence:
# Get the tracking confidence
var configuration = get_node("../Configuration")
if configuration:
var tracking_confidence = configuration.get_tracking_confidence(controller_id)
if tracking_confidence == 0:
should_be_visible = false
else:
should_be_visible = false

if visible != should_be_visible:
visible = should_be_visible
if should_be_visible:
print("Activated " + name)
emit_signal("activated")
elif visible:
visible = false
print("Deactivated " + name)
emit_signal("deactivated")
else:
print("Deactivated " + name)
emit_signal("deactivated")
Loading

0 comments on commit deb5ec4

Please sign in to comment.