testing mouselook stuff
parent
a4a2a8e719
commit
c97df29e28
|
@ -25,7 +25,7 @@ namespace KavTest.Engines
|
|||
|
||||
foreach (var rotateMessage in ReadMessages<RotateCameraMessage>())
|
||||
{
|
||||
transform = transform.RotateLocal(-rotateMessage.Yaw * 0.25f * (float)dt, rotateMessage.Pitch * 0.25f * (float)dt);
|
||||
transform = transform.RotateLocal(rotateMessage.Yaw * 0.25f * (float)dt, rotateMessage.Pitch * 0.25f * (float)dt);
|
||||
}
|
||||
|
||||
SetComponent(cameraEntity, new ArcballTransformComponent(transform));
|
||||
|
|
|
@ -18,18 +18,21 @@ namespace KavTest.Engines
|
|||
|
||||
public InputEngine(int centerX, int centerY)
|
||||
{
|
||||
System.Console.WriteLine(centerX);
|
||||
System.Console.WriteLine(centerY);
|
||||
this.centerX = centerX;
|
||||
this.centerY = centerY;
|
||||
Mouse.SetPosition(centerX, centerY);
|
||||
System.Console.WriteLine("initialize mouse position");
|
||||
System.Console.WriteLine(Mouse.GetState().X);
|
||||
System.Console.WriteLine(Mouse.GetState().Y);
|
||||
}
|
||||
|
||||
public override void Update(double dt)
|
||||
{
|
||||
var keyboardState = Keyboard.GetState();
|
||||
var mouseState = Mouse.GetState();
|
||||
System.Console.WriteLine("mouse position");
|
||||
System.Console.WriteLine(mouseState.X);
|
||||
System.Console.WriteLine(mouseState.Y);
|
||||
|
||||
if (keyboardState.IsKeyDown(Keys.W))
|
||||
{
|
||||
|
|
|
@ -31,6 +31,18 @@ namespace KavTest
|
|||
|
||||
protected override void LoadContent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void UnloadContent()
|
||||
{
|
||||
base.UnloadContent();
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
var rustyBallModel = Kav.ModelLoader.Load(
|
||||
GraphicsDevice,
|
||||
Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/rustysphere.glb"))
|
||||
|
@ -85,11 +97,6 @@ namespace KavTest
|
|||
World = WorldBuilder.Build();
|
||||
}
|
||||
|
||||
protected override void UnloadContent()
|
||||
{
|
||||
base.UnloadContent();
|
||||
}
|
||||
|
||||
protected override void Update(GameTime gameTime)
|
||||
{
|
||||
World.Update(gameTime.ElapsedGameTime.TotalSeconds);
|
||||
|
|
Loading…
Reference in New Issue