Smoothed sphere collision response with triangle mesh

Post Reply
rebirth
Posts: 24
Joined: Thu Jul 24, 2014 2:48 am

Smoothed sphere collision response with triangle mesh

Post 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).
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Smoothed sphere collision response with triangle mesh

Post 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.
Post Reply