Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9035 in orxonox.OLD


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

npc walk again

Location:
branches/single_player_map/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/collision_reaction/cr_object_damage.cc

    r9031 r9035  
    5656  float damage = 0.0f;
    5757
    58  // PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
    59         //    collision->getEntityA()->getClassName(),
    60         //    collision->getEntityB()->getClassName());
     58  PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
     59            collision->getEntityA()->getClassName(),
     60            collision->getEntityB()->getClassName());
    6161
    6262  // the collision damage been dealed by the entity
     
    6464    damage = collision->getEntityB()->getDamage();
    6565    collision->getEntityA()->hit(damage, collision->getEntityB());
     66    PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName());
    6667  }
    67  // PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName());
    6868
    6969  if( collision->isEntityBCollide()) {
    7070    damage = collision->getEntityA()->getDamage();
    7171    collision->getEntityB()->hit(damage, collision->getEntityA());
     72    PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName());
    7273  }
    73  // PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName());
    7474
    7575  collision->flushCollisionEvents();
  • branches/single_player_map/src/story_entities/game_world.cc

    r8894 r9035  
    308308    /* update the state */
    309309    //this->update (); /// LESS REDUNDANCY.
    310 //     PNode::getNullParent()->updateNode(this->dtS);
     310    PNode::getNullParent()->updateNode(this->dtS);
    311311
    312312
  • 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.