Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8907 in orxonox.OLD for branches/single_player_map


Ignore:
Timestamp:
Jun 29, 2006, 2:10:27 PM (18 years ago)
Author:
bottac
Message:

further bugs fixed.

Location:
branches/single_player_map/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc

    r8894 r8907  
    2323#include "world_entity.h"
    2424#include "cr_physics_ground_walk.h"
     25#include "collision_reaction.h"
    2526
    2627#include <vector>
     
    7273  WorldEntity* entity = collision->getEntityB();
    7374
    74   // collision position maths
    75   Vector collPos =  collision->getEntityB()->getAbsCoor()  + box->center - ce->getCollisionPosition();
    76 
    77   float CR_MAX_WALK_HEIGHT = 2.0f;
    78   float CR_THRESHOLD = 0.2f;
    79 
    8075  if( box == NULL)
    8176  {
     
    8378    return;
    8479  }
     80 
     81 
     82  // collision position maths
     83  Vector collPos =  collision->getEntityB()->getAbsCoor()  + box->center - ce->getCollisionPosition();
     84
     85  float CR_MAX_WALK_HEIGHT = 2.0f;
     86  float CR_THRESHOLD = 0.2f;
     87
    8588
    8689
     
    8992    case COLLISION_TYPE_AXIS_Y:
    9093
    91       height = collPos.y - box->halfLength[1];
    92      // PRINTF(0)("height: %f          , model height: %f\n", height, box->halfLength[1]);
    93      // PRINTF(0)(" ground normal: %f, %f, %f\n", normal.x, normal.y, normal.z);
    94 
    95       // object is beneath the plane (ground)
    96       if( height <= 0.0f )
    97       {
    98         entity->shiftCoor(Vector(0, -height, 0));
    99       }
    100       // object is already in the wall
    101       else if( ce->isInWall())
    102       {
    103         entity->setAbsCoor(entity->getLastAbsCoor());
    104       }
    105       break;
    106 
     94//       height = collPos.y - box->halfLength[1];
     95//      PRINTF(0)("height: %f          , model height: %f\n", height, box->halfLength[1]);
     96//      PRINTF(0)(" ground normal: %f, %f, %f\n", normal.x, normal.y, normal.z);
     97//
     98//       // object is beneath the plane (ground)
     99//       if( height <= 0.0f )
     100//       {
     101//         entity->shiftCoor(Vector(0, -height, 0));
     102//       }
     103//       // object is already in the wall
     104//       else if( ce->isInWall())
     105//       {
     106//         entity->setAbsCoor(entity->getLastAbsCoor());
     107//       }
     108//       break;
     109//
    107110
    108111    case COLLISION_TYPE_AXIS_X:
  • branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc

    r8904 r8907  
    9191  this->bspFile->scale =  scale;
    9292  if(this->bspFile->read(ResourceManager::getFullName(fileName).c_str()) == -1)
    93     return -1;
     93  return -1;
     94 
    9495  this->bspFile->build_tree();
    9596  this->root  = this->bspFile->get_root();
  • branches/single_player_map/src/world_entities/bsp_entity.cc

    r8904 r8907  
    3939BspEntity::~BspEntity ()
    4040{
    41   if( this->bspManager)
     41  if( this->bspManager != NULL)
    4242    delete this->bspManager;
    4343}
     
    5151void BspEntity::init()
    5252{
    53   this->setClassID(CL_BSP_ENTITY, "BspEntity");
     53
    5454  this->bspManager = NULL;
    5555  /**
     
    6464
    6565  // Check wether file exists....
    66   if ( File(ResourceManager::getFullName(name)).exists()  ){
    67     // War das Laden erfolgreich?
     66  if ( File(ResourceManager::getFullName(name)).exists()  ) {
     67
     68    this->setClassID(CL_BSP_ENTITY, "BspEntity");
    6869    this->bspManager = new BspManager(this);
     70
    6971    if(this->bspManager->load(name.c_str(), 0.1f) == -1 ) {
    7072      this->bspManager = NULL;
    71       // Dont do anything
     73
    7274    } else {
    73 
    74      
    7575      this->toList(OM_ENVIRON); // Success!!!
    7676    }
    7777  } else {
     78    this->bspManager = NULL;
    7879    this->toList(OM_DEAD);
    7980  }
Note: See TracChangeset for help on using the changeset viewer.