[opensource-dev] Client-side prediction

Celierra Darling Celierra at gmail.com
Fri Feb 5 17:28:51 PST 2010

I'm not sure about this -- I tried this with a free-flight parabola and got
a nonsense value out. Calculations attached at the end.

What is the significance of the "anchor"?  It looks like you're trying to
estimate the center of the path's curvature?  If you were doing that, you
want to intersect using the lines through p and *perpendicular* to v (in
2D), not intersect the lines created by v.  In 3D, I think you'd want to
intersect 3 planes, the two planes through p perpendicular to their
respective v and also the plane that contains both points.

I'm not sure how to extend that to handle torques on the object....

Have you tried estimating a = (v1 - v2)/t, and extrapolating using that
(p_next = p_cur + v_cur*dt + 1/2*a*dt^2)?  It would also extend to torques
and angular velocity using the analogous equation.  (I'm sure you could even
fit a line or spline to multiple previous values of v to get something even
higher-order, if you wanted, though with diminishing returns.)


The aforementioned calculation:

dt = 0.1
a = g = [0,-2]

initial position and velocity:
p1 = [0, 0]
v1 = [1, 0]

next position and velocity
p2 = [0.1, -0.01]
v2 = [1, -0.2]

perfect value: p3 = [0.2, -0.04]

lines are (p1 + s*v1) and (p2 + t*v2)
intersect at s = 0.05, t = -0.05, position = [0.05, 0]

angle change = clockwise 3pi/4 (radians)
current angle = -pi/4
angle after "twist" = pi/2 (upwards!?)

(it just gets worse from here - you estimate a distance upwards, and the
step forward using the current velocity doesn't get you back to y=0.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20100205/5704c928/attachment-0001.htm 

More information about the opensource-dev mailing list