Collision Margins confusion.
Posted: Tue Jan 20, 2015 4:25 am
Hello all,
So I stumbled across this forum post
http://www.bulletphysics.org/Bullet/php ... 995#p31234
from a while ago about collision margins and shapes. I watched the video and thought to myself, this is amazing. It's going to solve all of my problems. However when something looks to good to be true it usually is, so low and behold when I implemented functionality to change the collision margin into my program, it didn't produce the results I was expecting.
The video in the thread makes the collision margins out to be a kind of padding around the collision shape and states that the collisions can be resolved better when shapes are penetrating each others margins rather than their actual shapes.
When I looked at the code in a few cases the margin is subtracted from the original shape rather than added as a form of padding so if someone made the margin big enough the implicit shape dimensions could end up being negative on all axes which would cause problems wouldn't it? Is it a case that if I want it to act as some form of padding that I need to scale the shape to be the size I would expect including padding then use the margin to kind of shrink the shape back to the original size?
Would someone be able to explain what the margins do and how they work? or point me in the direction of another post which does this?
Thanks in advance.
So I stumbled across this forum post
http://www.bulletphysics.org/Bullet/php ... 995#p31234
from a while ago about collision margins and shapes. I watched the video and thought to myself, this is amazing. It's going to solve all of my problems. However when something looks to good to be true it usually is, so low and behold when I implemented functionality to change the collision margin into my program, it didn't produce the results I was expecting.
The video in the thread makes the collision margins out to be a kind of padding around the collision shape and states that the collisions can be resolved better when shapes are penetrating each others margins rather than their actual shapes.
When I looked at the code in a few cases the margin is subtracted from the original shape rather than added as a form of padding so if someone made the margin big enough the implicit shape dimensions could end up being negative on all axes which would cause problems wouldn't it? Is it a case that if I want it to act as some form of padding that I need to scale the shape to be the size I would expect including padding then use the margin to kind of shrink the shape back to the original size?
Would someone be able to explain what the margins do and how they work? or point me in the direction of another post which does this?
Thanks in advance.