0

I have made several attempts to fix this and read all I could find here/forum/google. I used a CCD treshold mush lower than my objects move speed and using a CCD radius much smaller than the objects half radius. The only thing this does is make the multisphere get stuck on seams. I also tried to set ERP/ERP2 to 0.9/1.0. [EDIT] Ok, so after some more reading; CCD will not work if the sphere is already touching the ground and ERP only affeccts objectts with joints if I understand correctly.

The ground is a trimesh made in Blender and using the obtainStaticNodeShape to get the shape. I have tried to scale the mesh to get smaller polygons but even the smallest (for the game acceptable) size does not work, about 32k indices with 11k polys, 500x500 units, the multisphere has a radius of 0.45 units. [EDIT] the multi-sphere is two spheres on top of each other and they are restricted to angular movement around the Y-axis only, so no rolling.

The sphere gets "sucked" fast through the ground it does not sink slowly. I tried to make the fixedtimestep smaller 1/420 with 64 substeps did not give any better results. This happens most often while ascending or descending a slope. My ground is gently sloped but an incline of 20% seems to be enough for it to fall through a lot but it can happen on level ground too, just not as often.

When I did my first test I used a big stretched out cube as ground and it worked well.

So my problem now is I don't even know why this is happening so I have no idea what to try next? Can anyone please give me a solution or some pointers.

Is there any use in increasing the multi-sphere size (for the game I can not increase more than 25-30%) I have not explicitly set any collision margins but I think this would just make my sphere float over the ground? Is there any profit in changing the ground from a static object to a kinematic?

Would it work to use a raytest from the sphere straight down and push it up if it is lower than the ground? I think not, why would it fall through if it could detect the ground in the first place..?

[EDIT: additional info] There are quite a few occurrences of similar problems floating around on forums and also here at stack overflow. Most seem to be about very small objects. Small objects (>0.2m) is clearly not a good option for bullet unless you want to increase the number of simulation steps quite a lot. My problems does not seem to fall under this category since my smallest object is 0.9m in diameter?

I have now also done a debug draw to see the normals of the trimesh that I use as ground. I can not find any errors with the normals.

I also tried to increase the collission margins of the speheres but to no avail.

I further tried to use suggested settings: ((btDefaultCollisionConfiguration)world.collisionConfiguration).setPlaneConvexMultipointIterations(3,3); ((btDefaultCollisionConfiguration)world.collisionConfiguration).setConvexConvexMultipointIterations(3, 3); No difference.

I did however read about big trimeshes not working very well for raycasting, my mesh is big 512x512 units but I am not sure if this could cause my object to fall through the mesh?

I also read that sphere shapes has problems with trimeshes, but again I am not sure if this would be my case? The sphere I am using is locked for rotation on all axes.

I have also tried using a btCapsule but it gave same results.. Would a cylinder work better? [EDIT] I have tried using a cylinder instead since sphere and capsule did not work. The cylinder is working a lot better. I have still got it to fall through once though. The clyinder was jerking around a lot before it went through where the sphere/capsule would just go through really fast and easy. Maybe this could be a clue of whats the underlaying problem? A cylinder is not the best for a character shape though..

An other possible reason could be if a triangle in the mesh has too long sides or a large ratio between sides. I found a few of those on a slope where my sphere always falls through. If this is indeed the problem can I do anything about it except manually editing the mesh in Blender?

As you can see there are a lot of these questions and a lot of possible answers and I have no idea which one corresponds to my case, someone with better insight giving some pointers would mean a lot, thanks!

  • Please post a Minimal, Complete, Verifiable example that illustrates the problem you are asking about. – Code-Apprentice Sep 07 '14 at 19:48
  • Thank you for the answer! Providing a test sample is not a trivial task. Additionally you would have to install the libGDX framework with the Bullet plugin to run any sample I provide. I could do this as a last resort if anyone have the setup to run the sample. – Andreas Toresäter Sep 08 '14 at 08:39
  • Without some code, it is very difficult to diagnose the problem. – Code-Apprentice Sep 08 '14 at 08:44
  • CodeApprentice: I get what you are saying. If you read my post I have a lot of questions regarding details of the working of things in bullet, all those could be answered without any code though. I also posted a picture illustrating the problem on bullet's forum: http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=10104&p=33981#p33981 – Andreas Toresäter Sep 08 '14 at 09:11

0 Answers0