Compare commits
2 Commits
6461b442de
...
b47a0cf841
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b47a0cf841 | ||
|
|
db47297ea4 |
@@ -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;
|
||||
|
||||
BIN
src/game/data/puzzles/0.pzl
LFS
BIN
src/game/data/puzzles/0.pzl
LFS
Binary file not shown.
BIN
src/game/data/puzzles/1.pzl
LFS
BIN
src/game/data/puzzles/1.pzl
LFS
Binary file not shown.
BIN
src/game/data/puzzles/2.pzl
LFS
BIN
src/game/data/puzzles/2.pzl
LFS
Binary file not shown.
Reference in New Issue
Block a user