Skip to content

V0.4.0 - #7

Merged
ragoune merged 11 commits into
masterfrom
v0.4.0
Oct 2, 2026
Merged

ragoune merged 11 commits into
masterfrom
v0.4.0

Conversation

@ragoune

@ragoune ragoune commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Feather v0.4.0

Collision filtering, scene queries, axis locks and spinning friction, plus a more
reliable regression bench.

Added

  • Collision filtering — layers and masks on every body, ignored pairs, and
    bodies linked by a joint, all resolved through a single pair table used by the
    broad phase, the triggers and the continuous collision. SetFilter changes a
    body's filter at runtime. A body with an empty mask takes part in queries only.
  • Scene queries — World.Raycast, RaycastAll, Sweep and Overlap, run
    through the AABB trees of the broad phase, with a QueryFilter (mask, excluded
    bodies, triggers). The trees are kept up to date at the end of each step;
    SyncQueries refreshes them after moving bodies by hand. Every shape
    implements CastRay.
  • Axis locks — LinearLock and AngularLock on dynamic bodies, along and
    around the world axes. A locked axis has no inverse mass, and the free axes use
    the exact inverse of the free block of the inertia.
  • Spinning resistance — Material.SpinningResistance, a warm-started
    friction row around the contact normal, bounded by
    resistance × radius × normal impulse. Off by default.

Fixed

  • Parasitic friction on single-point contacts — the friction lever arm is now
    measured between the contact point and the friction center on the same
    surface. A single contact point has a lever arm of exactly zero: a ball
    spinning on the ground no longer slows down on its own (it used to lose
    0.068 rad/s² with no resistance set).
  • Removing a body after it moved — the broad-phase tree no longer keeps a
    removed body in its list of moved bodies, which could panic on the next step.

Bench

  • New scenes: spinning tops, locked bodies and the query scenes.
  • Each phase is timed over three stack depths.
  • 11 measures that depend on floating-point rounding are now tracked by the
    median of 32 variants of their scene, with a tolerance derived from the spread
    of the ensemble, instead of a single run.
  • baseline.json regenerated (fingerprints and timings).

Breaking changes

  • actor.ShapeInterface gains CastRay: a shape implemented outside Feather
    must provide it.
  • A RigidBody built as a struct literal, without NewRigidBody, has an empty
    layer and mask and collides with nothing. Set
    Layer: actor.LayerDefault, Mask: actor.AllLayers.
  • Joint.CollideConnected is read by AddJoint; changing it afterwards has no
    effect.
  • Material, RigidBody and Manifold have new fields: unkeyed struct literals
    no longer compile.
  • Simulations are not bit-identical to v0.3.0, because of the friction fix above.
    Set Material.SpinningResistance to get a spin brake back.

Documentation

README, ALGORITHMS.md and PHYSICS_GUIDE.md cover the new features, with
their sources (Box2D v3, Box3D, Jolt, PhysX, Bullet, Rapier) cited by version.

ragoune added 11 commits October 2, 2026 11:59
…d bodies, queries-only bodies, SetFilter), the 2 points of the lying capsule; red: the filtering doesn't exist yet
…able, applied by the broad phase, the triggers and the continuous collision; SetFilter; the docs
…start), the depth of the stack of the bench; red: Material.SpinningResistance doesn't exist yet
…around the normal bounded by resistance * radius * normal impulse; the bench measures each phase over 3 depths of the stack; the bench scene spinning tops, the docs
…ugh the trees of the broad phase, kept up to date by the end of a step for the bodies it moved; CastRay of each shape; the bench scenes of the queries; the docs
…ocks): a locked axis kept bit for bit under the gravity, the contacts, the joints and the continuous collision, the exact inertia of a body on an axle, the friction off the axes
…rse mass along a locked axis and the exact inverse inertia around the free ones (the inverse of the free block of the inertia, where Jolt, Rapier, PhysX and Box3D keep the free block of the inverse); the bench scene locked bodies, the docs
… 0, a top keeps its 20 rad/s for 10 s without spinning resistance, the spinning resistance brakes at its formula at 0.1 %), the lever arms measured to the friction center on the surface of A, the twist bound of the solver and of a box spinning flat; the draws of the bench (the median of the 32 variants of a scene, its tolerance from the spread of the ensemble, the variants of the scenes of Solver2D); red: a single point has half its separation as a lever arm, the draws don't exist yet
…enter on the same surface (the point halfway against the center on the surface of A gave a single point half its separation as a lever arm: a ball spinning on the ground lost 0.068 rad/s² without any resistance), exactly 0 for a single point; the bench follows the 11 measures decided by the rounding by their median over 32 variants of their scene, with a tolerance from the spread of the ensemble; the reference of the bench, the docs
…wledgements say the source code was read; Bullet thanked for its dynamic AABB tree, its collision margin & its conservative advancement (read in 3.25), its margin named as such in ALGORITHMS.md
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.13953% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gjk/gjk.go 0.00% 6 Missing ⚠️
actor/shape.go 96.92% 1 Missing and 1 partial ⚠️
collision_heightfield.go 0.00% 2 Missing ⚠️
lock.go 96.72% 1 Missing and 1 partial ⚠️
query_sweep.go 98.36% 1 Missing and 1 partial ⚠️
joint_configurable.go 50.00% 0 Missing and 1 partial ⚠️
tree.go 92.30% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
actor/axes.go 100.00% <100.00%> (ø)
actor/capsule.go 97.56% <100.00%> (+0.73%) ⬆️
actor/heightfield.go 93.64% <100.00%> (+1.67%) ⬆️
actor/heightfield_walk.go 100.00% <100.00%> (ø)
actor/rigidbody.go 78.07% <100.00%> (+22.86%) ⬆️
articulation.go 92.59% <100.00%> (+2.40%) ⬆️
ccd.go 97.41% <100.00%> (+3.55%) ⬆️
collision.go 97.46% <ø> (+4.43%) ⬆️
constraint/constraint.go 40.00% <100.00%> (+15.00%) ⬆️
constraint/contact.go 0.00% <ø> (ø)
... and 14 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ragoune
ragoune merged commit d02001e into master Oct 2, 2026
4 checks passed
@ragoune
ragoune deleted the v0.4.0 branch October 2, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant