On Friday 08 January 2010 20:51:18 Dahlia Trimble wrote:
> I thought each terse update packet includes the sim time dilation at the
> time the update was generated. Could this be used to scale the velocity to
> slow the motion down? (if it's not already). May not help for network lag
> but should help for heavily loaded sims.
> 
> -Dahlia
> 


The time dilation is used in LLViewerObject::idleUpdate (llviewerobject.cpp 
starting at around line 1980.) every frame to interpolate velocity, position 
angular velocity, and rotation for moving objects.

Maybe an optimization could be to factor in the sim's last known time dilation 
somehow together with the time dilation when the interpolated object last 
received an update (mTimeDilation)?

I think the way it tries to compensate for the fact that the sim sends 
velocity averaged over the last sim frame is wrong. I think for the case of 
constant acceleration this would be wrong:
LLVector3 delta_pos = (vel + (0.5f * (dt-PHYSICS_TIMESTEP)) * accel) * dt;

(dt there is the time since the last viewer frame (compensated for sim time 
dilation). That doesn't make much sense to me, but maybe I'm missing 
something.

A better way is to do:
vel = vel + accel * (0.5f * PHYSICS_TIMESTEP * mTimeDilation)
in LLViewerObject::processUpdateMessage.

Also, note that ping interpolation doesn't do what it says it does 
(https://jira.secondlife.com/browse/SNOW-390 )

Thickbrick
_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/SLDev
Please read the policies before posting to keep unmoderated posting privileges

Reply via email to