Changeset 8490 in orxonox.OLD for trunk/src/lib/graphics/importer/bsp_manager.h
- Timestamp:
- Jun 15, 2006, 9:34:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/bsp_manager.h
r8186 r8490 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2006 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: bottac@ee.ethz.ch 13 13 14 14 Inspired by: 15 15 Rendering Q3 Maps by Morgan McGuire http://graphics.cs.brown.edu/games/quake/quake3.html 16 16 Unofficial Quake 3 Map Specs by Kekoa Proudfoot http://graphics.stanford.edu/~kekoa/q3/ 17 17 18 18 Collision detection adapted from: 19 19 Quake 3 Collision Detection by Nathan Ostgard http://www.devmaster.net/articles/quake3collision/ 20 20 */ 21 21 22 #ifndef _BSP_MANAGER_H 23 #define _BSP_MANAGER_H 24 25 22 26 #include <vector> 23 27 #include <deque> 28 29 24 30 25 31 // FORWARD DECLARATIONS … … 45 51 public: 46 52 // Constructors 47 BspManager( );48 53 BspManager(WorldEntity* parent); 54 49 55 BspManager(const char* fileName, float scale = 0.4f); 50 56 void load(const char* fileName, float scale); … … 52 58 // Functions 53 59 const void draw(); 54 void draw_debug_face(int Face); 60 const void tick(float time); 61 void draw_debug_face(int Face); 55 62 void draw_face(int Face); 56 63 void draw_patch(face* Face); 57 58 64 59 void checkCollision(WorldEntity* worldEntity); 65 66 void checkCollision(WorldEntity* worldEntity); /*!< WorldEntities use this function to check wheter they collided with the BspEntity. 67 If a collision has been detected, the collides-function of worldEntity will be called.*/ 60 68 61 69 private: 62 70 // Functions 63 71 BspTreeNode* getLeaf(BspTreeNode* node, Vector* cam) ; //!< Traverses the tree 64 void checkCollision(BspTreeNode* node, Vector* cam); 65 void checkCollisionRay(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end); 66 void checkCollisionRayN(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end); 72 void checkCollision(BspTreeNode* node, Vector* cam); //!< Obsolete. Use this function for debugging only! 73 void checkCollisionRay(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end); 74 void checkCollisionRayN(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end); 75 void TraceBox( Vector& inputStart, Vector& inputEnd,Vector& inputMins, Vector& inputMaxs ); 76 void checkCollisionBox(void); 67 77 void checkBrushRay(brush* curBrush); 68 78 void checkBrushRayN(brush* curBrush); 79 void checkBrushRayN(brush* curBrush, Vector& inputStart, Vector& inputEnd); 80 69 81 void drawDebugCube(Vector* cam); 70 82 bool isAlreadyVisible(int Face); 71 83 void addFace(int Face); 72 84 73 85 // Data 74 86 BspFile* bspFile; … … 79 91 plane* collPlane; 80 92 int lastTex; 81 82 //obsolete 93 94 //obsolete: global variables for collision detection 83 95 bool outputStartsOut; 84 96 bool outputAllSolid; 85 97 float outputFraction; 98 Vector inputStart; 99 Vector inputEnd; 86 100 101 Vector traceMins; //!< Mins of current bbox 102 Vector traceMaxs; //!< Maxs of current bbox 103 Vector traceExtents; /*!< Stores the maximum of the absolute value of each axis in the box. 104 For example, if traceMins was (-100,-3,-15) and traceMaxs was (55,22,7), traceExtents */ 105 106 WorldEntity* parent; //!< the parent entity of the bspManager: interface to this 107 87 108 bool * alreadyVisible; 88 109 // Deques to store the visible faces … … 90 111 ::std::deque<int> opal; //!< the others here. 91 112 92 Vector out; 93 Vector out1; 94 Vector out2; 113 Vector out; //!< For debugging only 114 Vector out1; //!< For debugging only 115 Vector out2; //!< For debugging only 116 117 int tgl; 95 118 }; 96 119 120 #endif /* _BSP_MANAGER_H */
Note: See TracChangeset
for help on using the changeset viewer.