Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9040 in orxonox.OLD


Ignore:
Timestamp:
Jul 3, 2006, 3:23:42 PM (18 years ago)
Author:
patrick
Message:

npc walk at the ground with correct orientation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/npcs/generic_npc.cc

    r9038 r9040  
    198198
    199199        Vector dir = (currentAnimation.v - this->getAbsCoor());
    200         dir.y = this->getAbsCoor().y;
     200        dir.y = 0.0f;
    201201        dir.getNormalized();
    202         this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) /** Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))*/);
     202        this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)));
    203203
    204204        this->setAnimationSpeed(0.5f);
     
    265265          this->setAnimation(RUN, MD2_ANIM_LOOP);
    266266
     267
    267268        Vector dir = (currentAnimation.v - this->getAbsCoor());
    268         dir.y = this->getAbsCoor().y;
     269        dir.y = 0.0f;
    269270        dir.getNormalized();
    270271        this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0);
     
    474475          Vector dest = currentAnimation.v - this->getAbsCoor();
    475476          dest.y = 0.0f;
    476           PRINTF(0)("%s distance %f\n", this->getName(), dest.len());
    477477          if (dest.len() < .5)
    478478            this->nextStep();
Note: See TracChangeset for help on using the changeset viewer.