Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc @ 6723

Last change on this file since 6723 was 6723, checked in by snellen, 18 years ago

aim.cc updated

File size: 17.4 KB
RevLine 
[5907]1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11### File Specific:
12   main-programmer: Benjamin Knecht
[6034]13   co-programmer: Silvan Nellen
[5907]14
15*/
16
17#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
18
19#include "executor/executor.h"
20#include "space_ship.h"
21
[6034]22#include "objModel.h"
[5907]23#include "resource_manager.h"
24
25#include "weapons/weapon_manager.h"
26#include "weapons/test_gun.h"
27#include "weapons/turret.h"
28#include "weapons/cannon.h"
29
30#include "factory.h"
31#include "key_mapper.h"
[5978]32#include "event_handler.h"
[5907]33
[6424]34#include "network_game_manager.h"
35
[6243]36#include "power_ups/weapon_power_up.h"
37#include "power_ups/param_power_up.h"
38
[5978]39#include "graphics_engine.h"
40
[6617]41#include "plane.h"
[6287]42
[6634]43#include "state.h"
44#include "player.h"
[6287]45
[6634]46
[6306]47// #include "lib/gui/gl_gui/glgui_bar.h"
48// #include "lib/gui/gl_gui/glgui_pushbutton.h"
[6287]49
50
[5907]51using namespace std;
52
53CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP);
54
55/**
56 *  creates the controlable Spaceship
57 */
58SpaceShip::SpaceShip()
59{
60  this->init();
61}
62
63/**
64 *  destructs the spaceship, deletes alocated memory
65 */
66SpaceShip::~SpaceShip ()
67{
68}
69
70/**
71 * loads a Spaceships information from a specified file.
72 * @param fileName the name of the File to load the spaceship from (absolute path)
73 */
74SpaceShip::SpaceShip(const char* fileName)
75{
76  this->init();
77  TiXmlDocument doc(fileName);
78
79  if(!doc.LoadFile())
80  {
81    PRINTF(2)("Loading file %s failed for spaceship.\n", fileName);
82    return;
83  }
84
85  this->loadParams(doc.RootElement());
86}
87
88/**
89 *  creates a new Spaceship from Xml Data
90 * @param root the xml element containing spaceship data
91
92   @todo add more parameters to load
93*/
94SpaceShip::SpaceShip(const TiXmlElement* root)
95{
96  this->init();
97  if (root != NULL)
98    this->loadParams(root);
99
100  //weapons:
101  Weapon* wpRight = new TestGun(0);
102  wpRight->setName("testGun Right");
103  Weapon* wpLeft = new TestGun(1);
104  wpLeft->setName("testGun Left");
[5982]105  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
[5907]106
107  cannon->setName("BFG");
108
[6443]109  this->addWeapon(wpLeft, 1, 0);
110  this->addWeapon(wpRight,1 ,1);
111  this->addWeapon(cannon, 0, 6);
[5907]112
113  this->getWeaponManager()->changeWeaponConfig(1);
114}
115
116
117/**
118 * initializes a Spaceship
119 */
120void SpaceShip::init()
121{
122//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
123  this->setClassID(CL_SPACE_SHIP, "SpaceShip");
124
125  PRINTF(4)("SPACESHIP INIT\n");
126
[6547]127  EventHandler::getInstance()->grabEvents(true);
[5907]128
[5978]129  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
[5907]130  bFire = false;
[5978]131  xMouse = yMouse = 0;
[6637]132  yInvert = 1;
[5978]133  mouseSensitivity = 0.001;
[6692]134  airViscosity = 0.05;
[6637]135  controlVelocityX = 25;
136  controlVelocityY = 150;
137  shipInertia = 0.5             ;
138//  cycle = 0.0;
[5907]139
[6430]140  this->setMaxEnergy(100);
141  this->setEnergy(80);
[5982]142
[6637]143  travelSpeed = 40.0;
144  acceleration = 3;
145  this->velocity = this->getAbsDirX()*travelSpeed;
[6162]146  this->mouseDir = this->getAbsDir();
[6637]147  this->pitchDir = this->getAbsDir();
[5907]148
[6306]149//   GLGuiButton* button = new GLGuiPushButton();
150//    button->show();
151//    button->setLabel("orxonox");
152//    button->setBindNode(this);
153//     GLGuiBar* bar = new GLGuiBar();
154//     bar->show();
155//     bar->setValue(7.0);
156//     bar->setMaximum(10);
157//     bar->setSize2D( 20, 100);
158//     bar->setAbsCoor2D( 10, 200);
[6300]159
[5907]160  //add events to the eventlist
[6637]161  registerEvent(KeyMapper::PEV_UP);
162  registerEvent(KeyMapper::PEV_DOWN);
163  registerEvent(KeyMapper::PEV_LEFT);
164  registerEvent(KeyMapper::PEV_RIGHT);
165  //registerEvent(SDLK_q);
166  //registerEvent(SDLK_e);
[5907]167  registerEvent(KeyMapper::PEV_FIRE1);
168  registerEvent(KeyMapper::PEV_NEXT_WEAPON);
169  registerEvent(KeyMapper::PEV_PREVIOUS_WEAPON);
[6637]170  //registerEvent(SDLK_PAGEUP);
171  //registerEvent(SDLK_PAGEDOWN);
[5978]172  registerEvent(EV_MOUSE_MOTION);
[5907]173
174  this->getWeaponManager()->setSlotCount(7);
175
176  this->getWeaponManager()->setSlotPosition(0, Vector(-2.6, .1, -3.0));
177  this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
178
179  this->getWeaponManager()->setSlotPosition(1, Vector(-2.6, .1, 3.0));
180  this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
181
182  this->getWeaponManager()->setSlotPosition(2, Vector(-1.5, .5, -.5));
183  this->getWeaponManager()->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
184
185  this->getWeaponManager()->setSlotPosition(3, Vector(-1.5, .5, .5));
186  this->getWeaponManager()->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
187
188  this->getWeaponManager()->setSlotPosition(4, Vector(-1.5, -.5, .5));
189  this->getWeaponManager()->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
190
191  this->getWeaponManager()->setSlotPosition(5, Vector(-1.5, -.5, -.5));
192  this->getWeaponManager()->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
193//
194   this->getWeaponManager()->setSlotPosition(6, Vector(-1, 0.0, 0));
195   this->getWeaponManager()->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
196   //
197//   this->getWeaponManager()->setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
198//   this->getWeaponManager()->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
199//
200//   this->getWeaponManager()->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
201//   this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
202
[6162]203  this->getWeaponManager()->getFixedTarget()->setParent(this);
204  this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0);
205
[6222]206  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
[5907]207}
208
209/**
210 * loads the Settings of a SpaceShip from an XML-element.
211 * @param root the XML-element to load the Spaceship's properties from
212 */
213void SpaceShip::loadParams(const TiXmlElement* root)
214{
[6512]215  WorldEntity::loadParams(root);
[5907]216}
217
218
[6222]219void SpaceShip::enter()
220{
221  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
[6241]222  this->attachCamera();
[6222]223}
224
225void SpaceShip::leave()
226{
227  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
[6241]228  this->detachCamera();
[6222]229}
230
[5907]231
232/**
233 *  effect that occurs after the SpaceShip is spawned
234*/
235void SpaceShip::postSpawn ()
236{
237  //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
238}
239
240/**
241 *  the action occuring if the spaceship left the game
242*/
243void SpaceShip::leftWorld ()
244{}
245
246WorldEntity* ref = NULL;
247/**
248 *  this function is called, when two entities collide
249 * @param entity: the world entity with whom it collides
250 *
251 * Implement behaviour like damage application or other miscellaneous collision stuff in this function
252 */
253void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
254{
[6436]255  Playable::collidesWith(entity, location);
[5907]256  if (entity->isA(CL_TURRET_POWER_UP) && entity != ref)
257  {
258    this->ADDWEAPON();
259    ref = entity;
260    }
261//  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
262}
263
264/**
265 *  draws the spaceship after transforming it.
266*/
267void SpaceShip::draw () const
268{
[6281]269  WorldEntity::draw();
[5907]270  this->getWeaponManager()->draw();
271
272  //this->debug(0);
273}
274
275/**
276 *  the function called for each passing timeSnap
277 * @param time The timespan passed since last update
278*/
279void SpaceShip::tick (float time)
280{
[6634]281  this->getWeaponManager()->tick(time);
282  // weapon system manipulation
283  this->weaponAction();
[6679]284
[6637]285  if( xMouse != 0 || yMouse != 0)
286   {
287    if (xMouse > controlVelocityX) xMouse = controlVelocityX;
288    else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX;
289    if (yMouse > controlVelocityY) yMouse = controlVelocityY;
290    else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY;
[6679]291
[6637]292    pitchDir = (Quaternion(xMouse*mouseSensitivity*0.5, Vector(1,0,0)));
[6679]293
[6637]294    mouseDir *= (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity*yInvert, Vector(0,0,1))*pitchDir);
295    xMouse = yMouse = 0;
296   }
[6034]297
[6679]298
[6634]299//   if( this != State::getPlayer()->getControllable())
300//     return;
301
[5907]302  // spaceship controlled movement
303  this->calculateVelocity(time);
304
[6637]305  Vector move = velocity*time;
[6679]306
[6034]307  //orient the velocity in the direction of the spaceship.
308  travelSpeed = velocity.len();
309  velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
310  velocity = (velocity.getNormalized())*travelSpeed;
[6222]311
[6162]312  //orient the spaceship in direction of the mouse
[6637]313   rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, fabsf(time)*shipInertia);
[6241]314   if (this->getAbsDir().distance(rotQuat) > 0.00000000000001)
[6162]315    this->setAbsDir( rotQuat);
316   //this->setAbsDirSoft(mouseDir,5);
[6222]317
[5978]318  // this is the air friction (necessary for a smooth control)
[6637]319  if(travelSpeed >= 120) velocity -= velocity.getNormalized()*travelSpeed*travelSpeed*0.0001;
320  else if (travelSpeed <= 80) velocity -= velocity.getNormalized()*travelSpeed*0.001;
[6679]321
[6637]322  //other physics (gravity)
[6692]323  //if(travelSpeed < 120)
324  //move += Vector(0,-1,0)*60*time + Vector(0,1,0)*travelSpeed/2*time;
[6679]325
[6034]326  //hoover effect
[6634]327  //cycle += time;
328  //this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);
[5982]329
[6034]330  //readjust
[6426]331  //if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));
[6034]332  //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));
333
[5978]334  //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
[5907]335
[6637]336  this->shiftCoor(move);
[5907]337
[6634]338
[5907]339}
340
341/**
342 *  calculate the velocity
343 * @param time the timeslice since the last frame
344*/
345void SpaceShip::calculateVelocity (float time)
346{
347  Vector accel(0.0, 0.0, 0.0);
[6162]348  /*
349  Vector rot(0.0, 0.0, 0.0); // wird benötigt für Helicopter
350  */
[5907]351  //float rotVal = 0.0;
[5912]352  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
[5907]353  /* calculate the direction in which the craft is heading  */
354
[6637]355  //Plane plane(Vector(0,1,0), Vector(0,0,0));
[6222]356
[5907]357  if( this->bUp )
358   {
[5978]359     //this->shiftCoor(this->getAbsDirX());
[6637]360      //accel += (this->getAbsDirX())*2;
361      accel += (this->getAbsDirX())*acceleration;
[6222]362
[5907]363   }
364
365  if( this->bDown )
[5908]366   {
[5978]367     //this->shiftCoor((this->getAbsDirX())*-1);
[6637]368     //accel -= (this->getAbsDirX())*2;
[6723]369    //if(velocity.len() > 50)
[6637]370     accel -= (this->getAbsDirX())*0.5*acceleration;
[6723]371
372
373
[5907]374   }
375
[6034]376  if( this->bLeft/* > -this->getRelCoor().z*2*/)
[5907]377  {
[5912]378    this->shiftDir(Quaternion(time, Vector(0,1,0)));
379//    accel -= rightDirection;
[5908]380    //velocityDir.normalize();
[5907]381    //rot +=Vector(1,0,0);
382    //rotVal -= .4;
383  }
384  if( this->bRight /* > this->getRelCoor().z*2*/)
385  {
[5912]386    this->shiftDir(Quaternion(-time, Vector(0,1,0)));
387
388    //    accel += rightDirection;
[5908]389    //velocityDir.normalize();
[5907]390    //rot += Vector(1,0,0);
391    //rotVal += .4;
392  }
[5982]393
[6034]394
[5978]395  if( this->bRollL /* > -this->getRelCoor().z*2*/)
396  {
[6637]397    mouseDir *= Quaternion(-time*2, Vector(1,0,0));
[5978]398//    accel -= rightDirection;
399    //velocityDir.normalize();
400    //rot +=Vector(1,0,0);
401    //rotVal -= .4;
402  }
403  if( this->bRollR /* > this->getRelCoor().z*2*/)
404  {
[6637]405    mouseDir *= Quaternion(time*2, Vector(1,0,0));
[5978]406
407    //    accel += rightDirection;
408    //velocityDir.normalize();
409    //rot += Vector(1,0,0);
410    //rotVal += .4;
411  }
[5907]412  if (this->bAscend )
413  {
[5912]414    this->shiftDir(Quaternion(time, Vector(0,0,1)));
415
416//    accel += upDirection;
[5908]417    //velocityDir.normalize();
[5907]418    //rot += Vector(0,0,1);
419    //rotVal += .4;
420  }
421  if (this->bDescend )
422  {
[5912]423    this->shiftDir(Quaternion(-time, Vector(0,0,1)));
424
425    //    accel -= upDirection;
[5908]426    //velocityDir.normalize();
[5907]427    //rot += Vector(0,0,1);
428    //rotVal -= .4;
429  }
430
[5978]431  velocity += accel;
[5907]432  //rot.normalize();
433  //this->setRelDirSoft(Quaternion(rotVal, rot), 5);
434}
435
436/**
437 * weapon manipulation by the player
438*/
439void SpaceShip::weaponAction()
440{
441  if( this->bFire)
442    {
443      this->getWeaponManager()->fire();
444    }
445}
446
447/**
448 * @todo switch statement ??
449 */
450void SpaceShip::process(const Event &event)
451{
[6637]452  if( event.type == KeyMapper::PEV_LEFT)
[5978]453      this->bRollL = event.bPressed;
[6637]454  else if( event.type == KeyMapper::PEV_RIGHT)
[5978]455      this->bRollR = event.bPressed;
[5907]456  else if( event.type == KeyMapper::PEV_FIRE1)
457      this->bFire = event.bPressed;
458  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
[6443]459  {
[6444]460    this->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;
[6443]461  }
[5907]462  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
[6444]463    this->previousWeaponConfig();
[6637]464  else if( event.type == KeyMapper::PEV_UP)
[5978]465    this->bUp = event.bPressed; //this->shiftCoor(0,.1,0);
[6637]466  else if( event.type == KeyMapper::PEV_DOWN)
[5978]467    this->bDown = event.bPressed; //this->shiftCoor(0,-.1,0);
468  else if( event.type == EV_MOUSE_MOTION)
469  {
[6637]470    this->xMouse += event.xRel;
471    this->yMouse += event.yRel;
[5978]472  }
[5907]473}
474
475#include "weapons/aiming_turret.h"
476// FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG
477void SpaceShip::ADDWEAPON()
478{
479  Weapon* turret = NULL;
480
[6306]481  if ((float)rand()/RAND_MAX < .9)
[5907]482  {
483    //if (this->getWeaponManager()->hasFreeSlot(2, WTYPE_TURRET))
484    {
485      turret = new Turret();
[6443]486      this->addWeapon(turret, 2);
[5907]487      this->getWeaponManager()->changeWeaponConfig(2);
488    }
489  }
490  else
491  {
492    //if (this->getWeaponManager()->hasFreeSlot(3))
493    {
[6426]494      turret = dynamic_cast<Weapon*>(Factory::fabricate(CL_TARGETING_TURRET));
495      if (turret != NULL)
[6443]496      this->addWeapon(turret, 3);
[5907]497
498      this->getWeaponManager()->changeWeaponConfig(3);
499    }
500  }
501
502  if(turret != NULL)
503  {
504    turret->setName("Turret");
505    turret->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);
506  }
507}
[6424]508
[6498]509#define MASK_bUp         1
510#define MASK_bDown       2
511#define MASK_bLeft       4
512#define MASK_bRight      8
513#define MASK_bAscend    16
514#define MASK_bDescend   32
515#define MASK_bFire      64
516#define MASK_bRollL    128
517#define MASK_bRollR    256
[6424]518
[6498]519#define DATA_state       1
520#define DATA_flags       2
521#define DATA_mouse       3
522
[6424]523int SpaceShip::writeBytes( const byte * data, int length, int sender )
524{
525  SYNCHELP_READ_BEGIN();
526
[6498]527  byte b;
528  SYNCHELP_READ_BYTE( b );
[6424]529
[6634]530  if ( b == DATA_state /*&& (this->getHostID()!=this->getOwner() || sender==0)*/ )
[6498]531  {
[6634]532    PRINTF(0)("GOT STATE %d\n", this->getUniqueID());
[6498]533    setRequestedSync( false );
534    setIsOutOfSync( false );
535    SYNCHELP_READ_FKT( WorldEntity::writeState );
[6634]536    //SYNCHELP_READ_FLOAT( cycle );
537
538    return SYNCHELP_READ_N;
[6498]539  }
540
[6634]541
542  if ( b == DATA_flags /*&& this->getHostID()!=this->getOwner()*/ )
[6498]543  {
[6634]544    int flags = 0;
[6498]545    SYNCHELP_READ_INT( flags );
546
[6634]547    bUp = (flags & MASK_bUp) != 0;
548    bDown = (flags & MASK_bDown) != 0;
549    bLeft = (flags & MASK_bLeft) != 0;
550    bRight = (flags & MASK_bRight) != 0;
551    bAscend = (flags & MASK_bAscend) != 0;
552    bDescend = (flags & MASK_bDescend) != 0;
553    bFire = (flags & MASK_bFire) != 0;
554    bRollL = (flags & MASK_bRollL) != 0;
555    bRollR = (flags & MASK_bRollR) != 0;
556
[6498]557  }
558
[6634]559  /*if ( b == DATA_mouse && this->getHostID()!=this->getOwner() )
[6498]560  {
561    SYNCHELP_READ_FLOAT( xMouse );
562    SYNCHELP_READ_FLOAT( yMouse );
563    SYNCHELP_READ_FLOAT( mouseSensitivity );
564    SYNCHELP_READ_FLOAT( cycle );
[6634]565}*/
[6498]566
[6634]567  if ( this->getOwner() != this->getHostID() )
568    SYNCHELP_READ_FKT( PNode::writeSync );
569
[6424]570  return SYNCHELP_READ_N;
571}
572
[6498]573
574
[6424]575int SpaceShip::readBytes( byte * data, int maxLength, int * reciever )
576{
[6498]577  SYNCHELP_WRITE_BEGIN();
578
[6634]579  if ( isOutOfSync() && !requestedSync() /*&& this->getHostID()!=this->getOwner()*/ )
[6424]580  {
581    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
582    setRequestedSync( true );
[6634]583    PRINTF(0)("REQUESTED STATE %d\n", this->getUniqueID());
[6424]584  }
585
586  int rec = this->getRequestSync();
587  if ( rec > 0 )
588  {
589    *reciever = rec;
590
[6634]591    PRINTF(0)("SEND STATE %d %d\n", this->getUniqueID(), rec);
592
[6498]593    SYNCHELP_WRITE_BYTE( (byte)DATA_state );
[6424]594
595    SYNCHELP_WRITE_FKT( WorldEntity::readState );
[6634]596    //SYNCHELP_WRITE_FLOAT( cycle );
[6424]597
598    return SYNCHELP_WRITE_N;
599  }
600
601  *reciever = 0;
[6498]602
603  if ( this->getHostID()==this->getOwner() )
604  {
605    int mask = 0;
606
607    if ( bUp )
608      mask |= MASK_bUp;
609    if ( bDown )
610      mask |= MASK_bDown;
611    if ( bLeft )
612      mask |= MASK_bLeft;
613    if ( bRight )
614      mask |= MASK_bRight;
615    if ( bAscend )
616      mask |= MASK_bAscend;
617    if ( bFire )
618      mask |= MASK_bFire;
619    if ( bRollL )
620      mask |= MASK_bRollL;
621    if ( bRollR )
622      mask |= MASK_bRollR;
623
624
[6634]625    //static float oldxMouse = xMouse + 1.0;
626    //static float oldyMouse = yMouse + 1.0;
627
[6498]628    if ( mask != oldMask )
629    {
630      oldMask = mask;
631      SYNCHELP_WRITE_BYTE( DATA_flags );
632      SYNCHELP_WRITE_INT( mask );
633    }
[6634]634    else
635    {
636      SYNCHELP_WRITE_BYTE( 0 );
637    }
[6498]638
[6634]639    /*if ( oldxMouse != xMouse || oldyMouse != yMouse )
[6498]640    {
641      oldxMouse = xMouse;
642      oldyMouse = yMouse;
643      SYNCHELP_WRITE_BYTE( DATA_mouse );
644      SYNCHELP_WRITE_FLOAT( xMouse );
645      SYNCHELP_WRITE_FLOAT( yMouse );
646      SYNCHELP_WRITE_FLOAT( mouseSensitivity );
647      SYNCHELP_WRITE_FLOAT( cycle );
[6634]648    }*/
[6498]649  }
[6634]650  else
651  {
652    SYNCHELP_WRITE_BYTE( 0 );
653  }
[6498]654
[6634]655  if ( this->getOwner() == this->getHostID() )
656    SYNCHELP_WRITE_FKT( PNode::readSync );
657
[6498]658  return SYNCHELP_WRITE_N;
[6424]659}
Note: See TracBrowser for help on using the repository browser.