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