Closed RossNordby closed 5 years ago
Strongly consider leaving cylinders and cones out of the first v2 release. Reasoning:
Spheres, boxes, and capsules are implemented in the alpha.
Cylinder priority should actually be pretty high, given that wheels are a thing. Convex hulls likely more important, still.
Lol, I came here to discuss whether cylinders and cones are even worth implementing since I've seen that in the Readme.md, but I see that got some thought already. I personally don't think they're worth implementing tbh, of course wheels are a thing, but most games just emulate wheels anyway, collision using a cylinder shape certainly would be more accurate than the typical 'single raycast' approach, but that can be improved, and also a naive implementation with a cylinder and coloumb friction model isn't perfect too. In any case, vehicles in special aren't an easy thing to achieve... you simply can't just naively attach cylinders to some chassis and hope that's going to work, you need to simulate stabilization bars too. Have you thought about a vehicle SDK like PhysX?
It's true that cylinders aren't extremely high value in general, but there are two reasons I'd still like them in the first release:
Have you thought about a vehicle SDK like PhysX?
v1 had a dedicated 'Vehicle' type that used ray or sweep tests for wheels plus its own constraints. I was never too happy with it due to the fundamentally nonphysical nature of the wheels, especially as I've gradually pushed for more and more interactive physicality in simulation.
It is possible to make a pretty decent constraints+physical wheels car- v1 has a few demos showing some options including a sway bar if I remember correctly. Similar approaches in v2 would be much faster and also more stable, so the need for a dedicated vehicle type with proper engine simulation and tire friction modelling is limited to high fidelity racing simulators- which I'm not making.
(To anyone that is interested in making a high fidelity racing sim in v2, I'd recommend creating custom constraints as needed rather than trying to create an entirely special-cased system. Updating at 600+ hz is often feasible, too.)
Those are definitely two great reasons to implement cylinders. Also, it's good to know you're actually using Bepu 2 in your projects as opposed to just solving problems that don't exist for people who might eventually have them. I've seen plenty of projects, most notably game engines fail/die because they didn't have a game to drive development and just tried to solve general problems nobody really was having. Keep up the incredibly good work! Bepu 2 is very promising and overall it's the best example of high-performance modern C# code I know of.
Cylinders (and convex hulls) have been defeated. Cones won't be in the release and aren't on any near term roadmaps.
Also,
Convex hulls will be by far the most difficult of the bunch
was a silly thing to say.
At the time of writing, testing focuses on spheres for simplicity while getting all the core systems up and running. But games need more than spheres.
In rough order of priority, the engine needs:
Convex hulls will be by far the most difficult of the bunch. All of their collision pairs are pretty complicated and don't SIMDify easily.
And an important note: we are avoiding the use of GJK/MPR/EPA for narrow phase collision detection across the board. While they work reasonably well, they come with too many implicit requirements and tuning knobs that trip people up. Dozens of pair types will be required.