Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8213 in orxonox.OLD for branches/bsp_model/src/lib/graphics


Ignore:
Timestamp:
Jun 7, 2006, 9:06:41 PM (18 years ago)
Author:
patrick
Message:

bsp: integrating the bspmanager fully into the collision detection/reaction system

Location:
branches/bsp_model/src/lib/graphics/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8204 r8213  
    7777void BspManager::load(const char* fileName, float scale)
    7878{
    79   //this->setClassID(CL_BSP_MODEL, "BspManager");
     79  this->setClassID(CL_BSP_MODEL, "BspManager");
    8080  // open a BSP file
    8181  this->bspFile = new BspFile();
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.h

    r8195 r8213  
    11/*
    22   orxonox - the future of 3D-vertical-scrollers
    3  
     3
    44   Copyright (C) 2006 orx
    5  
     5
    66   This program is free software; you can redistribute it and/or modify
    77   it under the terms of the GNU General Public License as published by
    88   the Free Software Foundation; either version 2, or (at your option)
    99   any later version.
    10  
     10
    1111   ### File Specific:
    1212   main-programmer: bottac@ee.ethz.ch
    13    
     13
    1414   Inspired by:
    1515   Rendering Q3 Maps by Morgan McGuire                  http://graphics.cs.brown.edu/games/quake/quake3.html
    1616   Unofficial Quake 3 Map Specs by Kekoa Proudfoot      http://graphics.stanford.edu/~kekoa/q3/
    17    
     17
    1818   Collision detection adapted from:
    1919   Quake 3 Collision Detection by Nathan Ostgard        http://www.devmaster.net/articles/quake3collision/
     
    2222#include <vector>
    2323#include <deque>
     24
     25#include "base_object.h"
    2426
    2527// FORWARD DECLARATIONS
     
    4143};
    4244
    43 class BspManager
     45class BspManager : public BaseObject
    4446{
    4547public:
    4648  // Constructors
    4749  BspManager();
    48  
     50
    4951  BspManager(const char* fileName, float scale = 0.4f);
    5052  void load(const char* fileName, float scale);
     
    5355  const void draw();
    5456  const void tick(float time);
    55   void draw_debug_face(int Face); 
     57  void draw_debug_face(int Face);
    5658  void draw_face(int Face);
    5759  void draw_patch(face* Face);
    58  
     60
    5961
    6062  void checkCollision(WorldEntity* worldEntity); /*!< WorldEntities use this function to check wheter they collided with the BSPEntity.
     
    6567  BspTreeNode* getLeaf(BspTreeNode*  node,   Vector* cam) ;  //!< Traverses the tree
    6668  void  checkCollision(BspTreeNode* node, Vector* cam); //!< Obsolete. Use this function for debugging only!
    67   void  checkCollisionRay(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end); 
     69  void  checkCollisionRay(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end);
    6870  void  checkCollisionRayN(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end);
    6971  void TraceBox( Vector& inputStart, Vector& inputEnd,Vector& inputMins, Vector& inputMaxs );
     
    7476  bool isAlreadyVisible(int Face);
    7577  void addFace(int Face);
    76  
     78
    7779  // Data
    7880  BspFile*  bspFile;
     
    8385  plane* collPlane;
    8486  int lastTex;
    85  
     87
    8688  //obsolete: global variables for collision detection
    8789  bool  outputStartsOut;
     
    9092  Vector traceMins; //!< Mins of current bbox
    9193  Vector traceMaxs; //!< Maxs of current bbox
    92   Vector traceExtents; /*!< Stores the maximum of the absolute value of each axis in the box. 
     94  Vector traceExtents; /*!< Stores the maximum of the absolute value of each axis in the box.
    9395                            For example, if traceMins was (-100,-3,-15) and traceMaxs was (55,22,7), traceExtents */
    94  
    95  
     96
     97
    9698  bool * alreadyVisible;
    9799  // Deques to store the visible faces
     
    100102
    101103  Vector out;  //!< For debugging only
    102   Vector out1; //!< For debugging only 
     104  Vector out1; //!< For debugging only
    103105  Vector out2; //!< For debugging only
    104106};
Note: See TracChangeset for help on using the changeset viewer.