Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/bsp_model/src/lib/graphics/importer/bsp_manager.h @ 8030

Last change on this file since 8030 was 8030, checked in by bottac, 18 years ago

bsp_manager now knows the normals of the planes into which an obj collided.

File size: 1.7 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3 
4   Copyright (C) 2006 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: bottac@ee.ethz.ch
13*/
14
15#include <vector>
16#include <deque>
17
18
19// FORWARD DECLARATIONS
20class  BspFile;
21class BspTreeLeaf;
22class BspTreeNode;
23class Vector;
24class set;
25struct face;
26struct brush;
27struct plane;
28
29class WorldEntity;
30
31class BspManager
32{
33public:
34  // Constructors
35  BspManager();
36
37  // Functions
38  void draw();
39  void draw_debug_face(int Face); 
40  void draw_face(int Face);
41  void draw_patch(face* Face);
42
43  void checkCollision(WorldEntity* worldEntity);
44
45private:
46  // Functions
47  BspTreeNode* getLeaf(BspTreeNode*  node,   Vector* cam) ;  //!< Traverses the tree
48  void  checkCollision(BspTreeNode* node, Vector* cam);
49  void  checkCollisionRay(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end); 
50  void  checkBrushRay(brush* curBrush);
51  void drawDebugCube(Vector* cam);
52  bool isAlreadyVisible(int Face);
53  void addFace(int Face);
54 
55  // Data
56  BspFile*  bspFile;
57  BspTreeNode* root;
58  Vector cam;
59  Vector ship;
60  Vector  viewDir;
61  plane* collPlane;
62  int lastTex;
63 
64  //obsolete
65  bool  outputStartsOut;
66  bool  outputAllSolid;
67  float outputFraction;
68 
69  bool * alreadyVisible;
70  // Deques to store the visible faces
71  ::std::deque<int> trasparent; //!< the ones with transparancy go here
72  ::std::deque<int> opal; //!< the others here.
73
74  Vector out;
75  Vector out1;
76  Vector out2;
77};
78
Note: See TracBrowser for help on using the repository browser.