issue1.png [ 174.97 KiB | Viewed 1634 times ]
issue2.png [ 174 KiB | Viewed 1634 times ]
In issue1.png, the player stands on the block below the green arrow, then he suddenly moves left, quite fast. The player gets stuck in the left wall, as can be seen in the image, he's not falling like he should. Look at the bounding boxes, the player's bb seems to be stuck between the two blocks to the left, where the red arrow is pointing. If the character jumps perfectly vertical (applying an upwards force), he gets unstuck and falls to the bottom block as he should.
In issue2.png, the player runs to the left then he jumps. Upon landing, he gets stuck as can be seen in the image. Again, I think he's stuck between those two blocks, the red arrow is pointing towards where he's stuck. If he moves to the right, towards where the yellow arrow is pointing, he gets unstuck and can progress to the left afterwards.
Apparently the player's bounding box is penetrating the block, he has a Y coordinate of 10.6764. When I then press the right arrow, he gets unstuck and his Y coordinate becomes 10.6765. A block has a width of exactly 1, collision margin 0, mass 0. The character has mass 1 and collision margin set to 50
which I don't understand why it is not reflected in the bounding box, the bounding box clearly still has a width of 1. (actually 0.85, I want the char to fall through 1 width gaps so he must fit).
The two questions:- why does the character get stuck in these cases?
- why doesn't setMargin do anything to my character's collision box?
- the physics initialization code:
mConvexAlgo2d.reset(new btConvex2dConvex2dAlgorithm::CreateFunc(mSimplex.get(), mPdSolver.get()));
//m_broadphase = new btSimpleBroadphase();
///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
- all objects have btBox2DShape collision shapes.
I'm sorry if the issue has been tackled before, but I searched the forums and google and nothing came up. I initially tried to solve the issue by setting collision margin on my character, but that did nothing.
Thank you in advance for any help you can provide me!