Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 26, 2006, 5:44:24 PM (18 years ago)
Author:
patrick
Message:

spl: simpler walking interface

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

Legend:

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

    r8805 r8810  
    138138  if( this->destCoor != destCoor && this->destDir != destDir)
    139139  {
    140     this->destCoor = Vector(x, y, 0.0f);
    141     this->destDir = Quaternion(Vector(qx, qy, qz), qu);
     140    this->destCoor = destCoor;
     141    this->destDir = destDir;
    142142
    143143    float time = 5.0f;
     
    157157
    158158
     159/**
     160 * walk to a specific place with direction
     161 *
     162 * @param x: x coordinate to go to
     163 * @param y: y coordinate to go to
     164 * @param z: z coordinate to go to
     165 *
     166 * without turning itself
     167 */
     168float GenericNPC::walkTo(float x, float y, float z)
     169{
     170  Quaternion q = this->getAbsDir();
     171
     172  return this->walkTo(x, y, z, q.w, q.v.x, q.v.y, q.v.z);
     173}
    159174
    160175/**
  • branches/single_player_map/src/world_entities/npcs/generic_npc.h

    r8802 r8810  
    4646
    4747  float walkTo(const Vector& coordinate, const Quaternion& dir);
     48  float walkTo(float x, float y, float z);
    4849  float walkTo(float x, float y, float z, float qu, float qx, float qy, float qz);
    4950  float walkTo(float x, float y, float qu, float qx, float qy, float qz);
Note: See TracChangeset for help on using the changeset viewer.