示例#1
0
 public override void DrawGui(LineBatch lineBatch, SpriteBatch spriteBatch)
 {
     var ray = Camera.GetWorldRay(MousePos);
     var plane = new Plane(new Vector3(0, 0, 0), new Vector3(1, 0, 0), new Vector3(0, 1, 0));
     float? distance;
     ray.Intersects(ref plane, out distance);
     if (distance != null)
     {
         var pos = ray.Position + Vector3.Multiply(ray.Direction, distance.Value);
         spriteBatch.AddText(GuiFont, 250, 0, string.Format("X={0:n2} Y={1:n2}", pos.X, pos.Y), Color.White, HorizontalAlignment.Left, VerticalAlignment.Top);
     }
 }