UGDK
0.4.1
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
collisionobject.h
Go to the documentation of this file.
1
#ifndef PYRAMIDWORKS_COLLISION_COLLISIONOBJECT_H_
2
#define PYRAMIDWORKS_COLLISION_COLLISIONOBJECT_H_
3
4
#include <map>
5
#include <vector>
6
#include <string>
7
#include <list>
8
#include <
ugdk/math/vector2D.h
>
9
#include <
ugdk/util.h
>
10
#include <
pyramidworks/collision.h
>
11
#include <
pyramidworks/geometry.h
>
12
13
namespace
pyramidworks {
14
namespace
collision {
15
18
20
class
CollisionObject
{
21
public
:
24
CollisionObject
(
CollisionManager
* manager,
void
*data);
25
~CollisionObject
();
26
28
32
void
SearchCollisions
(std::vector<CollisionInstance> &collision_list)
const
;
33
35
37
bool
IsColliding
(
const
CollisionObject
* obj)
const
;
38
40
43
void
AddCollisionLogic
(
const
std::string& colclass,
CollisionLogic
* logic);
44
void
AddCollisionLogic
(
const
char
n[],
CollisionLogic
* logic) {
45
const
std::string str(n);
AddCollisionLogic
(str, logic);
46
}
47
49
53
void
InitializeCollisionClass
(
const
std::string&);
54
void
InitializeCollisionClass
(
const
char
n[]) {
const
std::string str(n);
InitializeCollisionClass
(str); }
55
57
void
StartColliding
();
58
60
void
StopColliding
();
61
63
64
const
geometry::GeometricShape
*
shape
()
const
{
return
shape_; };
65
67
69
void
set_shape
(
geometry::GeometricShape
*
shape
);
70
72
ugdk::Vector2D
absolute_position
()
const
{
return
position_ + offset_; }
73
75
void
MoveTo
(
const
ugdk::Vector2D
& position);
76
78
ugdk::ikdtree::Box<2>
GetBoundingBox
()
const
;
79
80
private
:
81
CollisionManager
* manager_;
82
83
// Data that is sent to CollisionLogic::Handle
84
void
*data_;
85
86
ugdk::Vector2D
position_;
87
ugdk::Vector2D
offset_;
88
89
CollisionClass
* collision_class_;
90
geometry::GeometricShape
* shape_;
91
92
bool
is_active_;
93
94
std::map<const CollisionClass*, CollisionLogic*> known_collisions_;
95
};
96
97
}
// namespace collision
98
}
// namespace pyramidworks
99
100
#endif
/* PYRAMIDWORKS_COLLISION_COLLISIONOBJECT_H_ */
src
pyramidworks
collision
collisionobject.h
Generated on Sat Oct 13 2012 02:25:11 for UGDK by
1.8.2