Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ so a test written against the reference reads the same here.
| `aephysics.math` | vectors, quaternions, transforms, 3x3 matrices, bounding boxes, segment distances, inertia helpers, the deterministic atan2/cos/sin | done, `test_math.ae` (6M checks) |
| `aephysics.core` | bit set, id pool, hash set, arrays, the stack and arena allocators | done, `test_core.ae` (100k checks) |
| `aephysics.dynamic_tree` | the bounding volume hierarchy under the broad phase: SAH insertion, rotations, enlarge, sweep refit, partial rebuild in depth-first order, box / closest / ray / swept-box queries | done, `test_dynamic_tree.ae` (12k checks); [same tree as the reference, ray cast 1.9x its time](bench/RESULTS.md#dynamic_tree) |
| `aephysics.collision` | hull (quickhull), GJK distance and shape cast, contact manifolds, triangle mesh, height field, shapes with mass properties, ray and shape casts | next |
| `aephysics.hull` | quickhull with face merging, the half-edge hull with its mass properties, box / cylinder / cone / rock hulls, clone-and-transform with mirroring, support functions, ray cast, the 2D hull | done, `test_hull.ae` (438 checks); [same hulls as the reference, 1.6-2x its time](bench/RESULTS.md#hull) |
| `aephysics.collision` | GJK distance and shape cast, contact manifolds, triangle mesh, height field, shapes with mass properties, ray and shape casts | next |
| `aephysics.dynamics` | bodies, contacts, the constraint graph, islands, the Soft Step solver, joints (spherical, revolute, prismatic, distance, motor, weld, wheel), sensors, the character mover, the world | |
| `aephysics` | the public API | |

Expand Down
5 changes: 4 additions & 1 deletion aephysics/core/module.ae
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports (
BitSet, IdPool, HashSet, IntArray, Buffer, Stack, Arena,
alloc, free_bytes, alloc_count, bytes_in_use,
is_power_of_2, bounding_power_of_2, round_up_power_of_2, lower_power_of_2_exponent,
clz32, ctz32, ctz64, pop_count64, lsr,
clz32, ctz32, ctz64, pop_count64, lsr, lsr32,
bitset_create, bitset_destroy, bitset_set_count_and_clear, bitset_grow, bitset_union,
bitset_set, bitset_set_grow, bitset_clear, bitset_get, bitset_count, bitset_bytes,
idpool_create, idpool_destroy, idpool_alloc, idpool_free, idpool_count, idpool_capacity,
Expand Down Expand Up @@ -125,6 +125,9 @@ pop_count64(block: long) -> int {

// A logical shift right of a long by 1..63: what an unsigned shift does,
// where the language's shift is arithmetic.
// The logical shift right of an int, for 0 < n < 32.
lsr32(x: int, n: int) -> int { return (x >> n) & ((1 << (32 - n)) - 1) }

lsr(value: long, shift: int) -> long {
if shift <= 0 { return value }
if shift >= 64 { return 0 }
Expand Down
Loading
Loading