Adding MouseAimVector to AGS
Removing Camera extension
This commit is contained in:
parent
1b5f1bfaf9
commit
719b450343
@ -117,6 +117,7 @@
|
|||||||
* - Adding AddScreen method to ScreenManager to make the PlayerIndex optional (default of PlayerIndex.One)
|
* - Adding AddScreen method to ScreenManager to make the PlayerIndex optional (default of PlayerIndex.One)
|
||||||
* - Adding visible flag to DrawableAxiosGameObject and SimpleDrawableAxiosGameObject
|
* - Adding visible flag to DrawableAxiosGameObject and SimpleDrawableAxiosGameObject
|
||||||
* - Adding extension to mousestate (Position) to get a Vector2 object of the position
|
* - Adding extension to mousestate (Position) to get a Vector2 object of the position
|
||||||
|
* - Added MouseAimVector to AGS - this allows you to get a vector to "shoot" with (realtive to the mouse and another object) a LinearVelocity in Farseer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -11,7 +11,9 @@ using Microsoft.Xna.Framework;
|
|||||||
using Microsoft.Xna.Framework.Content;
|
using Microsoft.Xna.Framework.Content;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using GameStateManagement;
|
using GameStateManagement;
|
||||||
|
using Microsoft.Xna.Framework.Input;
|
||||||
using Axios.Engine.Gleed2D;
|
using Axios.Engine.Gleed2D;
|
||||||
|
using Axios.Engine.Extensions;
|
||||||
|
|
||||||
namespace Axios.Engine
|
namespace Axios.Engine
|
||||||
{
|
{
|
||||||
@ -66,6 +68,14 @@ namespace Axios.Engine
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector2 MouseAimVector(MouseState ms, Vector2 relativeposition)
|
||||||
|
{
|
||||||
|
Vector2 ret;
|
||||||
|
ret = this.Camera.ConvertScreenToWorld(ms.Position()) - relativeposition;
|
||||||
|
ret.Normalize();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/*public void AddGameObject<T>(T gameobject)
|
/*public void AddGameObject<T>(T gameobject)
|
||||||
{
|
{
|
||||||
if (gameobject is AxiosGameObject || gameobject is AxiosUIObject)
|
if (gameobject is AxiosGameObject || gameobject is AxiosUIObject)
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Axios.Engine.Extensions
|
|
||||||
{
|
|
||||||
public static class Camera
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user