[opensource-dev] Client-side prediction
nexiim at googlemail.com
Fri Feb 5 19:22:28 PST 2010
Ah, thanks Celierra. 3 planes, yes that makes a lot more sense.
Hmm, trying to step through your calculations. I think you have to subtract
the angle difference rather than add it on.
I just tried visually going through your calcs and it seems to hit right on
your perfect value p3.
On Sat, Feb 6, 2010 at 1:28 AM, Celierra Darling <Celierra at gmail.com> wrote:
> I'm not sure about this -- I tried this with a free-flight parabola and
> 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
> fit a line or spline to multiple previous values of v to get something
> 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...
More information about the opensource-dev