Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6815 in orxonox.OLD for trunk/src/lib/coord


Ignore:
Timestamp:
Jan 28, 2006, 5:11:51 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches/network back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/network . -r6774:HEAD

no conflicts…
thats what i call orthogonal work

Location:
trunk/src/lib/coord
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.cc

    r6780 r6815  
    10771077  SYNCHELP_READ_BEGIN();
    10781078
    1079   SYNCHELP_READ_FKT( BaseObject::writeState );
     1079  SYNCHELP_READ_FKT( BaseObject::writeState, NWT_PN_BO_WRITESTATE );
    10801080
    10811081//   char * parentName = NULL;
     
    10941094
    10951095  int parentMode;
    1096   SYNCHELP_READ_INT( parentMode );
     1096  SYNCHELP_READ_INT( parentMode, NWT_PN_PARENTMODE );
    10971097  this->setParentMode((PARENT_MODE)parentMode);
    10981098
    10991099  float f1, f2, f3, f4;
    11001100
    1101   SYNCHELP_READ_FLOAT( f1 );
    1102   SYNCHELP_READ_FLOAT( f2 );
    1103   SYNCHELP_READ_FLOAT( f3 );
     1101  SYNCHELP_READ_FLOAT( f1, NWT_PN_COORX );
     1102  SYNCHELP_READ_FLOAT( f2, NWT_PN_COORY );
     1103  SYNCHELP_READ_FLOAT( f3, NWT_PN_COORZ );
    11041104  this->setRelCoor( f1, f2, f3 );
    11051105
    11061106
    1107   SYNCHELP_READ_FLOAT( f1 );
    1108   SYNCHELP_READ_FLOAT( f2 );
    1109   SYNCHELP_READ_FLOAT( f3 );
    1110   SYNCHELP_READ_FLOAT( f4 );
     1107  SYNCHELP_READ_FLOAT( f1, NWT_PN_ROTV );
     1108  SYNCHELP_READ_FLOAT( f2, NWT_PN_ROTX );
     1109  SYNCHELP_READ_FLOAT( f3, NWT_PN_ROTY );
     1110  SYNCHELP_READ_FLOAT( f4, NWT_PN_ROTZ );
    11111111  this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) );
    11121112
     
    11401140  SYNCHELP_WRITE_BEGIN();
    11411141
    1142   SYNCHELP_WRITE_FKT( BaseObject::readState );
     1142  SYNCHELP_WRITE_FKT( BaseObject::readState, NWT_PN_BO_WRITESTATE );
    11431143
    11441144//   if ( this->parent )
     
    11511151//   }
    11521152
    1153   SYNCHELP_WRITE_INT( this->parentMode );
    1154 
    1155   SYNCHELP_WRITE_FLOAT( this->relCoordinate.x );
    1156   SYNCHELP_WRITE_FLOAT( this->relCoordinate.y );
    1157   SYNCHELP_WRITE_FLOAT( this->relCoordinate.z );
    1158 
    1159   SYNCHELP_WRITE_FLOAT( this->relDirection.w );
    1160   SYNCHELP_WRITE_FLOAT( this->relDirection.v.x );
    1161   SYNCHELP_WRITE_FLOAT( this->relDirection.v.y );
    1162   SYNCHELP_WRITE_FLOAT( this->relDirection.v.z );
     1153  SYNCHELP_WRITE_INT( this->parentMode, NWT_PN_PARENTMODE );
     1154
     1155  SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_COORX );
     1156  SYNCHELP_WRITE_FLOAT( this->relCoordinate.y, NWT_PN_COORY );
     1157  SYNCHELP_WRITE_FLOAT( this->relCoordinate.z, NWT_PN_COORZ );
     1158
     1159  SYNCHELP_WRITE_FLOAT( this->relDirection.w, NWT_PN_ROTV );
     1160  SYNCHELP_WRITE_FLOAT( this->relDirection.v.x, NWT_PN_ROTX );
     1161  SYNCHELP_WRITE_FLOAT( this->relDirection.v.y, NWT_PN_ROTY );
     1162  SYNCHELP_WRITE_FLOAT( this->relDirection.v.z, NWT_PN_ROTZ );
    11631163
    11641164//   int n = children.size();
     
    12091209
    12101210  byte flags = 0;
    1211   SYNCHELP_READ_BYTE( flags );
     1211  SYNCHELP_READ_BYTE( flags, NWT_PN_FLAGS );
    12121212  //PRINTF(0)("%s::FLAGS = %d\n", this->getName(), flags);
    12131213
     
    12161216  if ( flags & __FLAG_COOR )
    12171217  {
    1218     SYNCHELP_READ_FLOAT( f1 );
    1219     SYNCHELP_READ_FLOAT( f2 );
    1220     SYNCHELP_READ_FLOAT( f3 );
     1218    SYNCHELP_READ_FLOAT( f1, NWT_PN_SCOORX );
     1219    SYNCHELP_READ_FLOAT( f2, NWT_PN_SCOORY );
     1220    SYNCHELP_READ_FLOAT( f3, NWT_PN_SCOORZ );
    12211221    PRINTF(0)("RCVD COOR: %f %f %f\n", f1, f2, f3);
    12221222    this->setRelCoor( f1, f2, f3 );
     
    12251225  if ( flags & __FLAG_ROT )
    12261226  {
    1227     SYNCHELP_READ_FLOAT( f1 );
    1228     SYNCHELP_READ_FLOAT( f2 );
    1229     SYNCHELP_READ_FLOAT( f3 );
    1230     SYNCHELP_READ_FLOAT( f4 );
     1227    SYNCHELP_READ_FLOAT( f1, NWT_PN_SROTV );
     1228    SYNCHELP_READ_FLOAT( f2, NWT_PN_SROTX );
     1229    SYNCHELP_READ_FLOAT( f3, NWT_PN_SROTY );
     1230    SYNCHELP_READ_FLOAT( f4, NWT_PN_SROTZ );
    12311231    PRINTF(0)("RCVD QUAT: %f %f %f %f\n", f1, f2, f3, f4);
    12321232    //this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) );
     
    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
     
    12701271
    12711272
    1272   SYNCHELP_WRITE_BYTE( flags );
     1273  SYNCHELP_WRITE_BYTE( flags, NWT_PN_FLAGS );
    12731274  //PRINTF(0)("FLAGS = %d\n", flags);
    12741275
     
    12761277  {
    12771278
    1278     PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);
    1279 
    1280     SYNCHELP_WRITE_FLOAT( this->relCoordinate.x );
    1281     SYNCHELP_WRITE_FLOAT( this->relCoordinate.y );
    1282     SYNCHELP_WRITE_FLOAT( this->relCoordinate.z );
     1279    //PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);
     1280
     1281    SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_SCOORX );
     1282    SYNCHELP_WRITE_FLOAT( this->relCoordinate.y, NWT_PN_SCOORY );
     1283    SYNCHELP_WRITE_FLOAT( this->relCoordinate.z, NWT_PN_SCOORZ );
    12831284
    12841285    coorx = relCoordinate.x;
     
    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 
    1294     SYNCHELP_WRITE_FLOAT( this->absDirection.w );
    1295     SYNCHELP_WRITE_FLOAT( this->absDirection.v.x );
    1296     SYNCHELP_WRITE_FLOAT( this->absDirection.v.y );
    1297     SYNCHELP_WRITE_FLOAT( 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);
     1294
     1295    SYNCHELP_WRITE_FLOAT( this->absDirection.w, NWT_PN_SROTV );
     1296    SYNCHELP_WRITE_FLOAT( this->absDirection.v.x, NWT_PN_SROTX );
     1297    SYNCHELP_WRITE_FLOAT( this->absDirection.v.y, NWT_PN_SROTY );
     1298    SYNCHELP_WRITE_FLOAT( this->absDirection.v.z, NWT_PN_SROTZ );
    12981299
    12991300    rotw = absDirection.w;
     
    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}
  • trunk/src/lib/coord/p_node.h

    r6695 r6815  
    190190  int       writeSync(const byte* data, int length, int sender);
    191191  int       readSync(byte* data, int maxLength );
     192  bool      needsReadSync();
    192193
    193194 private:
Note: See TracChangeset for help on using the changeset viewer.