Compare commits
No commits in common. "681c3138701f6c8f3d99a5546fcaa381c0790e64" and "a9aa7843d9fe742da3c5d99e62f87e876b706d51" have entirely different histories.
681c313870
...
a9aa7843d9
10 changed files with 10 additions and 83 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -14,11 +14,6 @@ compile_commands.json
|
|||
# Ignore addons files (copied from submodules), except uid created on import
|
||||
/project/addons/godot-xr-tools/**
|
||||
!/project/addons/godot-xr-tools/**/*.uid
|
||||
/project/addons/gdcef/**
|
||||
!/project/addons/gdcef/**/*.uid
|
||||
|
||||
# Chrome Embedded Framework binaries
|
||||
/project/cef_artifacts
|
||||
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/c++,godot,scons,python
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,godot,scons,python
|
||||
|
|
|
|||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -7,6 +7,3 @@
|
|||
[submodule "modules/godot-xr-tools"]
|
||||
path = modules/godot-xr-tools
|
||||
url = https://github.com/GodotVR/godot-xr-tools.git
|
||||
[submodule "modules/gdcef"]
|
||||
path = modules/gdcef
|
||||
url = https://github.com/Lecrapouille/gdcef.git
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ godot --dump-extension-api # after updating Godot
|
|||
python update_mavlink.py # after updating MAVLink dialect
|
||||
python update_addons.py # after changing any addon submodules
|
||||
scons compile_commands # after modifying SConstruct
|
||||
cd project/addons/gdcef; python build.py
|
||||
```
|
||||
|
||||
### Windows setup
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 76957e99ba87af9aecbde4dddc861e98f87ec43f
|
||||
|
|
@ -12,9 +12,6 @@ var _rotor_azimuth: float = 0
|
|||
@onready var connector: MarshConnector = $MarshConnector
|
||||
@onready var skeleton: Skeleton3D = $"Mi-2/Armature/Skeleton3D"
|
||||
@onready var attitude_root: Node3D = $AttitudeRoot
|
||||
@onready var tracker_mount: Node3D = $AttitudeRoot/PilotEyes/PilotFloor/TrackerMountChair
|
||||
@onready var xr_origin: XROrigin3D = $AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D
|
||||
@onready var tracker: XRController3D = $AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D/ViveTracker
|
||||
|
||||
@onready var bone_cg: int = skeleton.find_bone("BodyCG")
|
||||
@onready var bone_cyclic: int = skeleton.find_bone("Cyclic")
|
||||
|
|
@ -46,8 +43,3 @@ func _process(delta: float) -> void:
|
|||
var rotor_att := Quaternion.from_euler(Vector3(0, _rotor_azimuth, 0))
|
||||
# Note that this is reverse order, to rotate in local bone axes
|
||||
skeleton.set_bone_pose_rotation(bone_rotor, rotor_rest * rotor_att)
|
||||
|
||||
if tracker.get_has_tracking_data():
|
||||
xr_origin.transform = tracker_mount.transform * tracker.transform.affine_inverse()
|
||||
else:
|
||||
xr_origin.transform = Transform3D.IDENTITY
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://bj1s0g7ixjw71"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bj1s0g7ixjw71"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cx30pr7kn4c74" path="res://aircraft/aircraft.gd" id="1_l4uib"]
|
||||
[ext_resource type="PackedScene" uid="uid://cux4tju0ovvly" path="res://assets/mi2/Mi-2.glb" id="1_mrxe8"]
|
||||
[ext_resource type="PackedScene" uid="uid://fmygcraoturj" path="res://reference_axes.tscn" id="3_2bi7g"]
|
||||
[ext_resource type="PackedScene" uid="uid://cis4s43ubuynp" path="res://instruments.tscn" id="3_5w717"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mrxe8"]
|
||||
|
||||
|
|
@ -19,32 +17,12 @@ material_override = SubResource("StandardMaterial3D_mrxe8")
|
|||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.4, 0)
|
||||
|
||||
[node name="PilotEyes" type="Node3D" parent="AttitudeRoot"]
|
||||
editor_description = "Target position for Local XR tracking"
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0.214, -0.7, 1.594)
|
||||
editor_description = "Added only to provide a convenient point to reset XROrigin3D to"
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0.214, -0.721897, 1.53478)
|
||||
|
||||
[node name="PilotFloor" type="Node3D" parent="AttitudeRoot/PilotEyes"]
|
||||
editor_description = "Required for floor tracking
|
||||
(Varjo can only do that)"
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.8, 0)
|
||||
[node name="XROrigin3D" type="XROrigin3D" parent="AttitudeRoot/PilotEyes"]
|
||||
|
||||
[node name="TrackerMountChair" type="Node3D" parent="AttitudeRoot/PilotEyes/PilotFloor"]
|
||||
transform = Transform3D(-1, 8.74228e-08, -3.82137e-15, 0, -4.37114e-08, -1, -8.74228e-08, -1, 4.37114e-08, 0.27, 0.4, 0)
|
||||
|
||||
[node name="ReferenceAxes" parent="AttitudeRoot/PilotEyes/PilotFloor/TrackerMountChair" instance=ExtResource("3_2bi7g")]
|
||||
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0)
|
||||
|
||||
[node name="XROrigin3D" type="XROrigin3D" parent="AttitudeRoot/PilotEyes/PilotFloor"]
|
||||
|
||||
[node name="XRCamera3D" type="XRCamera3D" parent="AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D"]
|
||||
|
||||
[node name="ViveTracker" type="XRController3D" parent="AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D"]
|
||||
tracker = &"/user/vive_tracker_htcx/role/camera"
|
||||
|
||||
[node name="ReferenceAxes" parent="AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D/ViveTracker" instance=ExtResource("3_2bi7g")]
|
||||
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0)
|
||||
|
||||
[node name="Instruments" parent="AttitudeRoot" instance=ExtResource("3_5w717")]
|
||||
transform = Transform3D(-0.5, -1.27582e-08, 7.43353e-08, 4.33325e-10, 0.4923, 0.0874084, -7.5421e-08, 0.0874084, -0.4923, 0.00724897, -1.1581, 2.40391)
|
||||
[node name="XRCamera3D" type="XRCamera3D" parent="AttitudeRoot/PilotEyes/XROrigin3D"]
|
||||
|
||||
[node name="MarshConnector" type="MarshConnector" parent="."]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://crq3o0eu4y8ya"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dfcjdxesyn3l0" path="res://start_vr.gd" id="1_ig7tw"]
|
||||
[ext_resource type="Script" path="res://start_vr.gd" id="1_ig7tw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bj1s0g7ixjw71" path="res://aircraft/aircraft.tscn" id="2_0xm2m"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_7dm0k"]
|
||||
|
|
|
|||
|
|
@ -31,6 +31,6 @@ renderer/rendering_method.mobile="gl_compatibility"
|
|||
[xr]
|
||||
|
||||
openxr/enabled=true
|
||||
openxr/reference_space=2
|
||||
openxr/reference_space=0
|
||||
openxr/foveation_level=3
|
||||
shaders/enabled=true
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ func _ready() -> void:
|
|||
xr_interface.session_focussed.connect(_on_openxr_focused_state)
|
||||
xr_interface.session_stopping.connect(_on_openxr_stopping)
|
||||
xr_interface.pose_recentered.connect(_on_openxr_pose_recentered)
|
||||
XRServer.tracker_added.connect(_on_tracker_added)
|
||||
else:
|
||||
# We couldn't start OpenXR.
|
||||
print("OpenXR not instantiated!")
|
||||
|
|
@ -42,9 +41,6 @@ func _ready() -> void:
|
|||
#get_tree().quit()
|
||||
|
||||
|
||||
func _on_tracker_added(tracker_name: StringName, type: int) -> void:
|
||||
print("added tracker", tracker_name, "type", type)
|
||||
|
||||
# Handle OpenXR session ready.
|
||||
func _on_openxr_session_begun() -> void:
|
||||
# Get the reported refresh rate.
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
from os import path
|
||||
from shutil import copytree
|
||||
|
||||
# Add repository root path
|
||||
root_path = path.abspath(path.dirname(__file__))
|
||||
|
||||
# Copy the addon folder from each module
|
||||
copytree(
|
||||
path.join(root_path, 'modules', 'gdcef', 'addons'),
|
||||
path.join(root_path, 'project', 'addons'),
|
||||
dirs_exist_ok=True,
|
||||
)
|
||||
|
||||
# Configure gdcef version for precompiled binaries
|
||||
gdcef_build = path.join(root_path, 'project', 'addons', 'gdcef', 'build.py')
|
||||
gdcef_lines = []
|
||||
|
||||
with open(gdcef_build, 'r', encoding='utf-8') as file:
|
||||
gdcef_lines = file.readlines()
|
||||
|
||||
for i, line in enumerate(gdcef_lines):
|
||||
if not line.startswith('GITHUB_GDCEF_RELEASE'):
|
||||
continue
|
||||
gdcef_lines[i] = 'GITHUB_GDCEF_RELEASE = "0.16.1"\n'
|
||||
break
|
||||
|
||||
with open(gdcef_build, 'w', encoding='utf-8') as file:
|
||||
file.writelines(gdcef_lines)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue