Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8693 in orxonox.OLD


Ignore:
Timestamp:
Jun 21, 2006, 11:33:10 PM (18 years ago)
Author:
patrick
Message:

branches: added new branche terrain copy of trunk

Location:
branches
Files:
3 edited
1 copied

Legend:

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

    r8524 r8693  
    5555  CollisionEvent* ce = collision->getCollisionEvents().front();
    5656  Vector normal = ce->getGroundNormal();
    57   // normal.normalize();
    5857
    59   // put it back
    60 //   PRINTF(0)("putting it back to lastPos: \n");
    61 //   this->lastPositions[0].debug();
    62 //   PRINTF(0)("current pos:\n");
    63 //   collision->getEntityB()->getAbsCoor().debug();
    64  
    65  
     58
    6659  Vector height = ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor();
    6760  if(ce->getGroundNormal().len() <= 0.1f)
     
    7467    downspeed++;
    7568    collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,-0.03*downspeed,0.0));
    76    
     69
    7770  }
    7871  else
     
    8174    {
    8275      //if(downspeed <= 0) downspeed =1;
    83       collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,height.y+3.55,0.0));   
    84       //collision->getEntityB()->setVelocity(Vector(0.0,0.0,0.0));   
     76      collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,height.y+3.55,0.0));
     77      //collision->getEntityB()->setVelocity(Vector(0.0,0.0,0.0));
    8578    }
    8679      downspeed = 0;
    8780  }
    88  
     81
    8982
    9083  /*
     
    9386  collision->getEntityB()->setVelocity(Vector());
    9487  collision->getEntityB()->setAbsCoor(this->lastPositions[1]);
    95  
     88
    9689  */
    9790}
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8534 r8693  
    4141#include "world_entity.h"
    4242
     43#include "aabb.h"
     44
    4345#include "util/loading/load_param.h"
    4446#include "util/loading/factory.h"
     
    942944  this->outputFraction = 1.0f;
    943945
    944 
    945 
    946 
    947   Vector forwardDir = worldEntity->getAbsDirX();
    948   forwardDir = forwardDir * 8.0f;
    949 
    950   Vector upDir = worldEntity->getAbsDirY();
    951   upDir.x = 0.0;
    952   upDir.y = 1.0;
    953   upDir.z = 0.0;
     946  AABB* box = worldEntity->getModelAABB();
     947
     948
     949  Vector forwardDir;
     950  Vector upDir;
    954951  Vector dest;
    955   /*
    956   dest.x  += forwardDir.x;
    957   dest.y  += forwardDir.y;
    958   dest.z  += forwardDir.z;
    959   */
    960   Vector position = worldEntity->getAbsCoor() + upDir*5.0f ;
    961   dest = worldEntity->getAbsCoor() - upDir*40.0f; //
    962   Vector out = dest;
     952  Vector position;
     953  Vector out;
     954
     955  if( box != NULL)
     956  {
     957    forwardDir = worldEntity->getAbsDirX();
     958    forwardDir = forwardDir * 8.0f;
     959
     960    upDir = worldEntity->getAbsDirY();
     961    upDir.x = 0.0;
     962    upDir.y = 1.0;
     963    upDir.z = 0.0;
     964    dest;
     965
     966    position = worldEntity->getAbsCoor() + box->center + box->axis[1] * box->halfLength[1];
     967    dest     = worldEntity->getAbsCoor() + box->center - box->axis[1] * box->halfLength[1];
     968    out = dest;
     969
     970  }
     971  else
     972  {
     973    forwardDir = worldEntity->getAbsDirX();
     974    forwardDir = forwardDir * 8.0f;
     975
     976    upDir = worldEntity->getAbsDirY();
     977    upDir.x = 0.0;
     978    upDir.y = 1.0;
     979    upDir.z = 0.0;
     980    dest;
     981
     982    position = worldEntity->getAbsCoor() + upDir*5.0f;
     983    dest = worldEntity->getAbsCoor() - upDir*40.0f; //
     984    out = dest;
     985
     986  }
    963987
    964988
  • branches/bsp_model/src/world_entities/creatures/fps_player.cc

    r8687 r8693  
    104104
    105105  // collision reaction registration
    106   //this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
     106  this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
    107107}
    108108
     
    210210
    211211
    212 //   if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(CL_INTERACTIVE_MODEL))
    213 //   {
    214 //     ((InteractiveModel*)this->getModel(0))->tick(time);
     212  if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(CL_INTERACTIVE_MODEL))
     213  {
     214    ((InteractiveModel*)this->getModel(0))->tick(time);
    215215//
    216216//     // handle animations differently
     
    234234//         ((InteractiveModel*)this->getModel(0))->setAnimation(STAND);
    235235//     }
    236 //   }
     236  }
    237237
    238238}
     
    246246{
    247247  // only draw if this entity is not the player since the player nevers sees himself
    248   if( this->getCurrentPlayer() == NULL)
     248//   if( this->getCurrentPlayer() == NULL)
    249249    WorldEntity::draw();
    250250}
Note: See TracChangeset for help on using the changeset viewer.