Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8524 in orxonox.OLD for branches/bsp_model/src


Ignore:
Timestamp:
Jun 16, 2006, 11:40:03 AM (19 years ago)
Author:
bottac
Message:

Worked on ground walk.

Location:
branches/bsp_model/src
Files:
5 edited

Legend:

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

    r8490 r8524  
    2323#include "world_entity.h"
    2424#include "cr_physics_ground_walk.h"
    25 
    26 #include "debug.h"
    2725
    2826#include <vector>
     
    5755  CollisionEvent* ce = collision->getCollisionEvents().front();
    5856  Vector normal = ce->getGroundNormal();
    59   normal.normalize();
     57  // normal.normalize();
    6058
    6159  // put it back
     
    6462//   PRINTF(0)("current pos:\n");
    6563//   collision->getEntityB()->getAbsCoor().debug();
     64 
     65 
     66  Vector height = ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor();
     67  if(ce->getGroundNormal().len() <= 0.1f)
     68  {
     69    collision->getEntityB()->setAbsCoor(collision->getEntityB()->getLastAbsCoor());
     70    return;
     71  }
     72  if(height.y < -3.6)
     73  {
     74    downspeed++;
     75    collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,-0.03*downspeed,0.0));
     76   
     77  }
     78  else
     79  {
     80    if(height.y > -3.5  && height.y <    3.9)
     81    {
     82      //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));   
     85    }
     86      downspeed = 0;
     87  }
     88 
    6689
     90  /*
    6791  PRINTF(0)("Collision with Ground: \n");
    6892  collision->getEntityB()->getAbsCoor().debug();
     93  collision->getEntityB()->setVelocity(Vector());
     94  collision->getEntityB()->setAbsCoor(this->lastPositions[1]);
     95 
     96  */
     97}
    6998
    70   //collision->getEntityB()->setVelocity(Vector());
    71   //collision->getEntityB()->setAbsCoor(this->lastPositions[5]);
    72 }
    7399
    74100
  • branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.h

    r8490 r8524  
    2929
    3030    Vector       lastPositions[10];           //!< last 10 positions
     31    float        downspeed;
    3132};
    3233
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8490 r8524  
    942942  this->outputFraction = 1.0f;
    943943 
    944   Vector position = worldEntity->getAbsCoor();
     944
    945945
    946946
     
    958958  dest.z  += forwardDir.z;
    959959  */
    960 
    961   dest = worldEntity->getAbsCoor() - upDir*40.0;
     960  Vector position = worldEntity->getAbsCoor() + upDir*5.0f ;
     961  dest = worldEntity->getAbsCoor() - upDir*40.0f; //
    962962  Vector out = dest;
    963963
     
    986986//   position1.debug();
    987987
     988  if(!this->outputStartsOut )
     989  {
     990    this->collPlane = new plane;
     991    this->collPlane->x = 0.0f;
     992    this->collPlane->y = 0.0f;
     993    this->collPlane->z = 0.0f;
     994    collision = true;
     995  }
     996  else
     997  {
     998   
     999   
     1000   
     1001   
    9881002  if( this->outputFraction == 1.0f)
    9891003  {
    990     if(this->outputAllSolid)
     1004    if(this->outputAllSolid )
    9911005    {
    9921006      this->collPlane = new plane;
    993       this->collPlane->x = 1.0f;
     1007      this->collPlane->x = 0.0f;
    9941008      this->collPlane->y = 0.0f;
    9951009      this->collPlane->z = 0.0f;
     
    10131027  }
    10141028
     1029 
     1030  }
    10151031  // Return the normal here: Normal's stored in this->collPlane;
    10161032  if( collision) {
     
    10181034    worldEntity->registerCollision(this->parent, worldEntity, Vector(this->collPlane->x, this->collPlane->y, this->collPlane->z), out);
    10191035  }
     1036  else  worldEntity->registerCollision(this->parent, worldEntity, Vector(0.0, 1.0, 0.0), dest);
    10201037
    10211038}
  • branches/bsp_model/src/world_entities/creatures/md2_creature.cc

    r8507 r8524  
    124124  cycle = 0.0;
    125125
    126   travelSpeed = 15.0;
     126  travelSpeed =300.0;
    127127  this->velocity = Vector(0.0,0.0,0.0);
    128128
     
    293293  Vector accel(0.0, 0.0, 0.0);
    294294  /*
    295   Vector rot(0.0, 0.0, 0.0); // wird benötigt für Helicopter
     295  Vector rot(0.0, 0.0, 0.0); // wird ben�igt fr Helicopter
    296296  */
    297297  //float rotVal = 0.0;
  • branches/bsp_model/src/world_entities/space_ships/collision_probe.cc

    r8490 r8524  
    6767  this->loadModel("models/dr_freak.md2");
    6868
    69   this->localVelocity = Vector(0,-4,0);
     69  this->localVelocity = Vector(0,0,0);
    7070}
    7171
Note: See TracChangeset for help on using the changeset viewer.