compound: the baked compound, with the sphere, capsule and material split out - #10
Merged
Merged
Conversation
…plit out aephysics.compound, Box3D's compound.c in Aether: capsules, hulls, meshes and spheres packed into one block under a tree rebuilt in full and carried in the block with its traversal stack; materials shared by value (deduplicated field by field through core's LongMap), hulls and meshes shared by content (their own hash, then their bytes); a mesh child's four material slots remapped into the compound's table; the bounds, overlap, ray and shape casts, box query and the mover's planes through the tree, each child in its own frame and its result carried back with the child and the material. So the shape dispatch can reach the compound without a cycle, sphere.c and capsule.c become aephysics.sphere and aephysics.capsule, the surface material aephysics.material, and the hull's mover moves beside the mesh's; aephysics.shape imports them all and gains the compound kind in every query. tree_validate accepts a baked tree. test_compound.ae: the reference's creation, material, sharing, child order, bounds, cast, remap, overlap, query and mover subtests (the byte roundtrip is not ported), plus the compound through the shape dispatch and a field of a thousand spheres. 159 checks. bench/compound.ae against bench/compound_box3d.c on 2,000 children: the same hits and sums on every phase; the build 0.7x, queries, overlaps and movers 1.3-1.6x, the shape cast 2.1x, the ray cast 2.9x with the time in the tree traversal itself, recorded to profile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The eleventh layer: Box3D's compound.c as
aephysics.compound.create_compound: the children's bounds into a tree rebuilt in full and carried in the block (nodes, proxies and a traversal stack); materials deduplicated field by field through core'sLongMap; hulls and meshes shared by their own hash verified by bytes; a mesh child's four material slots remapped.get_compound_childin the order capsules, hulls, meshes, spheres.overlap_compound,ray_cast_compound,shape_cast_compound,query_compound,collide_mover_and_compound,compute_compound_aabb,make_compound_child_sweep.aephysics.shapedispatch to the compound without an import cycle,sphere.candcapsule.cnow live asaephysics.sphereandaephysics.capsule, the surface material asaephysics.material, and the hull's mover beside the mesh's.shapeimports them all and gainscompound_shapeplus the compound branch in every query.dynamic_tree.tree_validateaccepts a baked tree (no parents).test_compound.ae: the reference's subtests minus the byte roundtrip, plus the compound through the shape dispatch and a field of a thousand spheres. 159 checks;test_shape.aeunchanged at 440.bench/compound.aevsbench/compound_box3d.c: identical hits and sums; build 0.7x, queries/overlaps/movers 1.3-1.6x, shape cast 2.1x (GJK cast and overlap on proxies with radii run at 2-2.5x the reference #9), ray cast 2.9x with the time intree_ray_castitself (issue to follow). Recorded inbench/RESULTS.md.