Barrels are Cylinder bodies that roll on their sides, with exact cylinder contacts in the physics #25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3934-a-barrel-lying-on-its-side-barely-rolls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3934
The first map's barrels were Convex Hull bodies of Kenney's octagonal barrel. Lying on its side, each facet stopped the roll, so a barrel pushed at 2 m/s stopped within 1.6 m. This PR adds a Cylinder rigid body shape, read from Blender's own Cylinder and colliding as an exact cylinder, and makes the five barrels Cylinder bodies.
What changes
src/physics). A newcylindershape along local +Y, with a solid cylinder's inertia.CYLINDER_CORE(2 cm, or a quarter of its least extent), so the cores of a cylinder and what it rests on stay apart and give the normal. Its farthest point along a direction is found in its own frame, so it lies on the cap's plane however near the axis the direction lies.src/physics/solids.sx). Movement meets a cylinder body as the 32-sided prism whose faces touch it.extract.pytakes an Active Cylinder: radius half the larger of the X and Y dimensions, half length half the Z dimension, as Blender sizes it.stage.sxand the world file carry shape kind 4.first_map.blend, and nothing else in the file changed.first_map_bodies.pyand the.mdsay so. The README lists the shape.ff70931(#3904's physics bench), after6c24bd0(#3931's trunk-slide movement).Evidence
tests/barrels.sxuses the map's own barrel as baked:git archivearm, every rolling check fails: the barrels stop after 1.55 and 1.15 m, and the slope barrel never moves.tests/physics_contacts.sxpins the manifolds:tests/physics_shapes.sx: the cylinder's inertia and extents;tests/solids.sx: a ray and a capsule dropped onto a lying cylinder meet it between its side and the prism's corners;tests/bake_stage.sx: a Cylinder body through the stage and the world file, and kind 5 is malformed;tests/bake_extract.py: Cylinder sizing, an uneven Z taken, an uneven Y refused;tests/first_map_bodies.sx: barrels are cylinders.ff70931and at the head, with one exception: infirst_map_bodies, the barrels are cylinders, and they settle within 0.03 mm of where the hulls did. Beyond that, the head only adds cases tophysics_contacts,physics_shapesandsolids, andphysics_bench_sceneprints the same figures at both.ff70931, which splits a tick into begin, solve and end, every test prints the same figures atb486ee4and at the head,barrels.sxincluded, but for the two new cases' lines. The bench, built at master and at the head and run interleaved undertaskpolicy -b, gives worst ticks of 0.544 and 0.538 ms at master and 0.544 and 0.537 ms at the head.past; no far end, or one at the core's radius; no tilted-cap rule, or one without its far point; the old checks on parallel capsules and cylinders; no interior check; and a cylinder's side taken as a capsule against another cylinder, or against a sphere or capsule, where their closest points lie past its rims (the separation then reads −0.045 m and −0.022 m for 0.001 m).collideTriangle's lone point for a cylinder taken by the cores' closest points.PARALLEL, as a capsule's do.The drawn barrel is Kenney's octagon, and its cylinder has the octagon's corner radius (0.534 m at scale 0.8). A barrel rolling with a flat face down therefore draws up to 4 cm above the ground. Agra's check in the app: pushed barrels roll.
Gates:
fullatba34b30passed (gate run 963): 42 tests, bench worst tick 0.544 ms.