SpiderPig Posted February 12, 2023 Share Posted February 12, 2023 What could cause this? Could it be because the surface is a collidable sphere and it is curved too much for it to come to complete rest as a flat surface does? They are just cubes that fall onto a large sphere, nothing special. After a minute or two it stops in most cases. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted February 12, 2023 Author Share Posted February 12, 2023 Also it seems with sphere colliders the cubes are not actually colliding with the surface. For primitive shapes, such as cubes and spheres, is newton actually using the mesh to test collision? Or is it calculating the surface of the sphere with it's position and radius? That might explain why there is a gap. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted February 12, 2023 Author Share Posted February 12, 2023 I increased the segments of the sphere and there is less of a gap. Still the same jitter though. Quote Link to comment Share on other sites More sharing options...
Solution SpiderPig Posted February 12, 2023 Author Solution Share Posted February 12, 2023 So it appears that just a sphere collider will create the above issues. Using a sphere mesh collider works best. There is no gap between the surface(other than the obvious gap as the surface curves) and the jitter is gone completely. auto sphere = CreateSphere(world, 25.0f); auto collider = CreateMeshCollider(sphere->lods[0]->meshes[0]); sphere->SetCollider(collider); @Josh does all this sound like a bug to you or is it just the way of sphere collisions? Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted February 12, 2023 Author Share Posted February 12, 2023 A small example. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1440, 900, displays[0]); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); auto camera = CreateCamera(world); camera->Move(0, 26, -3); camera->SetClearColor(1, 0, 0); auto light = CreateDirectionalLight(world); light->SetRotation(35, 35, 35); auto sphere = CreateSphere(world, 25.0f); auto box = CreateBox(world); box->SetMass(1.0f); box->SetPosition(-0.5f, 26.0f, 0.0f, true); while (window->KeyHit(KEY_ESCAPE) == false && window->Closed() == false) { world->Update(); world->Render(framebuffer); } return 0; } Quote Link to comment Share on other sites More sharing options...
Josh Posted February 12, 2023 Share Posted February 12, 2023 I looks like is has trouble coming to rest, since the surface is not flat. I suppose no matter which way the cube falls, it's never going to be on a flat surface. In any case, I will check this out. You might also check out the cube sphere, as this will provide a more even distribution of polygons: https://www.ultraengine.com/learn/CreateCubeSphere?lang=cpp 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.