Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8288 in orxonox.OLD


Ignore:
Timestamp:
Jun 8, 2006, 6:30:52 PM (18 years ago)
Author:
patrick
Message:

bsp: the collision reaction is on its way… a long one…

Location:
branches/bsp_model/src
Files:
6 edited

Legend:

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

    r8264 r8288  
    204204  }
    205205
     206  // if continuous poll poll the reaction
     207  if( this->bContinuousPoll && this->bCollided)
     208    this->collisionReaction->update(this->owner);
     209
    206210  // now set state to dispatched
    207211  this->bDispatched = true;
    208212  this->bCollided = false;
    209213
    210   // if continuous poll poll the reaction
    211    if( this->bContinuousPoll)
    212      this->collisionReaction->update(this->owner);
    213214  this->flushCollisions();
    214215}
     
    232233  }
    233234
    234 
    235235  return false;
    236236}
  • branches/bsp_model/src/lib/collision_reaction/cr_object_damage.cc

    r8216 r8288  
    5454  float damage = 0.0f;
    5555
    56   PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
     56  PRINTF(4)("Dealing damage - Handling collision: %s vs %s\n",
    5757            collision->getEntityA()->getClassName(),
    5858            collision->getEntityB()->getClassName());
     
    6363    collision->getEntityA()->decreaseHealth(damage);
    6464  }
    65   PRINTF(0)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName());
     65  PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName());
    6666
    6767  if( collision->isEntityBCollide()) {
     
    6969    collision->getEntityB()->decreaseHealth(damage);
    7070  }
    71   PRINTF(0)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName());
     71  PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName());
    7272
    7373  collision->flushCollisionEvents();
  • branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc

    r8256 r8288  
    2323#include "world_entity.h"
    2424#include "cr_physics_ground_walk.h"
     25
     26#include <vector>
    2527
    2628using namespace std;
     
    5153void CRPhysicsGroundWalk::reactToCollision(Collision* collision)
    5254{
    53 //   Vector normal = collision
    54   PRINTF(0)("Ground\n");
     55  CollisionEvent* ce = collision->getCollisionEvents().front();
     56  Vector normal = ce->getGroundNormal();
     57  normal.normalize();
     58
     59  // put it back
     60  PRINTF(0)("putting it back\n");
     61  collision->getEntityB()->setVelocity(Vector());
     62//  collision->getEntityB()->setAbsCoorSoft(this->lastPosition, 0.1);
     63//   collision->getEntityB()->setAbsCoor(this->lastPosition/* + normal * (-5.0f)*/);
     64
     65
     66
    5567}
    5668
     
    6476  this->lastPosition = owner->getAbsCoor();
    6577  this->lastDirection = owner->getAbsDir();
    66 
    67 
    6878}
    6979
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8264 r8288  
    918918    */
    919919
    920     float height = 10;
     920    float height = 40;
    921921
    922922
  • branches/bsp_model/src/world_entities/space_ships/turbine_hover.h

    r7348 r8288  
    5959    float                 rotation;
    6060
    61     Vector                velocity;           //!< the velocity of the TurbineHover.
     61   // Vector                velocity;           //!< the velocity of the TurbineHover.
    6262    Quaternion            direction;          //!< the direction of the TurbineHover.
    6363    float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
  • branches/bsp_model/src/world_entities/world_entity.h

    r8219 r8288  
    137137  inline float getMass() const { return this->physicsInterface.getMass(); }
    138138  inline float getTotalMass() const { return this->physicsInterface.getTotalMass(); }
     139  inline void setVelocity(const Vector& vel) { this->velocity = vel; }
    139140
    140141
     
    186187  PhysicsInterface        physicsInterface;                //!< the physics object of the WorldEntity
    187188
     189
     190  protected:
     191  Vector                  velocity;                        //!< speed of the entity
     192
    188193};
    189194
Note: See TracChangeset for help on using the changeset viewer.