test scene

This commit is contained in:
Snorre 2025-04-05 01:15:35 +02:00
parent 51be7cb7bc
commit bf598a7682
7 changed files with 1790 additions and 0 deletions

6
nordic25.csproj Normal file
View file

@ -0,0 +1,6 @@
<Project Sdk="Godot.NET.Sdk/4.4.0">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project>

19
nordic25.sln Normal file
View file

@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nordic25", "nordic25.csproj", "{A61E919C-5CAC-4D4C-95AE-BFD8E21B171E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A61E919C-5CAC-4D4C-95AE-BFD8E21B171E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A61E919C-5CAC-4D4C-95AE-BFD8E21B171E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A61E919C-5CAC-4D4C-95AE-BFD8E21B171E}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{A61E919C-5CAC-4D4C-95AE-BFD8E21B171E}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{A61E919C-5CAC-4D4C-95AE-BFD8E21B171E}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{A61E919C-5CAC-4D4C-95AE-BFD8E21B171E}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
EndGlobal

1713
openxr_action_map.tres Normal file

File diff suppressed because it is too large Load diff

View file

@ -17,3 +17,8 @@ config/icon="res://icon.svg"
[dotnet]
project/assembly_name="nordic25"
[xr]
openxr/enabled=true
shaders/enabled=true

19
scenes/XrOrigin3d.cs Normal file
View file

@ -0,0 +1,19 @@
using Godot;
using System;
public partial class XrOrigin3d : XROrigin3D
{
private XRInterface _xrInterface;
public override void _Ready()
{
_xrInterface = XRServer.FindInterface("OpenXR");
if (_xrInterface == null || !_xrInterface.IsInitialized())
GD.PushError("Failed to initialize OpenXR");
GD.PushError("OpenXR Initialized successfully");
DisplayServer.WindowSetVsyncMode(DisplayServer.VSyncMode.Disabled);
GetViewport().UseXR = true;
}
}

1
scenes/XrOrigin3d.cs.uid Normal file
View file

@ -0,0 +1 @@
uid://dglj0x0bpkx5i

27
scenes/test.tscn Normal file
View file

@ -0,0 +1,27 @@
[gd_scene load_steps=3 format=3 uid="uid://din25343yu8wv"]
[ext_resource type="Script" uid="uid://dglj0x0bpkx5i" path="res://scenes/XrOrigin3d.cs" id="1_errlg"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_ij1v8"]
radius = 0.01
height = 0.02
[node name="Node3D" type="Node3D"]
[node name="XROrigin3D" type="XROrigin3D" parent="."]
current = true
script = ExtResource("1_errlg")
[node name="LeftHand" type="XRController3D" parent="XROrigin3D"]
tracker = &"left_hand"
[node name="MeshInstance3D" type="MeshInstance3D" parent="XROrigin3D/LeftHand"]
mesh = SubResource("CapsuleMesh_ij1v8")
[node name="RightHand" type="XRController3D" parent="XROrigin3D"]
tracker = &"right_hand"
[node name="MeshInstance3D" type="MeshInstance3D" parent="XROrigin3D/RightHand"]
mesh = SubResource("CapsuleMesh_ij1v8")
[node name="XRCamera3D" type="XRCamera3D" parent="XROrigin3D"]