Changeset 3238 in orxonox.OLD for orxonox/branches/sound/src/collision.h
- Timestamp:
- Dec 20, 2004, 2:42:54 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/sound/src/collision.h
r2190 r3238 4 4 */ 5 5 6 #ifndef COLLISION_H7 #define COLLISION_H6 #ifndef _COLLISION_H 7 #define _COLLISION_H 8 8 9 9 #include "vector.h" … … 14 14 15 15 //! Tree structure used by the CollisionCluster 16 typedef struct CC _Tree16 typedef struct CCTree 17 17 { 18 18 unsigned long n; 19 19 union 20 20 { 21 struct CC _Tree** b;21 struct CCTree** b; 22 22 unsigned long ID; 23 23 } data; 24 24 float r; 25 25 Vector m; 26 } CC _Tree;26 } CCTree; 27 27 28 28 //! Basic collision detection class … … 42 42 class CollisionCluster { 43 43 44 CC _Tree* root;44 CCTree* root; 45 45 46 46 … … 52 52 int store (char* filename); 53 53 54 friend bool cc tree_trace( const Placement* p, CC_Tree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint);55 friend bool cc tree_iterate(const Placement* pa, CC_Tree* ta, unsigned long* ahitflags, const Placement* pb, CC_Tree* tb, unsigned long* bhitflags);56 friend bool check _trace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint);57 friend bool check _collision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags);54 friend bool ccTreeTrace( const Placement* p, CCTree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint); 55 friend bool ccTreeIterate(const Placement* pa, CCTree* ta, unsigned long* ahitflags, const Placement* pb, CCTree* tb, unsigned long* bhitflags); 56 friend bool checkTrace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint); 57 friend bool checkCollision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags); 58 58 }; 59 59 60 bool sphere _sphere_collision( Vector m1, float r1, Vector m2, float r2);61 bool trace _sphere_collision( Vector m, float r, const Line* l, Vector* impactpoint);60 bool sphereSphereCollision( Vector m1, float r1, Vector m2, float r2); 61 bool traceSphereCollision( Vector m, float r, const Line* l, Vector* impactpoint); 62 62 63 63 void setflag( unsigned long* flags, unsigned long ID); 64 64 65 void free _CC_Tree( CC_Tree* tree);66 CC _Tree* load_CC_Tree (FILE* stream);67 int save _CC_Tree (CC_Tree* tree, FILE* stream);65 void freeCCTree( CCTree* tree); 66 CCTree* loadCCTree (FILE* stream); 67 int saveCCTree (CCTree* tree, FILE* stream); 68 68 69 #endif 69 #endif /* _COLLISION_H */
Note: See TracChangeset
for help on using the changeset viewer.