Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5029 in orxonox.OLD


Ignore:
Timestamp:
Aug 15, 2005, 9:17:09 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: some changes in the NPC interface class

Location:
orxonox/trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r5028 r5029  
    651651      if( unlikely(this->nodeRight == NULL && this->nodeLeft == NULL))
    652652      {
    653         //nodeA->collidesWith()
     653        nodeA->collidesWith(nodeB);
     654        nodeB->collidesWith(nodeA);
    654655      }
    655656    }
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4903 r5029  
    8282
    8383//   a = new TestEntity(); a->setName("Clown1");
    84 //   b = new Environment(); b->setName("Jaeger");
    85   a = new Terrain();
     84   b = new Environment(); b->setName("Jaeger");
     85//   a = new Terrain();
    8686
    8787//   b->setRelCoor(0.0, 0.0, -20.0);
    8888//   b->setRelDir(Quaternion(-M_PI/2.0f, Vector(0.0, 1.0, 0.0)));
    8989
    90   entityList->add(a);
     90  entityList->add(b);
    9191//   entityList->add(b);
    9292
  • orxonox/trunk/src/world_entities/environment.cc

    r4836 r5029  
    3333{
    3434  this->setClassID(CL_ENVIRONMENT, "Environment");
    35   this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj"/*"worlds/vulcania.obj"*/, OBJ, RP_CAMPAIGN);
     35  this->model = (Model*)ResourceManager::getInstance()->load("models/bolido.obj", OBJ, RP_CAMPAIGN);
    3636
    3737  this->obbTree = new OBBTree(15, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
  • orxonox/trunk/src/world_entities/npc.cc

    r4986 r5029  
    3737
    3838
     39void NPC::collidesWith(WorldEntity* entity, const Vector& location)
     40{
    3941
    40 /* define the reaction, if the ship is been hit */
    41 int NPC::hit()
    42 {
    43   die();
    44   return 0;
    4542}
     43
    4644
    4745void NPC::tick(float dt)
     
    5553
    5654
    57 void NPC::die()
    58 {
    59 }
  • orxonox/trunk/src/world_entities/npc.h

    r4984 r5029  
    1616  void addAI(AI* ai);
    1717
    18   void tick(float dt);
    19   int hit();
    20   void die();
     18  virtual void tick(float dt);
     19
     20  virtual void collidesWith (WorldEntity* entity, const Vector& location);
     21
    2122
    2223 private:
    23   /* position of the non player space craft */
     24
    2425;
    2526
  • orxonox/trunk/src/world_entities/world_entity.cc

    r5026 r5029  
    103103void WorldEntity::collidesWith(WorldEntity* entity)
    104104{
    105   //this->obbTree->collideWith(entity->obbTree, (PNode*)this, (PNode*)entity);
    106 }
    107 
     105  //this->obbTree->collideWith(entity->obbTree, (PNode*)this, (PNode*)entity);]
     106  PRINTF(0)("COLLISION ---------------------------- with object: %s\n", entity->getName());
     107}
     108
     109
     110/**
     111 *  this function is called, when two entities collide
     112 * @param entity: the world entity with whom it collides
     113 *
     114 * Implement behaviour like damage application or other miscellaneous collision stuff in this function
     115 */
     116void WorldEntity::collidesWith(WorldEntity* entity, const Vector& location)
     117{
     118  //this->obbTree->collideWith(entity->obbTree, (PNode*)this, (PNode*)entity);]
     119  PRINTF(0)("COLLISION ---------------------------- with object: %s\n", entity->getName());
     120}
    108121
    109122/**
  • orxonox/trunk/src/world_entities/world_entity.h

    r5026 r5029  
    5252  virtual void hit (WorldEntity* weapon, Vector* loc);
    5353  virtual void collidesWith (WorldEntity* entity);
     54  virtual void collidesWith (WorldEntity* entity, const Vector& location);
    5455
    5556  /** @returns the Count of Faces on this WorldEntity */
Note: See TracChangeset for help on using the changeset viewer.