Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Problem with Sliding Collisions (ObjectSphereSlide)

Author
Message
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 30th May 2013 01:11 Edited at: 30th May 2013 01:12
With 3D, i have a problem with ObjectSphereSlide collisions ... in case of concave angle on a polygon (or convex if we are in it) the sliding iterations stops too quickly (in my case) and stops the sliding theorical movement ... (cf attached picture).

i would like be able to have a smooth movement along each side without being stopped in their junctions ...

any idea how i can workaround this ?

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th May 2013 11:53 Edited at: 30th May 2013 11:54
maybe like this with a plane in the edge

Attachments

Login to view attachments
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 30th May 2013 21:21
yes i think i have to smooth the corner ... but maybe if i rotate my position a little, toward the opposite side on each final slide collision i can workaround this ... the problem seems to rely on the number of iterations the command can check. Maybe we should add a "angle delta" parameter for sliding collision to set the delta angle between each check (or add the number of possible check "MaxIterations")

Maybe Paul can help ?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th May 2013 22:43
for what you need this sliding?
what is the red moving dot?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th May 2013 22:47
ObjectSphereSlide is tailored to player movement which is usually short frequent movements. Therefore to avoid jittering in corners it caps the number of iterations at 3 and does some math to work out where the final resting place might be, and this is usually close to the first collision point.

If you wanted to do you're own sliding collision without a limit on the iterations or assumptions about where the final point might be you can iteratively call ObjectSphereCast and use the sliding result from each as the input to the next until you either run out of movement vector (which should decrease each step) or you reach some self imposed limit. Note that this approach doesn't like acute angle corners (those less than 90 degrees) as the sliding result will never reach zero and you must stop it yourself at some point, this is the cause of most jitter in sliding collisions.

Login to post a reply

Server time is: 2024-05-04 18:50:39
Your offset time is: 2024-05-04 18:50:39