Sphere / Plane Collision

Feb 8, 2009 at 8:27 AM
Anyone had any experience with sphere/plane collision ?

I'm having a bit of an issue when I have a plane that is not horizontal. As I had trouble with box/sphere collision I found a way round it using sphere/plane collision. I have made a video you can find here...


As you can see, when the ball rolls up the plane it kinda starts to float. Now, I think I have the orientation of the plane correct - the grey cube is set to the same orientation and seems to run parallel to the surface. The black line is the surface normal and that looks ok too.

Anyone know if this is a bug or am I doing something wrong?
Feb 8, 2009 at 1:22 PM
hi Tw1ster!

I looked at the problem with the sphere-box collision. I wasn't able to find the cause for the "jumping", but i noticed that it affects all primitives and even all solvers.

You switched to plane-sphere collision? A plane in JigLibX has infity size. Did you change anything?

What do you think about writing your own collider and pass it to the collisionSystem? Do you save your levels in xml-format? You could write something like a LevelSphereCollider. Shouldn't be that hard because you can look how the sphere collision is done in the other collider classes.
Feb 8, 2009 at 1:42 PM
Hi, well thanks for looking anyway :)

Havn't changed anything with JigLibX to implement the planes instead of boxes. I do it a stupid way round though. Basically I work out which surface the player is on, then create a plane that runs parallel but just above that surface. Then, I work out when the player is on a surface that isn't the same (like they start going up hill) and remove the old plane and create a new one that is parallel to the new surface. It's really the long way round but most importantly it *almost* works!

As for writing my own collider, what do you mean?

My levels are saved in text files actually, basically a CSV file which is read in when the level loads. I'm a bit unsure what you mean about writing a LevelSphereCollider? I'd be willing to write one if I knew how? :)

Oct 29, 2009 at 5:53 PM
Edited Oct 29, 2009 at 6:01 PM


I'm doing a ball-platformer and this is a really big issue. Has anyone ever found a way to solve this?


EDIT\ Sorry, the problem I'm having is about box/sphere collision, as in here: http://jiglibx.codeplex.com/Thread/View.aspx?ThreadId=44589&ProjectName=JigLibX , which was the thread I intended to post.