axiosengine 

axiosengine Commit Details


Date:2012-03-23 23:21:26 (12 years 6 months ago)
Author:nathan@daedalus
Branch:master
Commit:1d8e6f1493175327cdb8fed9a824324b1005b1cb
Parents: f4b91c0fc31473a11e5e24d36e90f05b624672bb
Message:Adding support for intersecting a floating point rectangle

Changes:

File differences

axios/Axios_WP7.csproj
179179
180180
181181
182
182183
183184
184185
<Compile Include="Engine\SimpleAxiosGameObject.cs" />
<Compile Include="Engine\SimpleDrawableAxiosGameObject.cs" />
<Compile Include="Engine\Singleton.cs" />
<Compile Include="Engine\Structures\AxiosPoint.cs" />
<Compile Include="Engine\Structures\AxiosRectangle.cs" />
<Compile Include="Engine\UI\AxiosButton.cs" />
<Compile Include="Engine\UI\AxiosUIObject.cs" />
axios/Axios_Windows.csproj
219219
220220
221221
222
222223
223224
224225
<Compile Include="Engine\Interfaces\IAxiosGameObject.cs" />
<Compile Include="Engine\Interfaces\IDrawableAxiosGameObject.cs" />
<Compile Include="Engine\Log\AxiosLog.cs" />
<Compile Include="Engine\Structures\AxiosPoint.cs" />
<Compile Include="Engine\Structures\AxiosRectangle.cs" />
<Compile Include="Engine\SimpleAxiosGameObject.cs" />
<Compile Include="Engine\SimpleDrawableAxiosGameObject.cs" />
axios/Axios_Xbox_360.csproj
172172
173173
174174
175
175176
176177
177178
<Compile Include="Engine\SimpleAxiosGameObject.cs" />
<Compile Include="Engine\SimpleDrawableAxiosGameObject.cs" />
<Compile Include="Engine\Singleton.cs" />
<Compile Include="Engine\Structures\AxiosPoint.cs" />
<Compile Include="Engine\Structures\AxiosRectangle.cs" />
<Compile Include="Engine\UI\AxiosButton.cs" />
<Compile Include="Engine\UI\AxiosUIObject.cs" />
axios/Engine/Structures/AxiosPoint.cs
77
88
99
10
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
1130
1231
{
class AxiosPoint
{
private float _x;
private float _y;
public float X
{
get { return _x; }
set { _x = value; }
}
public float Y
{
get { return _y; }
set { _y = value; }
}
public AxiosPoint(float X, float Y)
{
_x = X;
_y = Y;
}
}
}
axios/Engine/Structures/AxiosRectangle.cs
77
88
99
10
11
1012
1113
12
13
14
1415
1516
1617
......
2425
2526
2627
27
28
2829
29
30
30
3131
3232
33
33
3434
35
36
35
3736
3837
39
38
4039
41
40
4241
4342
4443
4544
46
45
4746
4847
49
48
5049
51
50
51
5252
53
54
55
5356
57
58
59
60
61
62
63
64
5465
55
66
5667
5768
5869
5970
6071
6172
62
63
73
6474
6575
6676
{
class AxiosRectangle
{
private AxiosPoint _point;
private float _width;
private float _height;
private float _x;
private float _y;
public float Width
{
set { _height = value; }
}
public float X
public float Top
{
get { return _x; }
set { _x = value; }
get { return _point.Y; }
}
public float Y
public float Right
{
get { return _y; }
set { _y = value; }
get { return _point.X + _width; }
}
public float Top
public float Left
{
get { return _point.X; }
}
public float Bottom
{
get { return _y + _height; }
get { return _point.Y + _height; }
}
public bool Intersect(AxiosRectangle rect)
/*public AxiosPoint Center
{
bool intersects = false;
get { return new AxiosPoint(Top + (Width / 2), Bottom - (Width / 2)); }
}*/
public bool Intersect(AxiosRectangle rect)
{
//bool intersects = true;
if (Bottom < rect.Top)
return false;
if (Top > rect.Bottom)
return false;
if (Right < rect.Left)
return false;
if (Left > rect.Right)
return false;
return intersects;
return true;
}
public AxiosRectangle(float X, float Y, float width, float height)
{
_width = width;
_height = height;
_x = X;
_y = Y;
_point = new AxiosPoint(X, Y);
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.07589s using 13 queries.