2015-01-01 20:36:46 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
using Gleed2D.InGame;
|
|
|
|
|
using FarseerPhysics.SamplesFramework;
|
|
|
|
|
|
|
|
|
|
namespace Axios.Engine.Extensions
|
|
|
|
|
{
|
|
|
|
|
public static class AxiosExtensions_RectangleItemProperties
|
|
|
|
|
{
|
|
|
|
|
public static Vector2 getSimPosition(this RectangleItemProperties prop)
|
|
|
|
|
{
|
|
|
|
|
Vector2 pos = ConvertUnits.ToSimUnits(prop.Position);
|
|
|
|
|
pos.X += ConvertUnits.ToSimUnits(prop.Width / 2);
|
|
|
|
|
pos.Y += ConvertUnits.ToSimUnits(prop.Height / 2);
|
|
|
|
|
return pos;
|
|
|
|
|
}
|
2015-01-03 02:14:38 +00:00
|
|
|
|
|
|
|
|
|
public static Vector2 getCenter(this RectangleItemProperties prop)
|
|
|
|
|
{
|
|
|
|
|
return prop.getSimPosition() / ConvertUnits.ToSimUnits(2);
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-01 20:36:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|