main
trashbyte 2023-08-20 18:43:22 -07:00
commit 252d52c86f
19 changed files with 278 additions and 0 deletions

2
.gitattributes vendored 100644
View File

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

4
.gitignore vendored 100644
View File

@ -0,0 +1,4 @@
# Godot 4+ specific ignores
.godot/
.vs/

Binary file not shown.

View File

@ -0,0 +1,6 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bts702ltutin6"]
[ext_resource type="Texture2D" uid="uid://cywlxpcb22pgp" path="res://Environment/T_TestGrid.png" id="1_uabna"]
[resource]
albedo_texture = ExtResource("1_uabna")

View File

@ -0,0 +1,17 @@
shader_type spatial;
render_mode skip_vertex_transform;
varying vec3 world_pos;
uniform sampler2D albedo : source_color,filter_nearest_mipmap_anisotropic;
void vertex() {
world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
NORMAL = normalize((MODELVIEW_MATRIX * vec4(NORMAL, 0.0)).xyz);
}
void fragment() {
ALBEDO = texture(albedo, world_pos.xz).xyz;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cywlxpcb22pgp"
path="res://.godot/imported/T_TestGrid.png-ebd533d215a8ac8ec541cf0294a0054c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Planetside/Environment/T_TestGrid.png"
dest_files=["res://.godot/imported/T_TestGrid.png-ebd533d215a8ac8ec541cf0294a0054c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://88bfgalc6tw1"]
[ext_resource type="Material" uid="uid://bx3q1wj2uqb4i" path="res://Environment/M_TestGrid.tres" id="1_hbgop"]
[sub_resource type="PlaneMesh" id="PlaneMesh_1shdn"]
[node name="Node3D" type="Node3D"]
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(50, 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0)
mesh = SubResource("PlaneMesh_1shdn")
surface_material_override/0 = ExtResource("1_hbgop")

Binary file not shown.

View File

@ -0,0 +1,48 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bgqhmlshc8pu"
path="res://.godot/imported/SM_SpaceSkybox.blend-8cda7be617369dd216b30ba0cefd9362.scn"
[deps]
source_file="res://Spaceflight/Environment/SM_SpaceSkybox.blend"
dest_files=["res://.godot/imported/SM_SpaceSkybox.blend-8cda7be617369dd216b30ba0cefd9362.scn"]
[params]
nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1
blender/nodes/visible=0
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b4yiqwschhsb7"
path.s3tc="res://.godot/imported/T_StarsTemp.png-c796aeeb6d0259f4c571d9a727a7ddbb.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Spaceflight/Environment/T_StarsTemp.png"
dest_files=["res://.godot/imported/T_StarsTemp.png-c796aeeb6d0259f4c571d9a727a7ddbb.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://mffl7glgme2h"]
[ext_resource type="Script" path="res://Spaceflight/Scripts/FlightController.cs" id="1_t3b02"]
[node name="SpacePlayer" type="Node3D"]
script = ExtResource("1_t3b02")
[node name="MainCamera" type="Camera3D" parent="."]

View File

@ -0,0 +1,52 @@
using Godot;
using System;
public partial class FlightController : Node3D {
Camera3D PlayerCam;
Vector3 AngularVelocity;
public override void _Ready() {
this.PlayerCam = this.GetNode<Camera3D>("MainCamera");
this.PlayerCam.Current = true;
Input.MouseMode = Input.MouseModeEnum.Hidden;
}
public override void _Process(double deltaSeconds) {
Vector2 currentMousePos = GetViewport().GetMousePosition();
Vector2I center = GetViewport().GetWindow().Size / 2;
Vector2 centerFloat = new(center.X, center.Y);
Vector2 delta = (currentMousePos - centerFloat) * (float)deltaSeconds;
Input.WarpMouse(center);
if (delta != Vector2.Zero) {
Quaternion quat = new Quaternion(this.GlobalTransform.Basis);
Vector3 LocalAccel = new Vector3(delta.Y, delta.X, 0f) * 3f * (float)deltaSeconds;
if (quat.GetAxis().LengthSquared() != 0f) {
this.AngularVelocity -= LocalAccel.Rotated(quat.GetAxis().Normalized(), quat.GetAngle());
}
else {
this.AngularVelocity -= LocalAccel;
}
}
this.AngularVelocity *= (float)(1.0 - deltaSeconds * 2.0);
if (this.AngularVelocity.Length() > 0f) {
Quaternion rotationThisFrame = Quaternion.FromEuler(this.AngularVelocity * (float)deltaSeconds);
if (rotationThisFrame.GetAxis().Normalized().LengthSquared() != 0f) {
this.GlobalRotate(rotationThisFrame.GetAxis().Normalized(), rotationThisFrame.GetAngle());
}
}
}
public override void _Input(InputEvent @event) {
base._Input(@event);
if (@event is InputEventKey keyEvent) {
if (keyEvent.Keycode == Key.Escape) {
GetTree().Root.PropagateNotification((int)NotificationWMCloseRequest);
GetTree().Quit();
}
}
}
}

View File

@ -0,0 +1,16 @@
[gd_scene load_steps=4 format=3 uid="uid://681x341bmq7u"]
[ext_resource type="PackedScene" uid="uid://mffl7glgme2h" path="res://Spaceflight/Prefabs/SpacePlayer.tscn" id="1_cwxy4"]
[ext_resource type="PackedScene" uid="uid://bgqhmlshc8pu" path="res://Spaceflight/Environment/SM_SpaceSkybox.blend" id="2_3sifq"]
[sub_resource type="Environment" id="Environment_owpo5"]
[node name="SpaceTest" type="Node3D"]
[node name="SpacePlayer" parent="." instance=ExtResource("1_cwxy4")]
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_owpo5")
[node name="SM_SpaceSkybox" parent="." instance=ExtResource("2_3sifq")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.221079, 0, 0.640379)

19
project.godot 100644
View File

@ -0,0 +1,19 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="spes"
run/main_scene="res://Spaceflight/SpaceTest.tscn"
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
[dotnet]
project/assembly_name="spes"

6
spes.csproj 100644
View File

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

19
spes.sln 100644
View File

@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spes", "spes.csproj", "{AFC9987A-26DA-4E87-8A0F-9D4086123DFB}"
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
{AFC9987A-26DA-4E87-8A0F-9D4086123DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFC9987A-26DA-4E87-8A0F-9D4086123DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFC9987A-26DA-4E87-8A0F-9D4086123DFB}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{AFC9987A-26DA-4E87-8A0F-9D4086123DFB}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{AFC9987A-26DA-4E87-8A0F-9D4086123DFB}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{AFC9987A-26DA-4E87-8A0F-9D4086123DFB}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
EndGlobal