Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Feb 1, 2006, 4:40:34 PM (19 years ago)
Author:
patrick
Message:

trunk: merged network branche into trunk

File:
1 edited

Legend:

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

    r6873 r6959  
    12531253  SYNCHELP_WRITE_BEGIN();
    12541254
    1255   if ( this->getHostID()!=this->getOwner() )
     1255  if ( this->getHostID()!=0 && this->getHostID()!=this->getOwner() )
    12561256  {
    12571257    return SYNCHELP_WRITE_N;
     
    12591259
    12601260  byte flags = 0;
    1261   if ( fabs( coorx - relCoordinate.x ) > __OFFSET_POS ||
    1262        fabs( coory - relCoordinate.y ) > __OFFSET_POS ||
    1263        fabs( coorz - relCoordinate.z ) > __OFFSET_POS )
     1261  if ( fabs( coorx - relCoordinate.x ) > __OFFSET_POS*0.05*this->velocity.len() ||
     1262       fabs( coory - relCoordinate.y ) > __OFFSET_POS*0.05*this->velocity.len() ||
     1263       fabs( coorz - relCoordinate.z ) > __OFFSET_POS*0.05*this->velocity.len() )
    12641264    flags |= __FLAG_COOR;
    12651265
     
    12721272
    12731273  SYNCHELP_WRITE_BYTE( flags, NWT_PN_FLAGS );
    1274   //PRINTF(0)("FLAGS = %d\n", flags);
     1274  PRINTF(0)("FLAGS = %d\n", flags);
    12751275
    12761276  if ( flags & __FLAG_COOR )
    12771277  {
    12781278
    1279     //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);
    12801280
    12811281    SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_SCOORX );
     
    12911291  {
    12921292
    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);
     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);
    12941294
    12951295    SYNCHELP_WRITE_FLOAT( this->absDirection.w, NWT_PN_SROTV );
     
    13091309bool PNode::needsReadSync( )
    13101310{
    1311   if ( fabs( coorx - relCoordinate.x ) > __OFFSET_POS ||
    1312        fabs( coory - relCoordinate.y ) > __OFFSET_POS ||
    1313        fabs( coorz - relCoordinate.z ) > __OFFSET_POS )
     1311  if ( fabs( coorx - relCoordinate.x ) > __OFFSET_POS*0.05*this->velocity.len() ||
     1312       fabs( coory - relCoordinate.y ) > __OFFSET_POS*0.05*this->velocity.len() ||
     1313       fabs( coorz - relCoordinate.z ) > __OFFSET_POS*0.05*this->velocity.len() )
    13141314    return true;
    13151315
Note: See TracChangeset for help on using the changeset viewer.