-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic swim demo from work performed by pietru2004.
- Loading branch information
1 parent
63f75a7
commit f0ad7c8
Showing
9 changed files
with
416 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[gd_scene load_steps=5 format=3 uid="uid://cap4i60th5v7v"] | ||
|
||
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="1_ppayj"] | ||
[ext_resource type="PackedScene" uid="uid://b45jxqo2nss1h" path="res://scenes/swim_demo/objects/instructions_2d.tscn" id="2_m8jyc"] | ||
[ext_resource type="Material" path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" id="3_corps"] | ||
|
||
[sub_resource type="BoxMesh" id="1"] | ||
material = ExtResource("3_corps") | ||
size = Vector3(4.2, 2.7, 0.1) | ||
|
||
[node name="Instructions" type="Node3D"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, -4) | ||
|
||
[node name="Viewport2Din3D" parent="." instance=ExtResource("1_ppayj")] | ||
screen_size = Vector2(4, 2.5) | ||
viewport_size = Vector2(400, 250) | ||
unshaded = true | ||
scene = ExtResource("2_m8jyc") | ||
update_mode = 0 | ||
collision_layer = 0 | ||
|
||
[node name="MeshInstance" type="MeshInstance3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.1) | ||
mesh = SubResource("1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[gd_scene format=3 uid="uid://b45jxqo2nss1h"] | ||
|
||
[node name="Instructions" type="Control"] | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
|
||
[node name="ColorRect" type="ColorRect" parent="."] | ||
layout_mode = 1 | ||
offset_right = 400.0 | ||
offset_bottom = 250.0 | ||
color = Color(0, 0, 0, 0.87451) | ||
|
||
[node name="Description" type="RichTextLabel" parent="."] | ||
layout_mode = 0 | ||
offset_left = 10.0 | ||
offset_top = 10.0 | ||
offset_right = 390.0 | ||
offset_bottom = 240.0 | ||
theme_override_constants/line_separation = -3 | ||
theme_override_font_sizes/normal_font_size = 12 | ||
text = "Swim Demo | ||
This scene demonstrates example swimming. Advanced rendering options such as Volume Fog can be added based on the choice of renderer. | ||
> Left Controller: | ||
- Direct Movement: U/D/L/R Joystick | ||
- Flight Movement: U/D/L/R Joystick | ||
> Right Controller: | ||
- Direct Movement: U/D Joystick | ||
- Turning: L/R Joystick | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
extends Area3D | ||
|
||
func _on_body_entered(body): | ||
if body is XRToolsPlayerBody: | ||
if !body.get_parent().has_node("MovementFlight"): | ||
printerr("Flight Area tried to find MovementFlight, but it could not...") | ||
return | ||
body.get_parent().get_node("MovementFlight").set_flying(true) | ||
|
||
|
||
func _on_body_exited(body): | ||
if body is XRToolsPlayerBody: | ||
if !body.get_parent().has_node("MovementFlight"): | ||
printerr("Flight Area tried to find MovementFlight, but it could not...") | ||
return | ||
body.get_parent().get_node("MovementFlight").set_flying(false) |
Oops, something went wrong.