void xDistributedInteger::updateFromServer(TNL::BitStream *stream) { mLastServerValue = stream->readSignedInt(32); setValueState(E_DV_UPDATED); }
void xDistributedPoint3F::updateFromServer(xNStream *stream) { if (this->getPropertyInfo()->mPredictionType == E_PTYPE_PREDICTED) { TNL::Point3f p; stream->readPointCompressed(&p,1.0f); Point3F realPos(p.x,p.y,p.z); TNL::Point3f v; stream->readPointCompressed(&v,1.0f); Point3F velocity(v.x,v.y,v.z); mLastServerValue = realPos; mLastServerDifference = velocity; } if (this->getPropertyInfo()->mPredictionType == E_PTYPE_RELIABLE) { TNL::Point3f p; stream->readPointCompressed(&p,1.0f); Point3F realPos(p.x,p.y,p.z); mLastServerValue = realPos; } setValueState(E_DV_UPDATED); //xLogger::xLog(ELOGINFO,XL_START,"\n vel: %f,%f,%f",velocity.x,velocity.y,velocity.z ); }
void xDistributedQuatF::updateFromServer(xNStream *stream) { xMath::stream::mathRead(*stream,&mLastServerValue); if (this->getPropertyInfo()->mPredictionType == E_PTYPE_PREDICTED) { xMath::stream::mathRead(*stream,&mLastServerDifference); } setValueState(E_DV_UPDATED); }