Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 3, 2006, 2:17:40 PM (18 years ago)
Author:
patrick
Message:

npc walk again

Location:
branches/single_player_map/src/world_entities
Files:
2 edited

Legend:

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

    r9032 r9035  
    4040                        ->addMethod("turnTo", ExecutorLua1<GenericNPC,float>(&GenericNPC::turnTo))
    4141                        ->addMethod("finalGoalReached", ExecutorLua0ret<GenericNPC,bool>(&GenericNPC::finalGoalReached))
    42                         // Animation and sound
    43                         ->addMethod("playAnimation", ExecutorLua2<GenericNPC,int,int>(&GenericNPC::playAnimation))
    44                         ->addMethod("playSound", ExecutorLua1<GenericNPC,const std::string&>(&GenericNPC::playSound))
    4542                        // Display
    4643                        ->addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
     
    9188
    9289  // collision reaction registration
    93   this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
     90//   this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
    9491}
    9592
     
    172169 * @param filename: name of the file
    173170 */
    174 void GenericNPC::playSound(const std::string& filename)
     171void GenericNPC::playSound(std::string filename)
    175172{}
    176173
     
    199196
    200197        Vector dir = (currentAnimation.v - this->getAbsCoor());
    201         dir.y = 0.0f;
     198//         dir.y = 0.0f;
    202199        dir.getNormalized();
    203200        this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)));
     
    267264
    268265        Vector dir = (currentAnimation.v - this->getAbsCoor());
    269         dir.y = 0.0f;
     266//         dir.y = 0.0f;
    270267        dir.getNormalized();
    271268        this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0);
     
    478475          else
    479476          {
    480             dest.y = 0.0f;
    481             this->shiftCoor(dest.getNormalized() * currentAnimation.speed * dt);
    482 
     477//             dest.y = 0.0f;
     478            Vector move = dest.getNormalized() * currentAnimation.speed * dt;
     479            this->shiftCoor(move);
     480            PRINTF(0)("name %s, move:\n", this->getName());
     481            move.debug();
     482//             this->shiftCoor(Vector(0.0, 1.0, 1.0));
    483483          }
    484484        }
     
    525525  }
    526526
    527   // physical falling of the player
    528   if( !this->isOnGround())
    529   {
    530     this->fallVelocity += 300.0f * dt;
    531     velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity;
    532    // PRINTF(0)("%s is not on ground\n", this->getName());
    533   }
    534   else
    535   {
    536     this->fallVelocity = 0.0f;
    537   }
    538 
    539   this->shiftCoor(Vector(0, -this->fallVelocity * dt,0));
     527//   // physical falling of the player
     528//   if( !this->isOnGround())
     529//   {
     530//     this->fallVelocity += 300.0f * dt;
     531//     velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity;
     532//    // PRINTF(0)("%s is not on ground\n", this->getName());
     533//
     534//     this->shiftCoor(Vector(0, -this->fallVelocity * dt,0));
     535//
     536//   }
     537//   else
     538//   {
     539//     this->fallVelocity = 0.0f;
     540//   }
    540541
    541542}
  • branches/single_player_map/src/world_entities/world_entity.cc

    r9008 r9035  
    8282
    8383  // registering default reactions:
    84   this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
     84  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /*CL_WORLD_ENTITY*/ CL_PROJECTILE);
    8585
    8686  this->toList(OM_NULL);
Note: See TracChangeset for help on using the changeset viewer.