0
\$\begingroup\$

implementing extrapolation using linear velocity, orientation and position like on here gafferongames.com/post/state_synchronization/ I'm a little confused if I want to extrapolate from a known position, velocity and orientation forward 8 tick ahead for example, how could I do that, any simple example?

I'm using p2.js physic engine.

\$\endgroup\$
  • \$\begingroup\$ Why is it that you want to do this? This is not how extrapolation is typically performed, so there may be simpler options if extrapolation is all you need. \$\endgroup\$ – DMGregory Nov 26 '19 at 22:16
  • \$\begingroup\$ @DMGregory I need it because that the only way I think to detect collision on an extrapolated object, I have linear velocity, orientation, and position do you know any way to extrapolate an object to be 10 ticks ahead from any position using those data? \$\endgroup\$ – Darwin Mendez Reyes Nov 26 '19 at 22:25
  • \$\begingroup\$ I'd recommend that you change your question to "How can I detect an upcoming collision 10 ticks in the future" — focus on the problem you want to solve, and you'll get answers that are efficient at solving it, maybe even moreso than the approach you've thought of so far. It would also help to understand why you need to detect these future collisions, so we can design for that context. \$\endgroup\$ – DMGregory Nov 26 '19 at 22:31
  • \$\begingroup\$ sure, I will do that, well what I'm trying to do is server-client, top-down view something like diep.io, so due latency clients will see others in the past, what I'm trying to do is compensate to be in present so others client aims at the correct target. i probably need to understand more about extrapolation right? \$\endgroup\$ – Darwin Mendez Reyes Nov 26 '19 at 22:47
  • \$\begingroup\$ Even better, then: "how can I visually compensate for latency in a diep.io style game" — looking at it in terms of extrapolating collisions might not be the best route to achieving that goal. \$\endgroup\$ – DMGregory Nov 26 '19 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.