# Collision point in configuration space to body space

This topic is 4337 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

The collision detection is almost done. The collision time, normal and point have all been calculated. The point is in configuration space, though, and it is needed in body space in collision response. It seems, intuitively, to be a rather simple task to transform/convert it. But I feel like I'm missing something and I can't get it to work. Really annoying, when I seem so close. Please help me out. Thanks!

##### Share on other sites
Forgot to mention: I'm doing a ray trace in the minkowski sum. The collision point is where the ray hits the convex hull.

##### Share on other sites
unfortunately this is not an easy problem.

The ray hitpoint doesn't necessarily represent 1 contact point in worldspace. The Minkowski space simplifies the problem, and the features collapsed into a single point. One way is to position the objects in worldspace once you calculated your time of impact, and perform a new query (using SAT or GJK).

Alternatively you can perform the whole algorithm in worldspace and you have your contact point/normal.
See different implementations (both configuration space and worldspace) part of the Bullet physics library here:
http://www.continuousphysics.com/Bullet/BulletFull/classbtConvexCast.html

Thanks,
Erwin
http://bullet.sf.net

##### Share on other sites
How about finding the pair of closest points?

a - b = v
I have got v, but not the ones I need.

Read something about summing up all the barycentric coordinates with p and q for each body respectively.

I try not to use barycentric coords as I'm doing casey's (mollyrocket) implementation on GJK, with small changes due to the raytracing. The closest point in a simplex is calculated with simple projection onto the plane (from the normal I got from casey's algorithm).

It seems to be working fine, haven't tested it thoroughly though, but I do get a lot if iterations (between 7, for two circles, to 40, for circle-cube with certain relative velocities - a lot of iterations, wouldn't you say?), with the termination 1e-4 = sqr(||v||).

Do I need to implement bary coords? Cause we would favor an intuitive implementation. I understand that summing each barycentric coordinate multiplied with the simplex's coordinates results in the closest point, but the way of finding these coords seems, to me, to be rather complex, or am I missing something?

Could you help me out?
Tanks!

##### Share on other sites
Gino uses barycentric coordinates and stores corresponding points on A and B everytime a new point is added into a tetrahedron, so you can get the closest point straight away.

Everytime you add a point into the simplex, you weill have to calculate the points on A and B as well. WIthout barycentric coordinates, it could get messy. you will have to calculate.

The simplex points are actually a triplet of points. The point on the Minkowski sum, and the two corresponding points on A and B. Barycentric coords obviously help a great deal to find the A and B points.

That's my take on it.

What you could also do is find the feature on the objects that support the objects after the MTD is found. Either a polygon, segment or vertex. If it is not a polyhedron type of object (say, a cylinder), then it could get complicated. What sort of contact point you would get for a disk hitting the edge of a table?

1. 1
2. 2
3. 3
frob
15
4. 4
5. 5

• 20
• 12
• 13
• 14
• 83
• ### Forum Statistics

• Total Topics
632144
• Total Posts
3004413

×