UGDK
0.4.1
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
rect.h
Go to the documentation of this file.
1
#ifndef PYRAMIDWORKS_GEOMETRY_RECT_H_
2
#define PYRAMIDWORKS_GEOMETRY_RECT_H_
3
4
#include <
pyramidworks/geometry/geometricshape.h
>
5
6
namespace
pyramidworks {
7
namespace
geometry {
8
11
class
Rect
:
public
GeometricShape
{
12
public
:
15
Rect
(
double
_width,
double
_height) :
GeometricShape
(), half_width_(_width/2), half_height_(_height/2) {}
16
18
19
double
width
()
const
{
return
2*half_width_; }
20
22
23
double
height
()
const
{
return
2*half_height_; }
24
25
bool
Intersects
(
const
ugdk::Vector2D
& this_pos,
const
GeometricShape
*obj,
const
ugdk::Vector2D
& that_pos)
const
;
26
bool
Intersects
(
const
ugdk::Vector2D
& this_pos,
const
Rect
*obj,
const
ugdk::Vector2D
& that_pos)
const
;
27
bool
Intersects
(
const
ugdk::Vector2D
& this_pos,
const
Circle
*obj,
const
ugdk::Vector2D
& that_pos)
const
;
28
bool
Intersects
(
const
ugdk::Vector2D
& this_pos,
const
ConvexPolygon
*obj,
const
ugdk::Vector2D
& that_pos)
const
;
29
ugdk::ikdtree::Box<2>
GetBoundingBox
(
const
ugdk::Vector2D
& position)
const
;
30
31
private
:
32
double
half_width_, half_height_;
33
};
34
35
}
// namespace geometry
36
}
// namespace pyramidworks
37
38
39
#endif
/* PYRAMIDWORKS_GEOMETRY_RECT_H_ */
src
pyramidworks
geometry
rect.h
Generated on Sat Oct 13 2012 02:25:11 for UGDK by
1.8.2