1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Patrick Boenzli |
---|
13 | */ |
---|
14 | |
---|
15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_REACTION |
---|
16 | |
---|
17 | #include "collision_tube.h" |
---|
18 | |
---|
19 | #include "world_entity.h" |
---|
20 | |
---|
21 | #include "collision.h" |
---|
22 | #include "collision_event.h" |
---|
23 | #include "collision_reaction.h" |
---|
24 | |
---|
25 | #include "cr_object_damage.h" |
---|
26 | #include "cr_physics_ground_walk.h" |
---|
27 | #include "cr_physics_full_walk.h" |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | namespace CoRe |
---|
32 | { |
---|
33 | |
---|
34 | ObjectListDefinition(CollisionTube); |
---|
35 | |
---|
36 | /** |
---|
37 | * standard constructor |
---|
38 | * @todo this constructor is not jet implemented - do it |
---|
39 | */ |
---|
40 | CollisionTube::CollisionTube () |
---|
41 | { |
---|
42 | |
---|
43 | } |
---|
44 | |
---|
45 | |
---|
46 | /** |
---|
47 | * standard deconstructor |
---|
48 | */ |
---|
49 | CollisionTube::~CollisionTube () |
---|
50 | { |
---|
51 | this->_collisionList.clear(); |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | /** |
---|
56 | * registers a new CollisionEvent |
---|
57 | * @param entityA one collision object |
---|
58 | * @param entityB the other collision objectName |
---|
59 | * @param bvA bounding volume of object A |
---|
60 | * @param bvB bounding volume of object B |
---|
61 | * |
---|
62 | * this function doesn't check if the entities in question actualy are registered for any collisions |
---|
63 | */ |
---|
64 | void CollisionTube::registerCollisionEvent(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB) |
---|
65 | { |
---|
66 | Collision* collision = this->_collisionList.back(); |
---|
67 | if( collision->match(*entityA, *entityB)) |
---|
68 | {} |
---|
69 | } |
---|
70 | |
---|
71 | |
---|
72 | /** |
---|
73 | * registers a new CollisionEvent, only used by ground to object collision (eg. bsp model) |
---|
74 | * @param type type of collision as stated in cr_def.h |
---|
75 | * @param entity the WorldEntity colliding with the ground |
---|
76 | * @param groundEntity the WorldEntity representing the ground |
---|
77 | * @param normal the normal vector for the ground (up) - not always specified |
---|
78 | * @param position the position of the collision relative to the object center |
---|
79 | * @param bInWall true if the entity is in the ground material |
---|
80 | */ |
---|
81 | void CollisionTube::registerCollisionEvent(int type, WorldEntity* entity, WorldEntity* groundEntity, |
---|
82 | const Vector& normal, const Vector& position, bool bInWall) |
---|
83 | { |
---|
84 | // |
---|
85 | } |
---|
86 | |
---|
87 | /** |
---|
88 | * handles all collisions in registered in this tube |
---|
89 | */ |
---|
90 | void CollisionTube::handleCollisions() |
---|
91 | { |
---|
92 | // |
---|
93 | } |
---|
94 | |
---|
95 | |
---|
96 | } |
---|
97 | |
---|