Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6788 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
Jan 27, 2006, 12:21:33 PM (18 years ago)
Author:
rennerc
Message:

redesigned spaceship sync
fixed bug in syncmacro

Location:
branches/network/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/coord/p_node.cc

    r6784 r6788  
    12501250int PNode::readSync( byte * data, int maxLength )
    12511251{
     1252  //WARNING: if you change this file make sure you also change needsReadSync
    12521253  SYNCHELP_WRITE_BEGIN();
    12531254
     
    12761277  {
    12771278
    1278     PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);
     1279    //PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);
    12791280
    12801281    SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_SCOORX );
     
    12901291  {
    12911292
    1292     PRINTF(0)("SEND QUAT: %f %f %f %f\n", this->absDirection.w, this->absDirection.v.x, this->absDirection.v.y, this->absDirection.v.z);
     1293    //PRINTF(0)("SEND QUAT: %f %f %f %f\n", this->absDirection.w, this->absDirection.v.x, this->absDirection.v.y, this->absDirection.v.z);
    12931294
    12941295    SYNCHELP_WRITE_FLOAT( this->absDirection.w, NWT_PN_SROTV );
     
    13051306  return SYNCHELP_WRITE_N;
    13061307}
     1308
     1309bool PNode::needsReadSync( )
     1310{
     1311  if ( fabs( coorx - relCoordinate.x ) > __OFFSET_POS ||
     1312       fabs( coory - relCoordinate.y ) > __OFFSET_POS ||
     1313       fabs( coorz - relCoordinate.z ) > __OFFSET_POS )
     1314    return true;
     1315
     1316  if ( fabs( rotw - absDirection.w ) > __OFFSET_ROT ||
     1317       fabs( rotx - absDirection.v.x ) > __OFFSET_ROT ||
     1318       fabs( roty - absDirection.v.y ) > __OFFSET_ROT ||
     1319       fabs( rotz - absDirection.v.z ) > __OFFSET_ROT )
     1320    return true;
     1321 
     1322  return false;
     1323}
  • branches/network/src/lib/coord/p_node.h

    r6695 r6788  
    190190  int       writeSync(const byte* data, int length, int sender);
    191191  int       readSync(byte* data, int maxLength );
     192  bool      needsReadSync();
    192193
    193194 private:
  • branches/network/src/lib/network/synchronizeable.h

    r6784 r6788  
    195195}
    196196#define SYNCHELP_WRITE_N        __synchelp_write_i
    197 #define SYNCHELP_WRITE_FKT(f,n)   { \
     197#define SYNCHELP_WRITE_FKT(f,n)   { SYNCHELP_WRITE_DEBUG(n); \
    198198                                  __synchelp_write_i += \
    199199                                  f( data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
Note: See TracChangeset for help on using the changeset viewer.