Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10727 in orxonox.OLD


Ignore:
Timestamp:
Jun 20, 2007, 10:20:07 AM (17 years ago)
Author:
rennerc
Message:

ActionboxEnemy loadParam

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

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/npcs/actionbox_enemy.cc

    r10726 r10727  
    4949  this->acceleration = 3;
    5050  this->speed = 0;
     51  this->agility = 1;
    5152 
    5253  this->onEscape = false;
    5354  this->escaped = false;
    5455  this->endPoint = Vector(0, 0, 0);
    55   if ( root )
    56     this->loadParams( root );
    57  
    58  
    59     this->weaponMan.setParentEntity( this);
     56 
     57  this->weaponMan.setParentEntity( this);
    6058  //weapons:
    6159
     
    114112 
    115113  LoadParam(root, "endPoint", this, ActionboxEnemy, setEndPoint);
     114  LoadParam(root, "maxSpeed", this, ActionboxEnemy, setMaxSpeed);
     115  LoadParam(root, "agility", this, ActionboxEnemy, setAgility);
     116  LoadParam(root, "acceleration", this, ActionboxEnemy, setAcceleration);
    116117}
    117118
     
    217218{
    218219  Quaternion cur = myDir;
    219   Quaternion rx( dt, Vector( 0, 0, 1 ) );
     220  Quaternion rx( agility*dt, Vector( 0, 0, 1 ) );
    220221 
    221222  Quaternion tmp1 = cur * rx;
     
    234235  }
    235236 
    236   Quaternion ry( dt, cur.inverse().apply( Vector( 0, 1, 0 ) ) );
     237  Quaternion ry( agility*dt, cur.inverse().apply( Vector( 0, 1, 0 ) ) );
    237238 
    238239  tmp1 = cur * ry;
  • branches/presentation/src/world_entities/npcs/actionbox_enemy.h

    r10725 r10727  
    3131    float maxSpeed;
    3232    float speed;
     33    float agility;
     34   
     35    void setAcceleration( float f ){ this->acceleration = f; }
     36    void setMaxSpeed( float f ){ this->maxSpeed = f; }
     37    void setAgility( float f ){ this->agility = f; }
    3338   
    3439    Quaternion myDir;
Note: See TracChangeset for help on using the changeset viewer.