Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6054 in orxonox.OLD for trunk/src/world_entities/npcs


Ignore:
Timestamp:
Dec 11, 2005, 6:23:42 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: multiple new Reparenting modes in PNode.
Testing the stuff in GuidedMissile
Projectile has a PNode as reference not as pointer
some minor weapon changes

Location:
trunk/src/world_entities/npcs
Files:
5 edited

Legend:

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

    r6004 r6054  
    5959    }
    6060    State::getWorldEntityList()->remove(this);
     61    this->removeNode();
    6162
    6263      this->collider = entity;
     
    6869    this->setVisibiliy(false);
    6970    State::getWorldEntityList()->remove(this);
     71    this->removeNode();
    7072  }
    7173}
  • trunk/src/world_entities/npcs/npc_test.cc

    r6004 r6054  
    5858
    5959
    60 void NPC2::collidesWith(WorldEntity* entity, const Vector& location)
    61 {
    62   if (entity->isA(CL_PROJECTILE))
    63   {
    64     PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
    65     this->applyForce(Vector(0,0,0)-location*1000);
    66   }
    67   else if (entity->isA(CL_PLAYER))
    68     this->applyForce(Vector(0,0,0)-location*100);
    69   else
    70   {
    71     this->setVisibiliy(false);
    72    State::getWorldEntityList()->remove(this);
    73   }
    74 }
    75 
    7660
    7761/**
  • trunk/src/world_entities/npcs/npc_test.h

    r6004 r6054  
    2020  virtual void draw() const;
    2121
    22   virtual void collidesWith (WorldEntity* entity, const Vector& location);
    23 
    24 
    2522 private:
    2623   Vector   randomRotAxis;
  • trunk/src/world_entities/npcs/npc_test1.cc

    r6004 r6054  
    4646
    4747
    48 void NPCTest1::collidesWith(WorldEntity* entity, const Vector& location)
    49 {
    50   if (entity->isA(CL_PROJECTILE) && entity != this->collider)
    51   {
    52 //    PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
    53 //    this->applyForce(Vector(0,0,0)-location*1000);
    54     if ((float)rand()/RAND_MAX < .3)
    55     {
    56       WorldEntity* powerUp = new TurretPowerUp();
    57       powerUp->setAbsCoor(this->getAbsCoor());
    58       State::getWorldEntityList()->add(powerUp);
    59     }
    60     else if ((float)rand()/RAND_MAX < .3)
    61     {
    62       WorldEntity* powerUp = new LaserPowerUp();
    63       powerUp->setAbsCoor(this->getAbsCoor());
    64       State::getWorldEntityList()->add(powerUp);
    65     }
    66     State::getWorldEntityList()->remove(this);
    67 
    68       this->collider = entity;
    69   }
    70   else if (entity->isA(CL_PLAYER))
    71     this->applyForce(Vector(0,0,0)-location*100);
    72   else if (entity->isA(CL_NPC))
    73   {
    74     this->setVisibiliy(false);
    75     State::getWorldEntityList()->remove(this);
    76   }
    77 }
    78 
    7948
    8049void NPCTest1::tick(float dt)
  • trunk/src/world_entities/npcs/npc_test1.h

    r6004 r6054  
    1818  virtual void tick(float dt);
    1919
    20   virtual void collidesWith (WorldEntity* entity, const Vector& location);
    21 
    22 
    2320 private:
    2421   Vector   randomRotAxis;
Note: See TracChangeset for help on using the changeset viewer.