Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5257 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Sep 25, 2005, 7:04:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: bouncy effect with physically based animations… or something like it at least.

Location:
trunk/src/world_entities
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npc.cc

    r5087 r5257  
    4343  if (entity->isA(CL_PROJECTILE))
    4444    PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
    45   this->setVisibiliy(false);
    46   State::getWorldEntityList()->remove(this);
     45  this->applyForce(Vector(0,0,0)-location*1000);
     46//  this->setVisibiliy(false);
     47//  State::getWorldEntityList()->remove(this);
    4748}
    4849
     
    5051void NPC::tick(float dt)
    5152{
    52   Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());
     53//  Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());
    5354
    5455  //if (directin.len() < 100)
    55   this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
     56//  this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
    5657  this->shiftDir(Quaternion(dt, this->randomRotAxis));
    5758
  • trunk/src/world_entities/npc.h

    r5059 r5257  
    44
    55#include "world_entity.h"
     6#include "physics_interface.h"
    67
    78class AI;
    89
    9 class NPC : public WorldEntity {
     10class NPC : public WorldEntity, public PhysicsInterface {
    1011
    1112 public:
  • trunk/src/world_entities/player.h

    r5212 r5257  
    2323     the player.cc for debug also
    2424*/
    25 class Player : public WorldEntity, public PhysicsInterface, public EventListener
     25class Player : public WorldEntity, public EventListener
    2626{
    2727  friend class World;
  • trunk/src/world_entities/weapons/test_bullet.cc

    r5063 r5257  
    5959}
    6060
    61 
     61void TestBullet::collidesWith(WorldEntity* entity, const Vector& location)
     62{
     63  this->destroy();
     64}
    6265
    6366/**
     
    7982//      this->finalize();
    8083      GarbageCollector::getInstance()->collect(this);
    81       this->lifeCycle = 0.0;
    82 
     84      this->lifeCycle = 0.0; //! @todo should not be here
    8385    }
    8486}
     
    8890*/
    8991void TestBullet::destroy ()
    90 {}
     92{
     93
     94
     95}
    9196
    9297
  • trunk/src/world_entities/weapons/test_bullet.h

    r4932 r5257  
    1818  virtual ~TestBullet ();
    1919
     20  virtual void collidesWith(WorldEntity* entity, const Vector& location);
    2021  virtual void destroy ();
    2122
  • trunk/src/world_entities/world_entity.cc

    r5256 r5257  
    143143void WorldEntity::collidesWith(WorldEntity* entity, const Vector& location)
    144144{
    145   PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
     145//  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
    146146}
    147147
Note: See TracChangeset for help on using the changeset viewer.