No CoreCLR... for now

This commit is contained in:
Simon Lübeß
2023-07-24 14:15:59 +02:00
parent 62c85e9e1f
commit 499ca0311c
13 changed files with 701 additions and 216 deletions
@@ -15,32 +15,39 @@ public class Camera : Entity
public float DontFollowRadius = 3.0f;
void OnUpdate(float deltaTime)
void OnCreate()
{
Entity player = FindEntityWithName("Player");
Log.Info("Camera Create");
}
if (player != null)
{
float2 playerPosition = player.Transform.Translation.XY;
public void OnUpdate(float deltaTime)
{
Log.Info($"Camera Update {deltaTime}");
float2 cameraPosition = Transform.Translation.XY;
//Entity player = FindEntityWithName("Player");
float2 distanceVector = playerPosition - cameraPosition;
//if (player != null)
//{
// float2 playerPosition = player.Transform.Translation.XY;
float distance = length(distanceVector);
// float2 cameraPosition = Transform.Translation.XY;
float2 neededMovement = float2.Zero;
// float2 distanceVector = playerPosition - cameraPosition;
if (distance > DontFollowRadius)
{
neededMovement = distanceVector - (distanceVector / distance) * DontFollowRadius;
}
// float distance = length(distanceVector);
Transform.Translation = new float3(cameraPosition + neededMovement, DistanceFromPlayer);
}
else
{
Log.Error("Player not found!");
}
// float2 neededMovement = float2.Zero;
// if (distance > DontFollowRadius)
// {
// neededMovement = distanceVector - (distanceVector / distance) * DontFollowRadius;
// }
// Transform.Translation = new float3(cameraPosition + neededMovement, DistanceFromPlayer);
//}
//else
//{
// Log.Error("Player not found!");
//}
}
}
@@ -3,6 +3,7 @@
"Start Editor": {
"commandName": "Executable",
"executablePath": "D:\\Development\\Projects\\Beef\\GlitchyEngine\\build\\Debug_Win64\\GlitchyEditor\\GlitchyEditor.exe",
"commandLineArgs": "\"content\\Scenes\\physics2D.scene\"",
"workingDirectory": "D:\\Development\\Projects\\Beef\\GlitchyEngine\\GlitchyEditor",
"nativeDebugging": true
}