Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5053 in orxonox.OLD


Ignore:
Timestamp:
Aug 16, 2005, 11:28:13 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loadModel in Projectiles

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/math/vector.h

    r5052 r5053  
    7272  inline float len() const { return sqrt (x*x+y*y+z*z); }
    7373  /** normalizes the vector */
    74   inline void normalize() {
    75                       float l = len();
    76                       if( unlikely(l == 0.0))
    77                         {
    78                           // Prevent divide by zero
    79                           return;
    80                         }
    81                       x = x / l;
    82                       y = y / l;
    83                       z = z / l;
    84                     }
     74  inline void normalize() { float l = len(); if( unlikely(l == 0.0))return; this->x=this->x/l; this->y=this->y/l; this->z=this->z/l; };
    8575  Vector getNormalized() const;
    8676  Vector abs();
  • orxonox/trunk/src/world_entities/npc.cc

    r5049 r5053  
    4343void NPC::collidesWith(WorldEntity* entity, const Vector& location)
    4444{
    45   PRINTF(0)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
     45  if (entity->isA(CL_PROJECTILE))
     46    PRINTF(0)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
    4647}
    4748
  • orxonox/trunk/src/world_entities/weapons/test_gun.cc

    r5049 r5053  
    118118  this->setClassID(CL_TEST_GUN, "TestGun");
    119119
    120   this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
     120//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
     121
     122  this->loadModel("models/guns/test_gun.obj");
    121123
    122124  this->setStateDuration(WS_SHOOTING, .3);
Note: See TracChangeset for help on using the changeset viewer.