Results 1 to 4 of 4

Thread: Collision response

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    Sweden
    Posts
    12

    Collision response

    Hi!
    I wnat to be able to roll and / or bounce a ball around in an arbitrary shaped landscape... And I want it to be reasonably correct according to physical laws.
    Any suggestions?
    Thanks!

    Ps. I have a working collision detecion. Ds

  2. #2
    Member Contributor
    Join Date
    Aug 2000
    Posts
    68

    Re: Collision response

    You say you have working collision detection so I assume you know therefore which face of your landscape the ball hits.

    If that the case then physically correct bouncing is quite easy (well...).

    You have to calculate the normal of that face. Then (and this is the hard part) you have to figure out the speed the ball was moving parallel to that normal. You invert that value and multiply it by a constant called the coefficient of restitution, e. This should only be a value between 0 and 1. The lower it is the smaller the subsequent bounce. (Note if you have it between -1 and 0 then that will invert the direction for you)

    Make sure you only change the speed parallel to the normal. This is quite difficult in 3d maths but then again its a challange.

    Ps. How did you get collision detection to work. On my engine if something moves too fast it can shoot throught the landscape in one frame and never collide. Did you manage to solve this problem.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Dunblane, Scotland
    Posts
    333

    Re: Collision response

    Zadkiel, sounds like a classic case of not taking into acount time in some way or another. You don't only have to check where the collider is and where it is going but also every point (infinite) inbetween. You need to find the distance to the colliding plane from the initial position this will show you where and how far to move.
    Reality is for idiots only the best over come it!

  4. #4
    Junior Member Newbie
    Join Date
    May 2001
    Location
    Sweden
    Posts
    12

    Re: Collision response

    Hi!
    Thanks for your help guys!
    ABout the ball going through the landscape... I honestly didn't test that yet... :-/
    I guess was hoping the framerate would be high enough (and the ball always slow enough)not to miss any collisions, but when i think about it I can see how this might become a problem. At the time my landscape is nothing more than a rather simple kind of a miniature golf course.
    Well... Thanks again and feel free to add anything you think I should take into account!

Similar Threads

  1. cuboid collision response
    By Dardan in forum OpenGL: General
    Replies: 0
    Last Post: 12-22-2012, 12:40 PM
  2. opinion needed, Collision detection and response
    By sharonGL in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 02-27-2005, 11:57 PM
  3. Collision response problem
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-15-2003, 04:26 AM
  4. Collision Response Woes
    By ioquan in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 07-25-2002, 09:21 PM
  5. Unsufficient Collision Response
    By martinzwigl in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-07-2001, 04:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean