Compare commits

...

2 Commits

Author SHA1 Message Date
Asuro
b47a0cf841 test puzzles 2025-06-21 00:26:44 +02:00
Asuro
db47297ea4 less sticky movement 2025-06-21 00:26:37 +02:00
4 changed files with 30 additions and 7 deletions

View File

@@ -318,14 +318,37 @@ namespace Game
else if (player.CameraM == CameraMode::Walk)
{
auto newTransform = player.PlayerCamTransform;
TranslateLocal(newTransform, {0.0f, 0.0f, inputVec.z});
TranslateLocal(newTransform, {inputVec.x, 0.0f, 0.0f});
// Global and local are inverted because camera
Vec3 globalInput = GlobalToLocalDirection(newTransform, {inputVec.x, 0.0f, inputVec.z});
Translate(newTransform, globalInput);
newTransform.Position.y = 3.0f;
if (IsOnGround(*this, newTransform.Position))
{
player.PlayerCamTransform = newTransform;
}
else
{
auto newTransform = player.PlayerCamTransform;
Translate(newTransform, {globalInput.x, 0.0f, 0.0f});
newTransform.Position.y = 3.0f;
if (IsOnGround(*this, newTransform.Position))
{
player.PlayerCamTransform = newTransform;
}
else
{
auto newTransform = player.PlayerCamTransform;
Translate(newTransform, {0.0f, 0.0f, globalInput.z});
newTransform.Position.y = 3.0f;
if (IsOnGround(*this, newTransform.Position))
{
player.PlayerCamTransform = newTransform;
}
}
}
player.WalkXRot += rotInput.x;
player.WalkYRot += rotInput.y;

Binary file not shown.

Binary file not shown.

Binary file not shown.