Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10698 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Jun 14, 2007, 5:33:43 PM (17 years ago)
Author:
snellen
Message:

merged adm, hud, vs-enhancements : beni's responsible for this commit. blame him!

Location:
trunk/src/lib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_detection/aabb_tree_node.cc

    r10013 r10698  
    740740
    741741  /* DRAW POLYGONS */
    742   if( drawMode & DRAW_BV_POLYGON || drawMode & DRAW_ALL || drawMode & DRAW_BV_BLENDED)
     742  if( (drawMode & DRAW_BV_POLYGON) || (drawMode & DRAW_ALL) || (drawMode & DRAW_BV_BLENDED))
    743743  {
    744744    if (top)
  • trunk/src/lib/event/key_mapper.cc

    r10638 r10698  
    4747int KeyMapper::PEV_JUMP              = EV_UNKNOWN;
    4848int KeyMapper::PEV_ACTION            = EV_UNKNOWN;
     49int KeyMapper::PEV_CROUCH            = EV_UNKNOWN;
    4950
    5051int KeyMapper::PEV_FIRE1             = EV_UNKNOWN;
     
    8788      {&KeyMapper::PEV_JUMP,                 CONFIG_NAME_PLAYER_JUMP,            SDLK_SPACE},
    8889      {&KeyMapper::PEV_ACTION,               CONFIG_NAME_PLAYER_ACTION,          SDLK_u},
     90      {&KeyMapper::PEV_CROUCH,               CONFIG_NAME_PLAYER_CROUCH,          SDLK_LCTRL},
     91
    8992
    9093      {&KeyMapper::PEV_FIRE1,                CONFIG_NAME_PLAYER_FIRE,            EV_MOUSE_BUTTON_LEFT},
  • trunk/src/lib/event/key_mapper.h

    r10638 r10698  
    5858  static int PEV_JUMP;              //!< jump
    5959  static int PEV_ACTION;            //!< the action (or use) key
     60  static int PEV_CROUCH;            //!< crouch
    6061
    6162  static int PEV_FIRE1;             //!< fire button 1
  • trunk/src/lib/graphics/importer/bsp/bsp_manager.cc

    r10643 r10698  
    173173  // erase alreadyVisible
    174174  for(int i = 0; i < this->bspFile->numFaces; i++) this->alreadyVisible[i] = false;
    175   float tmp = 0;
     175//   float tmp = 0;
    176176  //this->opal.clear();
    177177  //this->trasparent.clear();
     
    186186
    187187  this->viewDir=    State::getCamera()->getAbsDirX();
    188   float d = (cam.x*viewDir.x + cam.y*viewDir.y + cam.z * viewDir.z);
     188//   float d = (cam.x*viewDir.x + cam.y*viewDir.y + cam.z * viewDir.z);
    189189
    190190  BspTreeNode*  ActLeaf = this->getLeaf(this->bspFile->root, &ship);
     
    254254
    255255    for(int i = 0; i <  this->bspFile->numLeafs   ; ++i ) {
    256       leaf& camLeaf =  (this->bspFile->leaves)[ActLeaf->leafIndex] ;
     256//       leaf& camLeaf =  (this->bspFile->leaves)[ActLeaf->leafIndex] ;
    257257      leaf& curLeaf =  (this->bspFile->leaves)[i] ;
    258258      int& cluster =  curLeaf.cluster;
     
    16961696
    16971697
     1698float BspManager::checkCollisionRay(Vector StartPoint, Vector Direction, float length )
     1699{
     1700  Direction.normalize(); // Oder besser vor dem Fkt-Aufruf schon normalisieren
     1701  this->outputStartsOut = true;
     1702  this->outputAllSolid = false;
     1703  this->outputFraction = 1.0f;
     1704  this->inputStart =  StartPoint;
     1705  Vector End =   StartPoint + (Direction)*length;
     1706  this->inputEnd =   End;
     1707
     1708  this->checkCollisionRayN(this->root, 0.0f, 1.0f, &StartPoint, &(End) );
     1709
     1710  return (this->outputFraction * length);
     1711
     1712}
     1713
     1714
    16981715
    16991716/**
  • trunk/src/lib/graphics/importer/bsp/bsp_manager.h

    r10618 r10698  
    7777  void checkCollision(WorldEntity* worldEntity); /*!< WorldEntities use this function to check wheter they collided with the BspEntity.
    7878                                                      If a collision has been detected, the collides-function of worldEntity will be called.*/
     79  float checkCollisionRay(Vector StartPoint, Vector Direction, float length ) ;
    7980
    8081  int sortTransparency;              //!< sort transparent textures
  • trunk/src/lib/math/quaternion.h

    r10695 r10698  
    5050
    5151    /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */
    52   inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
     52    inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
    5353    /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */
    54   inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v||this->w!=q.w))?true:false; };
     54    inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v||this->w!=q.w))?true:false; };
    5555    /** @param f: a real value @return a Quaternion containing the quotient */
    5656    inline Quaternion operator/ (const float& f) const { return (unlikely(f==0.0)) ? Quaternion() : Quaternion(this->v/f, this->w/f); };
     
    118118
    119119
    120     inline void slerpTo(const Quaternion& toQuat, float t);
     120    void slerpTo(const Quaternion& toQuat, float t);
    121121    static Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
    122122
  • trunk/src/lib/math/vector.h

    r10376 r10698  
    5151
    5252  /** @param index The index of the "array" @returns the x/y/z coordinate */
    53   inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }
     53  inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; else return this->x; }
    5454  /** @param v The vector to add @returns the addition between two vectors (this + v) */
    5555  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); };
     
    6464  /** @param v The vector to substract  @returns the substraction between two vectors (this - v) */
    6565  inline Vector operator- (const sVec3D& v) const { return Vector(x - v[0], y - v[1], z - v[2]); }
     66  /** @returns the substraction between (0, 0, 0) and this (null-this) */
     67  inline Vector operator- () const { return Vector(-x, -y, -z); }
    6668  /** @param v The vector to substract  @returns the substraction between two vectors (this -= v) */
    6769  inline const Vector& operator-= (const Vector& v) { this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this; };
Note: See TracChangeset for help on using the changeset viewer.