collision-detection

Continuous collision detection between two moving tetrahedra

ⅰ亾dé卋堺 提交于 2019-11-29 02:25:05
问题 My question is fairly simple. I have two tetrahedra, each with a current position, a linear speed in space, an angular velocity and a center of mass (center of rotation, actually). Having this data, I am trying to find a (fast) algorithm which would precisely determine (1) whether they would collide at some point in time, and if it is the case, (2) after how much time they collided and (3) the point of collision. Most people would solve this by doing triangle-triangle collision detection, but

How to compute the smallest bounding sphere enclosing other bounding spheres

我的未来我决定 提交于 2019-11-29 00:40:01
问题 I'm looking for an algorithm which someone has access to that will compute the smallest bounding sphere that encloses a set of other bounding spheres. I have thought about this for a while and have come up with some initial solutions, but I don't believe these are necessarily the most accurate or the least computationally expensive (fastest). First Thought My first solution is the simplest naive one, which is to average out the sphere centers to get the center point, and then compute the

Resources of techniques use for collision detection in 2D?

半城伤御伤魂 提交于 2019-11-28 23:06:52
问题 What are in your opinion the best resources (books or web pages) describing algorithms or techniques to use for collision detection in a 2D environment? I'm just eager to learn different techniques to make more sophisticated and efficient games. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ 回答1: Collision detection is often a two phase process. Some sort of "broad phase" algorithm for determinining if two objects even have a chance of overlapping (to try to avoid n^2 compares) followed by a

An efficient way to simulate many particle collisions?

前提是你 提交于 2019-11-28 21:32:38
I would like to write a small program simulating many particle collisions, starting first in 2D (I would extend it to 3D later on), to (in 3D) simulate the convergence towards the Boltzmann distribution and also to see how the distribution evolves in 2D. I have not yet started programming, so please don't ask for code samples, it is a rather general question that should help me get started. There is no problem for me with the physics behind this problem, it is rather the fact that I will have to simulate at least 200-500 particles, to achieve a pretty good speed distribution. And I would like

QuadTree for 2D collision detection

孤人 提交于 2019-11-28 21:03:59
问题 I'm currently working on a 2D shoot them up type of game, and I'm using a quad tree for my collision detections. I wrote a working quad tree that correctly pushes my actors into the nodes/leaves they belong to in the tree. However, I've got a few problems. Firstly, how do I actually use my quadtree to select against which other objects an object should test collisions ? I'm unsure about how this is done. Which brings up a second question. Say I have an object in node that is not a neighbour

Find whether two triangles intersect or not

≡放荡痞女 提交于 2019-11-28 16:29:52
问题 Given 2 set of points ((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) and ((p1,q1,r1),(p2,q2,r2),(p3,q3,r3)) each forming a triangle in 3D space. How will you find out whether these triangles intersect or not? One obvious solution to this problem is to find the equation of the plane formed by each triangle. If the planes are parallel, then they don't intersect. Else, find out the equation of line formed by the intersection of these planes using the normal vectors of these planes. Now, if this line lies in

Broad-phase collision detection methods?

北战南征 提交于 2019-11-28 16:00:34
I'm building a 2D physics engine and I want to add broad-phase collision detection, though I only know of 2 or 3 types: Check everything against everything else (O(n^2) complexity) Sweep and Prune (sort and sweep) something about Binary Space Partition (not sure how to do this) But surely there's more options right? what are they? And can either a basic description of each be provided or links to descriptions? I've seen this but I'm asking for a list of algorithms available, not the best one for my needs. In this case, "Broad phase collision detection" is a method used by physics engines to

Best algorithm for efficient collision detection between objects

梦想与她 提交于 2019-11-28 15:53:44
I'm confused. Well not confused, so much as not wanting to do 6 test programs to see which algorithm is the best. So I thought I'd ask my expert friends here at SO to give me the benefit of their experience. The scenario is a 3d scene with potentially quite a large area compared to the sizes of the objects inside it. There are potentially thousands of objects in the scene. Objects vary in size from tenths of a unit to up to around 10 units, but no bigger (or smaller). The objects tend to be clustered together, but those clusters can potentially appear anywhere in the scene. All objects are

Detect collision/colliding only once

喜夏-厌秋 提交于 2019-11-28 14:31:46
I have an object that moves towards another object and physically collides with it, I want that collision/colliding event to happen only once. I tried using a bool but it didn't work as intended. It seems that I'm doing something wrong. bool doDamage = true; void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Target" && doDamage) { doDamage = false; // damage code } } void OnCollisionExit2D(Collision2D other) { if (other.gameObject.tag == "Target") { doDamage = true; } } Edit: I want the "damage code" to run only once, even if the 2 objects are still in contact. This

Detect collision of two UIView's in swift

大憨熊 提交于 2019-11-28 13:57:30
I have two UIViews on my ViewController. I added panGesture to first view and when i start moving this view the second view will move towards first view. I want to detect an event when these two views collides. Here is my code. @IBAction func dragFirstView(sender: UIPanGestureRecognizer) { let translation = sender.translationInView(self.view) dispatch_async(dispatch_get_main_queue()) { () -> Void in UIView.animateWithDuration(2.5, delay: 0.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { self.secondView.frame = CGRectMake(sender.view!.center.x + translation.x, sender.view!.center