Page 1 of 1

Smoothed sphere collision response with triangle mesh

Posted: Wed Aug 24, 2016 5:30 am
by rebirth
Hi,

I am only using a sweep test for the collision detection and I'm handling the response myself. The code is different from the character controller because I'm attaching to ground with a ray (stays parallel with ground - ground normal is 'up') and other things. The problem I am having is with curved walls, or walls that I want to be curved but are made up of triangles, as you'd expect from a triangle mesh. I'd like to find a method for smoothing the normals so I can interpolate between these surfaces, so the collision response gives me a nice curved motion and was wondering if Bullet supported such a feature. If not, then I was wondering if there might be an expert out there who could recommend a method that I may try out or research.

Thanks

P.S. as a temp fix I am lerping the quaternion I make with the new direction vector, but this still gives me unrealistic results because ideally I would want a more exact interpolating curve (there's no way of knowing what to set 't' to for this function).

Re: Smoothed sphere collision response with triangle mesh

Posted: Fri Aug 26, 2016 7:07 pm
by benelot
If you have both quaternions, you should easily be able to slerp from one quaternion to the other. If you have given both quaternions and some kind of measure as you reach the edge of the triangle, you could easily achieve smooth rotation. Look into quaternion slerp.