![]() | This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||
|
![]() | The contents of Hitbox was merged into Collision detection on 23 July 2019. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. For the discussion at that location, see its talk page. |
Added a link to the GJK algorithm, the best algorithm known for distance between convex polytopes.
I've been doing some work on the ragdoll physics article and related subjects. --Nagle 05:13, 9 March 2006 (UTC)
For anyone interested, there is a request for the "sweep and prune" collision detection algorithm on Wikipedia:Requested articles/Applied arts and sciences/Computer science, computing, and Internet#Algorithms. Quick external link: [1]; a wealth of information can be found on Google. When done, please create the article sweep and prune to redirect here to the relevant section, and remove the request from the requested articles list. -- intgr 01:36, 17 December 2006 (UTC)
This statement is unqualified. How can you say that the numerical algorithm is unstable when you haven't even presented the numerical algorithm? If you used an implicit method, for example, it would be unconditionally stable. Certain explicit algorithms would be unconditionally unstable, but some of course would be stable provided the time step is sufficiently small. Moreover, one would probably use an adaptive time stepper because the problem would become very stiff once collisions start to take place... Discostu5 18:40, 13 January 2007
--Isc ekul 05:17, 2 May 2007 (UTC)
As to the above I hope you meant 10 digits of precision in decimal and 250 digits in binary - other wise I'd imagine you to have a very broken computer (just my joke)87.102.17.177 22:03, 19 June 2007 (UTC)
In this field, there's generally a strong distinction between collision detection, which is a purely geometric problem, and collision response, which is concerned with the physics of simulating what happens when collisions are detected. Material on the latter should be moved out to physics engine or ragdoll physics, where it's already covered. --John Nagle 07:02, 6 May 2007 (UTC)
Did some cleanup work, but the article is still something of a mess. I've cleaned up the description of the Lin-Canny / GJK convex polyhedron systems, which I know something about. Now we need a better description of the precomputation-based approaches, where trees are precomputed from level maps and collision with the fixed features is computed cheaply. That's not something I've worked with, and someone who really understands that stuff should write it up.
Actually, numerical stability in collision detection isn't a serious problem any more. (It was ten years ago, but we're past that.) Numerical stability in collision response is still tough. But that's a different subject. --John Nagle 07:39, 6 May 2007 (UTC)
great article nice to see a mention of bounding volumes etc - this would be a good start for someone to learn about computer games physics programming - assuming they could understand all the words, but the section Collision_detection#Video_games states "Almost all games use a posteriori collision detection" - I don't think this is nowadays true - I think most new 3d games use an "a priori" method on a frame by frame basis - (is this a mixture of a priori and a posteriori?) - so in a give 1/50sec frame a typical engine would calculate the distance to intersection when moving in a given direction and then compare with the distance travelled in that time - effectively calculating the when the touch things are touching. This applies to linear motion.
If the the object is rotating I know of two methods that are still commonplace - one is to approximate the area produced by the rotating line by a triangle, the other is to solve the quadratic associated with rotation (more accurate) - both are still a priori.
When an object is rotating and translating approximations are used - typically using both the translation and rotation detection one each in turn - this obviously is an approximation - but typically the movements are small in given frame and the approximation is satisfactory for games.
In case of objects moving under gravity etc usually a 'a priori' method is used on a frame by frame basic with the approximation used that an arc (parabola) is well estimated by a series of short straight lines along its path.
I'm not aware of any method that uses a 'a posteriori' method on a frame by frame basis nowadays though I can imagine that it used to be used.
The methods I've described above would calcualted friction etc in between the frames - effectively they convert the 'smooth' motion of a thing into a series of small straight lines (typically one line per frame) and then accurately test for the exact touching point on collision of the thing moving along that line.87.102.20.50 00:39, 10 June 2007 (UTC)
Now I've read in more detail I realise the article to be shit in parts - see below. The bits on bsp trees was quite good though.
Added links to the two main collision detection research groups: Berkeley and Oxford. Cited M.C. Lin paper properly. We could use more on precomputed spatial partitioning methods, which is how most games do walls. --John Nagle 16:39, 16 June 2007 (UTC)
"binary search is known to be relatively inefficient compared to other root-finding algorithms such as Newton's method."
I removed this. It was put back in - what does newtons method for finding roots have to do with collision detection
—Preceding unsigned comment added by 87.102.17.177 (talk • contribs) 14:25, 19 June 2007
Dear anonymous editor,
Collision detection involves finding when the distance d(x,y) between two objects x and y becomes zero (i.e., root finding on the distance function d). Two such methods are bisection and Newton's method, but there are many other methods as well.
I reverted you the previous time, I will revert you this one additional time. If you delete this passage again, I will rely upon another editor to make the appropriate decision.
I don't know if it would be possible for me to make a request of you, but if you don't understand something, would it be possible for you to ask on the talk page instead of modifying the article?
Thank you very much,
What about the question? ie is there a single example in which newtons method is USEFUL in finding a collision point - if so name it - otherwise why did you revert.?
Lin's findings are not relevant for inclusion - just because you found means nothing - is that why you reverted - because you didn't like your additions removed? Loisel 15:58, 19 June 2007 (UTC)
Addendum: for an overview, see section 2.3 of this paper. [3] Loisel 16:18, 19 June 2007 (UTC)
Oh great a sarcastic cunt- thanks - I asked a question see above.
A. What does the linked page Newton's method have do do with finding a collision in any general case - for simple motion - linear, rotating exact solutions are known. For more complex cases eg motion in magnetic fields the equations of motion are complex and it may not be possible to even solve the differential equation giving the motion.
B. What does the 'binary search' refer to in this case - is it some sort of iterative method to get to a best estimate of the collision distance - in which case the phrase 'binary search' hardly is a good discription. If not what is it exactly?
I doubt you can even fucking answer these - thats why the biggest thing you can do is revert on site - am I right?87.102.17.177 16:37, 19 June 2007 (UTC)
Also Ph.D students 'MC Lin' or whatever - that paper is (as the article states) useless (a lot like most students) so why does it even get a mention? Is the author a friend of Lin or wants to be friends. Any idiot can come up with an unworkable idea - the real methods involve bsp or bounding volumes etc and triangle triangle intersections or similar.87.102.17.177 16:42, 19 June 2007 (UTC)
First off, let me point you to WP:CIVIL, which is official policy. Please do not violate this rule again.
Second, if you want to learn about rootfinding and collision detection, consult the literature, it is easy. I found a rough paper which I linked above, and a google search also yields http://www.springerlink.com/content/y485230u8147111r/, which is in Springer. "An Integrated Runge–Kutta Root Finding Method for Reliable Collision Detection in Multibody Systems" by Gerald Grabner and Andrés Kecskeméthy.
Third, I have never met M. C. Lin, never spoken to her, and she does not know of me. We're not in the same field at all. I'm a numerical mathematician at Temple University http://www.math.temple.edu/~loisel/ and she's a professor of computer science at UNC http://www.cs.unc.edu/~lin/. I've never set foot in North Carolina.
Finally, the point of that paragraph is not to pitch this algorithm to anyone, but this being an encyclopedia, I was just trying to give as many alternatives as I knew of. Loisel 16:59, 19 June 2007 (UTC)
ok I removed this
"Given that exact numbers are impossible to obtain, one can also use a simple a posteriori algorithm, and then use a binary search to attempt to compute the first moment of collision, if any. However, aside from the fact that this approach may miss some collisions, binary search is known to be relatively inefficient compared to other root-finding algorithms such as Newton's method."
In what way are exact numbers impossible to obtain.?
"one can also use a simple a posteriori algorithm, and then use a binary search to attempt to compute the first moment of collision, if any" should be at least "one can also use a simple a posteriori algorithm such as a binary search to attempt to compute the first moment of collision, if any"
Is binary search actually inefficient compared to another iterative process such as newtons method? - calculating with binary search takes n steps to get to more than n bits accuracy - and the only compuation required is to test whether the object has crossed another object.
Newton's method involves calculating a (potentionally complex) function a number of times - for complex motion (as I stated above) the equation of motion may not even be known. Unless small time frames are used bsp partioning or similar will break down (cease to reduce the amount of objects to be considered)
I'd expect a reference that states that a root finding algorthym is better than binary search.
—Preceding unsigned comment added by 87.102.17.177 (talk • contribs) 17:41, 19 June 2007
First, please consult WP:SIG and sign your further comments by putting three or four tildes at the end of your comments.
Second, the article that I gave above, http://www.springerlink.com/content/y485230u8147111r/, uses a much more complicated root finding algorithm than binary search. First, the "event function" (the d(x,y) distance function) is interpolated using a polynomial. This is done by augmenting the ODE of the system by adjoining differential equations for the distance functions. Then the RK integrator gives a dense output, consisting of a polynomial which interpolates the true solution (including the event function) over the time interval. Third, the roots of this polynomial over the time interval are found using Sturm sequences (I do something similar, but I use the Durand-Kerner method instead.) Finally, the exact zero of the distance functions are found by running a Newton-Raphson rootfinding algorithm on the (nonpolynomial) distance functions, and using the roots found by the Sturm sequence algorithm as initial guesses. The overall algorithm is compared to LSODAR, which is a black-box numerical integrator that includes event handling. By comparison, LSODAR apparently uses a variant of the secant method and bisection method, as does MATLAB's ODE suite (see Brent's method.) The black-box algorithms can sometimes be faster, but part of the point of the Grabner paper is that the interpolation method more reliably catches the first event in a time interval. Apparently, they found that for 25+ spheres, LSODAR works 20-30% slower than their algorithm.
Loisel 18:05, 19 June 2007 (UTC)
Well you certainly used a lot of names there but that really doesn't help. I'm assuming that you were saying that the root finding algorhythm was better. if the distance functions are not polynomials then why does it need a rootfinding algorhythm to find the zero? typing error? Also as you say LSDOR is an integrator - does that use a binary search then ? Otherwise what you've just said is irrelevant? (it's definately not 100% binary search by a long shot is it?)
and my other questions/comments - any thoughts?.
(comment - It seems that you must be looking at more complex movements of simple shapes (particle physics or something?) whereas I tend to imaging the problem in term of examples where motion is relatively simple - but shapes may be very complex ?? so I may not fully understand the type of methods you need to use)
why doesn't the article decribe a method that works eg test for ray/plane (6 of) and line/line collsion (9 of) (brackets give the numbers for a single triangle)
- and what is the obsession with convex polyhedra - utilising only convex shapes doesn't give such a major reduction in computation as bounding volumes etc (also described) - as far as I can tell this is info that is just an academic curiosity no more?
Also the link to the Gilbert-Johnson-Keerthi distance algorithm has a link within that is to a paysite - this link *"The Gilbert-Johnson-Keerthi distance algorithm: a fast version for incremental motions", Ong and Gilbert this should be removed.
Also how is MC Lins work relevant?
Also why no mention that linear motion is a good approximation when dealing with small time frames eg 1/20 - 1/60 sec for computer graphics? —Preceding unsigned comment added by 87.102.17.177 (talk • contribs)
" We note here that if the trajectories of the vertices are assumed to be linear polynomials in t then the final sixty functions are in fact cubic polynomials, and in this exceptional case, it is possible to locate the exact collision time using the formula for the roots of the cubic. Some numerical analysts suggest that using the formula for the roots of the cubic is not as numerically stable as using a root finder for polynomials."
most of this should be removed.
1. "..assumed to be linear polynomials in t then the final sixty functions are in fact cubic polynomials" comment if the trajectories of verticies are for example quartics the final sixty functions are NOT CUBICS - the paragraph as it is is simply wrong - what was it meant to say?
2. "Some numerical analysts suggest that using the formula for the roots of the cubic is not as numerically stable as using a root finder for polynomials" - needs a citation - is this hearsay or what?
Is the paragraph trying to say that complex motion equations can be approximated by cubics over a small time frame? (that's my guess) - I expect this to be deleted or substationally corrected - as it stands it is nonsense - please help. Thank you.
I have no idea what it is supposed to say so I cannot begin to correct it.
Collision_detection#Exact_pairwise_collision_detection third paragraph (including the one line paragraph at beginning - quote "There are twenty such planes." - as far as I can tell this should be 18 reason - the two planes formed by the triangles don't count? I'm assuming I've understood - can someone please check this.87.102.17.177 20:53, 19 June 2007 (UTC)
The algorhytm described isn't very good (to test whether or not two stationary triangles intersect)- a simpler one would be to:
Part A
Part B
I'm sure that this test will use less compatation than the 18 (20? see previous question) planes each with 2 cross products to be calculated. Note that part B will be used very rarely but can be included for completeness.
Personally I'd recommend an 'a priori' method instead that attempts to calculate the intersections in small time frames (for rag-doll type stuff) using linear approximations to rotary motion if you don't want to solve the quadratic associated with rotary motion. Under rare conditions this will miss collisions but no more than any other method (except those which find exact solutions)
I'm sure that anyone who knows maths should be easily able to find a references for this method and recognise it's betterness as well as maybe give it a name. According to wiki-law I can't include it now as without references it would be original research - no way is such a simple method original though.87.102.17.177 21:28, 19 June 2007 (UTC)
Would efforts to devise an automated method for detecting traffic collisions fall under the scope of this article? 69.140.152.55 (talk) 01:21, 10 September 2008 (UTC)
This seems to be producing an ongoing series of edits. First, this is really a collision response or game physics issue, not a collision detection issue. That whole discussion belongs in Game physics. Second, the discussion here seems to be mostly original research. Third, what I think someone is trying for here is to talk about simulation systems where there's a "fixup step" in handling collisions. This is a hack that tries to back out of a collision hard case in a way that's not physically valid but usually yields plausible gameplay. The technology of modern physics engines has gone beyond that, but some older games did it that way.
The actual distinctions in collision detection are more related to the geometry. There are algorithms for spheres (easy and fast). There are algorithms for convex polyhedra (hard, bur fast). There are algorithms for "polygon soups" of arbitrary triangles (hard and can be slow). There are algorithms that work against "height fields" for terrain (medium hard, and fast). There are algorithms for vertical walls (complex, require precomputation, but very fast). Some algorithms only measure the distance between objects; others support interpenetration, and have a notion of "interpenetration distance" or "negative distance". "Negative distance" has its own set of problems; Prof. Steven Cameron at Oxford has come up with some ideas in that area.
Personally, I think about half the material in the article is bogus. (I used to write physics engines; I seem to be the first one who made a ragdoll physics engine that really worked, back in 1997, and hold a key patent in this area.) Much of the uncited material in this article could be deleted. Game physics and Ragdoll physics have better citations and cover some of the same material. --John Nagle (talk) 04:37, 27 September 2008 (UTC)
Actually, discussion of this subject belongs in game physics, but since someone put the term "impulse" in the article, it's worth mentioning. In the real world, there are forces, but no impulses. An "impulse" is a simplified abstraction - an infinite force applied over zero time with finite energy, resulting in an instantaneous change in velocity. Collisions between infinitely rigid objects (which do not exist in reality) behave that way. Using this abstraction makes computation faster, although it doesn't look right for big objects. --John Nagle (talk) 17:57, 29 October 2010 (UTC)
It might be useful to have an image from a game which compares the apperance of an object with its collision model. Maybe something similar to these two images: Models Hitboxes Toomai Glittershine (talk) 03:17, 10 June 2011 (UTC)
As far as I can see, the section "Optimization" spends a lot of time describing specific techniques and implementation instead of explaining the principles, mentioning existing techniques, discussing general issues and giving an overview. The "Exploiting temporal coherence" subsection seems to explain a particular implementation of sweep and prune, going into more detail than the sweep and prune article itself, and spends little time on temporal coherence in general. The "Pairwise pruning" subsection does not mention that other pairwise pruning methods exists, such as precise but expensive bounding volumes like the convex hull of non-convex objects, and spends very little time on general issues. The "Exact pairwise collision detection" focuses first and foremost on collisions between triangles in 3 dimensions, and other issues, approaches and collision objects are not discussed, such as images and volumes, other geometric representations, and morphing vs. rigid objects.
Furthermore, the organization is inconsistent: While the first couple of subsections suggests starting from the broadest phase of collision detection to a narrower and narrower phase (n-body/broad phase pruning ("Exploiting temporal coherence"), pair-wise pruning, exact pair-wise collision detection), "a priori pruning" is then mentioned, and coming back to "spatial partitioning", which is a broad phase pruning technique.
Finally, the subsections seems to constitute a narrative, making it harder to read, understand subsections independently of each other, as well as making it difficult to edit and add to the section.
I believe that a rewrite of the section is needed, with a focus on the following properties:
Does anyone disagree? — Preceding unsigned comment added by Poxelcoll (talk • contribs) 16:46, 5 April 2012 (UTC)
I suggest we move the "Bounding boxes" section up to just above "Exploiting temporal coherence" because I think it kind of explains what the sections above says, just much simpler and it will be kind of like a preview.
I haven't read everything under "optimization" mostly because I think its hard to understand it, but from what I have understood from that I read about it I think it is kind of the same.
--Sebbes333 (talk) 13:50, 16 December 2013 (UTC)
As the article now stands, there are forty-some uses of the pronoun "we", some of which are used in ways generally considered unencylopedic. Per the link from
![]() | This article's tone or style may not reflect the encyclopedic tone used on Wikipedia. |
the relevant text is:
However, there is also
Now I would argue that the use of "we" in this article is sometimes, but not always the inclusive we; in a mathematics article the author and reader are following a shared line of reasoning, so it is not incorrect to say something like "…and we can see from Lemma 22 that…". Some of the uses here are in the same vein. However, we also have sentences like "In physical simulation, we wish to conduct experiments, such as playing billiards." In these sentences, the assertion is not that the reader wants to conduct billiards experiments; the "we" is a "we" of unspecified person, and could be replaced with the more formal "one".
Still, there may be other reasons to preserve these "we"s that I am overlooking. If the consensus is that there are, please pardon my boldness and remove the template. 98.23.158.64 (talk) 03:30, 27 August 2014 (UTC)
I have a new scheme for fast collision detection. It relies on a maintenance of the mesh triangle's centroid. Given a single point detector. Just use the 3D Cartesian coordinates. So with sets of centroid, a state of collision can be defined as a certain scalar distance between target and object centroid points. The threshold for action is defined.
Exact triangle intersection is avoided. This method is just as valid of all others because the mesh form is approximative also.
I updated the page. I got help from a sci.math newsgroup mathematician. I will reference him if this method is well received. — Preceding unsigned comment added by Millsseintific (talk • contribs) 13:50, 29 May 2016 (UTC)
108.31.110.233 (talk) 14:00, 26 May 2016 (UTC)
I don't see how we can write a fully-fledged article on this, especially as reliable sources (at least on the web) seem to be scarce. Adam9007 (talk) 00:06, 27 March 2018 (UTC)
@OnlyNano: Why does this section have this cleanup tag? Jarble (talk) 04:08, 28 January 2024 (UTC)
The first section says: This particular example also turns out to be ill conditioned: as a small error in any calculation will cause drastic changes in the final position of the billiard balls.
I think this is mischaracterization of what is actually going on. In physical simulation, a tiny change in the initial condition (or any intermediate step) can make a big change in the evolution of the simulation over time. This is not due to the system being ill conditioned, but because it is chaotic. Any type of change: be it an error, a different approximation or a slight change in initial positions and velocities of the billiard balls would lead to be big change in the outcome.
More importantly, this discussion of change in final position of the billiard balls should not be part of this page as collision detection should focus on ways to detect if the balls touch each other or intersect. Not on how the balls move post a collision. This should be discussed in the context of simulation or specific collision responses. I guess I agree with many previous talk topics on this page. ThothOfTheSouth (talk) 04:06, 7 November 2024 (UTC)