mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 13:30:07 +01:00
Based on https://docs.godotengine.org/en/stable/classes/class_webxrinterface.html and https://www.snopekgames.com/tutorial/2023/how-make-vr-game-webxr-godot-4 Co-Authored-By: David Snopek <dsnopek@gmail.com>
67 lines
2.1 KiB
Plaintext
67 lines
2.1 KiB
Plaintext
[gd_scene load_steps=7 format=3 uid="uid://dismxfxe7wvdn"]
|
|
|
|
[ext_resource type="Script" uid="uid://b71y6j7lamjqg" path="res://main.gd" id="1_ig7tw"]
|
|
|
|
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_lins3"]
|
|
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
|
|
ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
|
|
|
|
[sub_resource type="Sky" id="Sky_wiqav"]
|
|
sky_material = SubResource("ProceduralSkyMaterial_lins3")
|
|
|
|
[sub_resource type="Environment" id="Environment_6ff2h"]
|
|
background_mode = 2
|
|
sky = SubResource("Sky_wiqav")
|
|
tonemap_mode = 2
|
|
|
|
[sub_resource type="BoxMesh" id="BoxMesh_gv5m4"]
|
|
size = Vector3(0.1, 0.1, 0.1)
|
|
|
|
[sub_resource type="BoxMesh" id="BoxMesh_f3sb7"]
|
|
size = Vector3(0.1, 0.1, 0.1)
|
|
|
|
[node name="Main" type="Node3D"]
|
|
script = ExtResource("1_ig7tw")
|
|
|
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
|
environment = SubResource("Environment_6ff2h")
|
|
|
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
|
transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 0, 0)
|
|
shadow_enabled = true
|
|
|
|
[node name="XROrigin3D" type="XROrigin3D" parent="."]
|
|
|
|
[node name="XRCamera3D" type="XRCamera3D" parent="XROrigin3D"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.7, 0)
|
|
|
|
[node name="LeftController" type="XRController3D" parent="XROrigin3D"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 1, 0)
|
|
tracker = &"left_hand"
|
|
|
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="XROrigin3D/LeftController"]
|
|
mesh = SubResource("BoxMesh_gv5m4")
|
|
|
|
[node name="RightController" type="XRController3D" parent="XROrigin3D"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 1, 0)
|
|
tracker = &"right_hand"
|
|
|
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="XROrigin3D/RightController"]
|
|
mesh = SubResource("BoxMesh_f3sb7")
|
|
|
|
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
|
|
|
[node name="EnterVRButton" type="Button" parent="CanvasLayer"]
|
|
anchors_preset = 8
|
|
anchor_left = 0.5
|
|
anchor_top = 0.5
|
|
anchor_right = 0.5
|
|
anchor_bottom = 0.5
|
|
offset_left = -50.0
|
|
offset_top = -25.0
|
|
offset_right = 50.0
|
|
offset_bottom = 25.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
text = "Enter VR"
|