i am developing a game which needs an accurate collision detection algorithm, when a object travels down a slope which isn't flat. To be more precise i need to simulate a skier who travels down a jump.
My first idea was to create simple bounding box around the skies and the jump. Then place the skier in mid air and start calculating gravity. When the two bounding boxes intersect => collision detected (this is how i did it in 2d). But the problem is that the skies are flat and the slope isn't.. so there is a chance that the ski will stick into the jump (due to curved surface of the jump) or even worse the skier will go under the jump (i don't want the skies to "sink" into the jump as well) .
What would be the best way of solving this? What i could think of is:
- when collision is detected, rotate the skies until the front and the back end of the skies are colliding with the surface.
Is this idea any good? Did any face this kind of problem? Would be better to morph the skies according to the slope (but this would probably be an overhead i can't afford)?
Thanks for the reply's.
P.S. if i didn't explain enough, write a comment and make a sketch.