Started work on data viewer

This commit is contained in:
2024-12-04 19:06:55 -08:00
parent 8ddfe86750
commit 7a6cea145d
3 changed files with 250 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using GameJamDungeon;
using Godot;
using System;
[Meta(typeof(IAutoNode))]
public partial class DataViewer : Control
{
public override void _Notification(int what) => this.Notify(what);
[Export]
public float _cameraSpeed = 0.01f;
[Node] public Node3D CameraPivot { get; set; } = default!;
[Node] public Camera3D Camera3D { get; set; } = default!;
[Node] public Node3D ModelPivot { get; set; } = default!;
[Node] public Label RotationLabel { get; set; } = default!;
public override void _Process(double delta)
{
if (Input.IsActionPressed(GameInputs.MoveLeft))
CameraPivot.RotateY(_cameraSpeed);
if (Input.IsActionPressed(GameInputs.MoveRight))
CameraPivot.RotateY(-_cameraSpeed);
if (Input.IsActionPressed(GameInputs.MoveUp))
ModelPivot.RotateX(-_cameraSpeed);
if (Input.IsActionPressed(GameInputs.MoveDown))
ModelPivot.RotateX(_cameraSpeed);
if (Input.IsActionPressed(GameInputs.StrafeLeft))
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, (float)delta * 2f);
if (Input.IsActionPressed(GameInputs.StrafeRight))
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, -(float)delta * 2f);
Camera3D.Position = Camera3D.Position.Clamp(new Vector3(0, 0, 1), new Vector3(0, 0, 4));
ModelPivot.Rotation = ModelPivot.Rotation.Clamp(Mathf.DegToRad(-60), Mathf.DegToRad(60));
}
}

File diff suppressed because one or more lines are too long

View File

@@ -380,9 +380,9 @@ fov = 45.0
near = 0.001
[node name="OmniLight3D" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.57563, 0.620484)
omni_range = 16.633
omni_attenuation = 0.27
transform = Transform3D(0.999997, 0, 0.00260054, 0, 1, 0, -0.00260054, 0, 0.999997, 0.0645475, 1.47228, 0.55925)
omni_range = 4.09
omni_attenuation = -0.299
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
@@ -414,3 +414,11 @@ layers = 2
pixel_size = 0.025
axis = 1
texture = ExtResource("7_8hi2n")
[node name="SpotLight3D" type="SpotLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.225891, 1.46089, -0.122746)
light_size = 0.319
spot_range = 11.4821
spot_attenuation = -0.67
spot_angle = 70.0
spot_angle_attenuation = 2.0