Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/world_entities/spectator.cc


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/spectator.cc

    r9406 r9869  
    2222#include "shared_network_data.h"
    2323
    24 CREATE_FACTORY(Spectator, CL_SPECTATOR);
    25 
    26 
    27 
     24#include "class_id_DEPRECATED.h"
     25ObjectListDefinitionID(Spectator, CL_SPECTATOR);
     26CREATE_FACTORY(Spectator);
    2827
    2928
     
    5857{
    5958//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    60   this->setClassID(CL_SPECTATOR, "Spectator");
     59  this->registerObject(this, Spectator::_objectList);
    6160
    6261  this->getWeaponManager().changeWeaponConfig(1);
     
    8988  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    9089
    91  
     90
    9291  registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) );
    9392  registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) );
     
    161160{
    162161  Playable::tick( time );
    163  
     162
    164163  if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() )
    165164  {
    166165    xMouse *= time / 10;
    167166    yMouse *= time / 10;
    168    
     167
    169168    angleX -= xMouse;
    170169    angleY -= yMouse;
    171    
     170
    172171    if ( angleY > 2.05 )
    173172      angleY = 2.05;
    174    
     173
    175174    if ( angleY < -1.15 )
    176175      angleY = -1.15;
    177    
     176
    178177    this->mouseDir = Quaternion( angleX, Vector( 0, 1, 0 ) ) * Quaternion( angleY, Vector( 0, 0, 1 ) );
    179    
     178
    180179    xMouse = yMouse = 0;
    181180  }
    182  
     181
    183182  this->setAbsDir( this->mouseDir );
    184  
     183
    185184  Vector velocity;
    186  
     185
    187186  if ( this->bForward )
    188187  {
    189188    velocity += this->getAbsDirX();
    190189  }
    191  
     190
    192191  if ( this->bBackward )
    193192  {
    194193    velocity -= this->getAbsDirX();
    195194  }
    196  
     195
    197196  if ( this->bRight )
    198197  {
    199198    velocity += this->getAbsDirZ();
    200199  }
    201  
     200
    202201  if ( this->bLeft )
    203202  {
    204203    velocity -= this->getAbsDirZ();
    205204  }
    206  
     205
    207206  velocity *= 100;
    208  
     207
    209208  this->shiftCoor( velocity*time );
    210209}
Note: See TracChangeset for help on using the changeset viewer.