Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 4, 2006, 11:18:41 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Presentation back

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

Legend:

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

    r9003 r9110  
    4545
    4646
    47 Door::Door ()
    48 {
    49   this->init();
    50 }
    51 
    52 
    5347Door::Door(const TiXmlElement* root)
    5448{
     
    5650  this->setClassID(CL_DOOR, "Door");
    5751  this->scale = 1.0f;
     52  this->actionRadius = 1.0;
    5853
    5954  if( root != NULL)
     
    6257  this->toList(OM_COMMON);
    6358  this->bLocked = false;
     59  this->bOpen = false;
    6460
    6561  this->loadMD2Texture("maps/doors.jpg");
  • trunk/src/world_entities/npcs/door.h

    r9003 r9110  
    2222{
    2323  public:
    24     Door ();
    25     Door(const TiXmlElement* root);
     24    Door(const TiXmlElement* root = NULL);
    2625    virtual ~Door ();
    2726
     
    4342
    4443  private:
     44    void init();
    4545    bool checkOpen();
    4646    void setAnimation(int animNum, int playbackMode = 0);
  • trunk/src/world_entities/npcs/generic_npc.cc

    r9061 r9110  
    8484  this->toList(OM_GROUP_00);
    8585
    86   if (this->soundBuffer != NULL)
    87     ResourceManager::getInstance()->unload(this->soundBuffer);
    8886  this->soundBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV);
    8987
     
    9391
    9492  // collision reaction registration
    95 //   this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
     93   this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
    9694}
    9795
     
    186184  this->animationStack.push(this->behaviourList);
    187185  this->behaviourList = new std::list<GenericNPC::Anim>;
     186
     187  if( this->getAnimation() != STAND)
     188    this->setAnimation(STAND, MD2_ANIM_LOOP);
    188189}
    189190
     
    194195void GenericNPC::resume()
    195196{
    196   //if()
     197  if( this->animationStack.size() == 0)
     198    return;
     199
    197200  delete this->behaviourList;
    198201  this->behaviourList = this->animationStack.top();
     
    219222        Vector dir = (currentAnimation.v - this->getAbsCoor());
    220223        dir.y = 0.0f;
    221         dir.getNormalized();
     224        dir.normalize();
    222225        this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)));
    223226
     
    518521      {
    519522        Vector dest = currentAnimation.v - this->getAbsCoor();
     523        dest.y = 0.0f;
    520524        if (dest.len() < .5)
    521525          this->nextStep();
     
    530534      {
    531535        Vector dest = currentAnimation.v - this->getAbsCoor();
     536        dest.y = 0.0f;
    532537        if (dest.len() < .5)
    533538          this->nextStep();
Note: See TracChangeset for help on using the changeset viewer.