Advertisement

sphere-sphere collision time w/ accel.

Started by November 23, 2002 01:53 AM
5 comments, last by joanusdmentia 22 years, 2 months ago
hi, i was just wondering if anyone here knew the analytical solution to the time of the minimum distance between two moving spheres when acceleration != 0, so far i''ve got

0 = 2(DP*DV) + t(2*DV*DV + 2*DP*DA) + 3t^2(DV*DA) + t^3(DA*DA)

where DP = difference in positions
      DV = difference in velocities
      DA = difference in accelerations
 
but i''m not sure how to solve a cubic polynomial. thanks.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Google is your friend...

Cédric
Advertisement
yeah, i did check that actually. i was just wondering if anyone minded sharing a solution they previously found for it.

ne idea if it''s really worth using accel in collision detection? I was just throwing together a sphere-sphere collision routine and thought it would be cool to include acceleration but i really don''t think it''s going to make enough of a difference to be worth it

oh well, i think i''ll give that cubic another try. if i come up with anything i''ll post it here.


joanus d''mentia
---------------
The three phases of me...
The twit, the tool and the lonely fool
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
I''m not sure if anyone in game development uses acceleration in collision detection. Its an interesting problem, but my feeling is that it won''t do much for you and it may give you a result that you don''t expect. Consider that velocity is typically "quasi-steady" in game simulations, that is, it is held constant during each time step/frame and just jumps instantaneously to the next value at the next time step/frame. In a quasi-steady approach to motion simulation (which is what most numerical integrations do, really), the object really isn''t acting like it accelerates continuously. In fact, the object acts like it has infinite acceleration at the exact instance of the start of the next frame. In this case, you''d actually get an inconsistent collision point if you treat acceleration as a continuous function. Your collision might actually look wrong . And it would be wrong unless you treat velocity as varying continuously during a frame also.

If you really want to treat acceleration then you''d want to treat your velocity as varying over the time period of a frame, e.g., at the beginning of the frame the velocity is v_start_of_frame, at the end of the frame the velocity is v_end_of_frame, and during the frame the velocity varies from v_start_of_frame to v_end_of_frame somehow based on acceleration. Analytic approaches such as the old high school formulas for parabolic motion (direct integrations of Newton''s second law with constant acceleration) do treat velocity as continuously varying and you can apply them to more complex problems by assuming your objects follow a parabolic, simple projectile path during a given time step. But its a big headache.

My advice? Don''t do it unless you''re a glutton for punishment (so my Dad would say).

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Also, I hope you''re considering more than just acceleration due to gravity, as you can effectively ignore gravity for collision detection purposes(since both spheres are subject to equal acceleration).
quote:

Also, I hope you're considering more than just acceleration due to gravity, as you can effectively ignore gravity for collision detection purposes(since both spheres are subject to equal acceleration).



yeah, i was thinking of acceleration in general.

quote:

In a quasi-steady approach to motion simulation (which is what most numerical integrations do, really), the object really isn't acting like it accelerates continuously. In fact, the object acts like it has infinite acceleration at the exact instance of the start of the next frame. In this case, you'd actually get an inconsistent collision point if you treat acceleration as a continuous function. Your collision might actually look wrong . And it would be wrong unless you treat velocity as varying continuously during a frame also.



thanks, that's something i hadn't actually considered. I don't think it's going to be worth the trouble so i'm not going to worry about it. You see, I occasionally get this idea stuck in my head that would be really cool to implement...despite it being a total waste of time This one I think I'll force myself to leave be.

[edited by - joanusdmentia on November 26, 2002 2:21:40 AM]
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Advertisement
quote:
Original post by joanusdmentia
You see, I occasionally get this idea stuck in my head that would be really cool to implement...despite it being a total waste of time This one I think I''ll force myself to leave be.


I hear ya. Me too! That old K.I.S.S. principle is something to keep in mind usually!



Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement