basic tutorial layout

This commit is contained in:
2025-10-28 14:08:41 +01:00
parent 1cafe6e96d
commit fd7b55452b
12 changed files with 1102 additions and 727 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@@ -5,11 +5,11 @@ bus/1/name = &"Music"
bus/1/solo = false bus/1/solo = false
bus/1/mute = false bus/1/mute = false
bus/1/bypass_fx = false bus/1/bypass_fx = false
bus/1/volume_db = -6.5788474 bus/1/volume_db = -15.794972
bus/1/send = &"Master" bus/1/send = &"Master"
bus/2/name = &"SFX" bus/2/name = &"SFX"
bus/2/solo = false bus/2/solo = false
bus/2/mute = false bus/2/mute = false
bus/2/bypass_fx = false bus/2/bypass_fx = false
bus/2/volume_db = -10.074136 bus/2/volume_db = -8.798218
bus/2/send = &"Master" bus/2/send = &"Master"

View File

@@ -76,7 +76,7 @@ debug/export_console_wrapper=2
binary_format/embed_pck=false binary_format/embed_pck=false
texture_format/s3tc_bptc=true texture_format/s3tc_bptc=true
texture_format/etc2_astc=false texture_format/etc2_astc=false
shader_baker/enabled=false shader_baker/enabled=true
binary_format/architecture="x86_64" binary_format/architecture="x86_64"
codesign/enable=false codesign/enable=false
codesign/timestamp=true codesign/timestamp=true

View File

@@ -39,7 +39,7 @@ volumetric_fog_anisotropy = 0.6
[node name="Main" type="Node3D"] [node name="Main" type="Node3D"]
[node name="Player" parent="." instance=ExtResource("1_2vsi6")] [node name="Player" parent="." instance=ExtResource("1_2vsi6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.21207, 64.344444, -41.363285) transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -13.104848, -53.52949, 71.105316)
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_1bvp3") environment = SubResource("Environment_1bvp3")

View File

@@ -212,6 +212,7 @@ one_shot = true
ignore_time_scale = true ignore_time_scale = true
[node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")] [node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")]
visible = false
offset_left = 1524.0 offset_left = 1524.0
offset_top = 1.0 offset_top = 1.0
offset_right = -8.0 offset_right = -8.0
@@ -251,15 +252,24 @@ expand_mode = 2
[node name="DashCooldownIndicator" type="ColorRect" parent="UI"] [node name="DashCooldownIndicator" type="ColorRect" parent="UI"]
unique_name_in_owner = true unique_name_in_owner = true
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 910.0 offset_left = 910.0
offset_top = 549.0 offset_top = 549.0
offset_right = 1010.0 offset_right = -910.0
offset_bottom = 559.0 offset_bottom = -521.0
grow_horizontal = 2
grow_vertical = 2
[node name="CenterContainer" type="CenterContainer" parent="UI"] [node name="CenterContainer" type="CenterContainer" parent="UI"]
custom_minimum_size = Vector2(1920, 1080) custom_minimum_size = Vector2(1920, 1080)
offset_right = 1919.0 anchors_preset = 15
offset_bottom = 1080.0 anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1.0
grow_horizontal = 2
grow_vertical = 2
[node name="CenterIcon" type="TextureRect" parent="UI/CenterContainer"] [node name="CenterIcon" type="TextureRect" parent="UI/CenterContainer"]
material = SubResource("CanvasItemMaterial_2q0ik") material = SubResource("CanvasItemMaterial_2q0ik")

View File

@@ -532,7 +532,7 @@ public partial class PlayerController : CharacterBody3D
public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null) public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null)
{ {
var dir = direction ?? HeadSystem.Transform.Basis * _inputMove; var dir = direction ?? Transform.Basis * HeadSystem.Transform.Basis * _inputMove;
var acceleration = dir.Length() > 0 ? accelerationFactor : decelerationFactor; var acceleration = dir.Length() > 0 ? accelerationFactor : decelerationFactor;
@@ -875,7 +875,7 @@ public partial class PlayerController : CharacterBody3D
public Vector3 GetInputGlobalHDirection() public Vector3 GetInputGlobalHDirection()
{ {
var direction = HeadSystem.Transform.Basis * _inputMove; var direction = Transform.Basis * HeadSystem.Transform.Basis * _inputMove;
return new Vector3(direction.X, 0, direction.Z).Normalized(); return new Vector3(direction.X, 0, direction.Z).Normalized();
} }

View File

@@ -154,7 +154,9 @@ copy_path="res://scenes"
[physics] [physics]
common/physics_jitter_fix=0.0
3d/physics_engine="Jolt Physics" 3d/physics_engine="Jolt Physics"
common/physics_interpolation=true
[rendering] [rendering]

View File

@@ -6,6 +6,7 @@ namespace Movementtests.systems;
public partial class HeadSystem : Node3D public partial class HeadSystem : Node3D
{ {
private Camera3D _camera; private Camera3D _camera;
private Marker3D _cameraAnchor;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")] [Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float LookSensitivity { get; set; } = 1f; public float LookSensitivity { get; set; } = 1f;
@@ -14,6 +15,7 @@ public partial class HeadSystem : Node3D
{ {
Input.SetMouseMode(Input.MouseModeEnum.Captured); Input.SetMouseMode(Input.MouseModeEnum.Captured);
_camera = GetNode<Camera3D>("CameraSmooth/Camera3D"); _camera = GetNode<Camera3D>("CameraSmooth/Camera3D");
_cameraAnchor = GetNode<Marker3D>("CameraAnchor");
} }
public void LookAround(Vector2 lookDir, float sensitivitMultiplier = 1f) public void LookAround(Vector2 lookDir, float sensitivitMultiplier = 1f)
@@ -23,11 +25,12 @@ public partial class HeadSystem : Node3D
RotateY(angleForHorizontalRotation); RotateY(angleForHorizontalRotation);
// Vertical movement of head // Vertical movement of head
Vector3 currentCameraRotation = _camera.Rotation; Vector3 currentCameraRotation = _cameraAnchor.Rotation;
currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity * sensitivitMultiplier); currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity * sensitivitMultiplier);
currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f)); currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f));
_cameraAnchor.Rotation = currentCameraRotation;
_camera.Rotation = currentCameraRotation; _camera.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated();
} }
public Vector3 GetForwardHorizontalVector() public Vector3 GetForwardHorizontalVector()

View File

@@ -16,7 +16,6 @@ script = ExtResource("1_8abgy")
[node name="CameraSmooth" type="Node3D" parent="."] [node name="CameraSmooth" type="Node3D" parent="."]
[node name="Camera3D" type="Camera3D" parent="CameraSmooth"] [node name="Camera3D" type="Camera3D" parent="CameraSmooth"]
transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0, 0)
current = true current = true
[node name="CLVignette(Layer_1)" type="CanvasLayer" parent="CameraSmooth/Camera3D"] [node name="CLVignette(Layer_1)" type="CanvasLayer" parent="CameraSmooth/Camera3D"]
@@ -57,3 +56,5 @@ mouse_filter = 2
[node name="RayCast3D" type="RayCast3D" parent="CameraSmooth/Camera3D"] [node name="RayCast3D" type="RayCast3D" parent="CameraSmooth/Camera3D"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -0.64723) transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -0.64723)
visible = false visible = false
[node name="CameraAnchor" type="Marker3D" parent="."]