mirror of
https://github.com/overte-org/overte.git
synced 2025-06-20 10:41:06 +02:00
fixed comments
This commit is contained in:
parent
94e04e2d7d
commit
23892ab1e7
2 changed files with 6 additions and 8 deletions
|
@ -542,13 +542,11 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
||||||
|
|
||||||
recalculateCollisionShape();
|
recalculateCollisionShape();
|
||||||
if (overwriteLocalData && (getDirtyFlags() & (EntityItem::DIRTY_POSITION | EntityItem::DIRTY_VELOCITY))) {
|
if (overwriteLocalData && (getDirtyFlags() & (EntityItem::DIRTY_POSITION | EntityItem::DIRTY_VELOCITY))) {
|
||||||
// TODO: Andrew & Brad to discuss -- this probably should not be "now" but instead should be the last
|
// NOTE: This code is attempting to "repair" the old data we just got from the server to make it more
|
||||||
// simulated time from server. The logic should maybe be: the position changed from the server, so the
|
// closely match where the entities should be if they'd stepped forward in time to "now". The server
|
||||||
// position we just set can be thought of as the position at the time it was last simulated by the
|
// is sending us data with a known "last simulated" time. That time is likely in the past, and therefore
|
||||||
// server (clock skew adjusted). By setting it to "now" we are saying that the last position is to be
|
// this "new" data is actually slightly out of date. We calculate the time we need to skip forward and
|
||||||
// considered to be the correct position for "now" which is likely in the future from when it actually
|
// use our simulation helper routine to get a best estimate of where the entity should be.
|
||||||
// was at that last known positition.
|
|
||||||
|
|
||||||
float skipTimeForward = (float)(now - _lastSimulated) / (float)(USECS_PER_SECOND);
|
float skipTimeForward = (float)(now - _lastSimulated) / (float)(USECS_PER_SECOND);
|
||||||
if (skipTimeForward > 0.0f) {
|
if (skipTimeForward > 0.0f) {
|
||||||
#ifdef WANT_DEBUG
|
#ifdef WANT_DEBUG
|
||||||
|
|
|
@ -228,7 +228,7 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_
|
||||||
// we only update lastEdited when we're sending new physics data
|
// we only update lastEdited when we're sending new physics data
|
||||||
// (i.e. NOT when we just simulate the positions forward, nore when we resend non-moving data)
|
// (i.e. NOT when we just simulate the positions forward, nore when we resend non-moving data)
|
||||||
// NOTE: Andrew & Brad to discuss. Let's make sure we're using lastEdited, lastSimulated, and lastUpdated correctly
|
// NOTE: Andrew & Brad to discuss. Let's make sure we're using lastEdited, lastSimulated, and lastUpdated correctly
|
||||||
quint64 lastSimulated = _entity->getLastSimulated(); // or now???
|
quint64 lastSimulated = _entity->getLastSimulated();
|
||||||
_entity->setLastEdited(lastSimulated);
|
_entity->setLastEdited(lastSimulated);
|
||||||
properties.setLastEdited(lastSimulated);
|
properties.setLastEdited(lastSimulated);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue