keyboard controls

skybox_example
cosmonaut 2021-01-11 19:51:48 -08:00
parent a654a5f9a3
commit 72d960806a
1 changed files with 20 additions and 1 deletions

View File

@ -50,7 +50,26 @@ namespace KavTest.Engines
if (SomeComponent<PerspectiveCameraComponent>())
{
var cameraEntity = ReadEntity<PerspectiveCameraComponent>();
SendMessage(new RotateCameraMessage(cameraEntity, -mouseState.X, -mouseState.Y));
if (keyboardState.IsKeyDown(Keys.I))
{
SendMessage(new RotateCameraMessage(cameraEntity, 0, 3));
}
if (keyboardState.IsKeyDown(Keys.K))
{
SendMessage(new RotateCameraMessage(cameraEntity, 0, -3));
}
if (keyboardState.IsKeyDown(Keys.J))
{
SendMessage(new RotateCameraMessage(cameraEntity, 3, 0));
}
if (keyboardState.IsKeyDown(Keys.L))
{
SendMessage(new RotateCameraMessage(cameraEntity, -3, 0));
}
}
}
}