Results 1 to 3 of 3

Thread: Unsufficient Collision Response

  1. #1
    Member Contributor
    Join Date
    May 2001
    Location
    Austria
    Posts
    54

    Unsufficient Collision Response

    hi folks

    i did some collision testing with my terrain, and that works quite fine, but i have some trouble with collision response.
    i have/had two ideas. the first one was, that every time a collision occurs, i just add something to my y-value to lift my camera. regarding collision this works just fine, but the scene is - of course - flickering not just a bit.
    the second idea i had, had to do with reflection. the flickering is gone and everything is smooth. BUT imagine this worst case scenario:
    i have to polygons. on is lying quite flat, the other is right "behind" this polygon in an angle almost perpendicular to the first polygon. when i have a collision with the first polygon close to the second polygon and with a flat angle to the first polygon, the reflected vector speeds me far behind the second polygon.
    anybody had a similar problem? how do i react if i am this far behind the polygon? or how do i prevent even to get in this scenarion.

    thanks for your help and insights,
    cheers,
    martin

  2. #2
    Senior Member Frequent Contributor marcus256's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    764

    Re: Unsufficient Collision Response

    Originally posted by martinzwigl:
    hi folks

    i have/had two ideas. the first one was, that every time a collision occurs, i just add something to my y-value to lift my camera. regarding collision this works just fine, but the scene is - of course - flickering not just a bit.

    Depending on what your collision detection/response is used for, you may try this:

    Add a small y-delta to all polygons before collision test. Use your algorithm with adding a y-component when a collision occurs. The magnitude of the addition could perhaps be proportional to the speed of movement and the "slope" of the surface that you hit.

    Finally, filter the corrected y coordinate so that the change occurs over time rather than instantaneous (thus removes flickering). The filtering will (in most cases) make the movement look more smooth and "proffesional".

    A simple filter is:

    yfilt(n) = k*y(n) + (1-k)*yfilt(n-1)

    where k = 2*dt/T, dt = frame duration, T = roughly the time it takes for yfilt to reach 80-90% of y (if y does a step from one value to another and then stays constant).

    /Marcus


    [This message has been edited by marcus256 (edited 09-07-2001).]

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,502

    Re: Unsufficient Collision Response

    One approach I have used to counteract this is to use a collision hull created from blurring the heightfield data, followed by rescaling. Then using a simple interpolation scheme to determine the minimum height at any point. While not suitable for precise collision detection, it worked just fine for a fly through of the terrain.

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. Collision response
    By Run-E in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-08-2001, 11:46 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