protected override void Update(GameTime gameTime)
{
UpdateAvatarPosition();
// use mouse navigation
var w = Form.Width;
var h = Form.Height;
if (w != 0 && h != 0 && Form.ActiveForm == Form)
{
var x = Mouse.GetState().X;
var y = Mouse.GetState().Y;
var cx = w/2;
var cy = h/2;
avatarPitch += (y - cy) * MouseSensitivity;
avatarYaw += (cx - x) * MouseSensitivity;
Mouse.SetPosition(cx, cy); // move back to center
}
//var ray = new Ray(_avatarPosition, Vector3.Down);
//collider = new Triangle(Vector3.UnitX, Vector3.UnitY, Vector3.UnitZ);
//var list = tree.GetPotentialColliders(ray, float.MaxValue);
//foreach (var shape in list)
//{
// if (!shape.IntersectsWith(ray).HasValue) continue;
// collider = (Triangle)shape;
// break;
//}
base.Update(gameTime);
}