Changeset 5257 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Sep 25, 2005, 7:04:28 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npc.cc
r5087 r5257 43 43 if (entity->isA(CL_PROJECTILE)) 44 44 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); 47 48 } 48 49 … … 50 51 void NPC::tick(float dt) 51 52 { 52 Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());53 // Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor()); 53 54 54 55 //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)); 56 57 this->shiftDir(Quaternion(dt, this->randomRotAxis)); 57 58 -
trunk/src/world_entities/npc.h
r5059 r5257 4 4 5 5 #include "world_entity.h" 6 #include "physics_interface.h" 6 7 7 8 class AI; 8 9 9 class NPC : public WorldEntity {10 class NPC : public WorldEntity, public PhysicsInterface { 10 11 11 12 public: -
trunk/src/world_entities/player.h
r5212 r5257 23 23 the player.cc for debug also 24 24 */ 25 class Player : public WorldEntity, public PhysicsInterface, publicEventListener25 class Player : public WorldEntity, public EventListener 26 26 { 27 27 friend class World; -
trunk/src/world_entities/weapons/test_bullet.cc
r5063 r5257 59 59 } 60 60 61 61 void TestBullet::collidesWith(WorldEntity* entity, const Vector& location) 62 { 63 this->destroy(); 64 } 62 65 63 66 /** … … 79 82 // this->finalize(); 80 83 GarbageCollector::getInstance()->collect(this); 81 this->lifeCycle = 0.0; 82 84 this->lifeCycle = 0.0; //! @todo should not be here 83 85 } 84 86 } … … 88 90 */ 89 91 void TestBullet::destroy () 90 {} 92 { 93 94 95 } 91 96 92 97 -
trunk/src/world_entities/weapons/test_bullet.h
r4932 r5257 18 18 virtual ~TestBullet (); 19 19 20 virtual void collidesWith(WorldEntity* entity, const Vector& location); 20 21 virtual void destroy (); 21 22 -
trunk/src/world_entities/world_entity.cc
r5256 r5257 143 143 void WorldEntity::collidesWith(WorldEntity* entity, const Vector& location) 144 144 { 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); 146 146 } 147 147
Note: See TracChangeset
for help on using the changeset viewer.