Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
e5767da
WIP new body accelerator concept
mokiat Aug 1, 2026
1843ca2
Rework global accelerators
mokiat Aug 1, 2026
c09fbc7
Check enabled state in global acceleration evaluation
mokiat Aug 1, 2026
cb4f672
Add godoc
mokiat Aug 1, 2026
8d1ae9e
Remove unused constraints sets
mokiat Aug 1, 2026
046ecfa
WIP: New solo constraint API
mokiat Aug 1, 2026
db366e5
WIP: Starting total physics API rework
mokiat Aug 1, 2026
d631e4c
WIP: More changes
mokiat Aug 2, 2026
77373a2
WIP: Callback changes
mokiat Aug 2, 2026
8824f9e
Minor changes
mokiat Aug 2, 2026
b61e28a
Minor code changes
mokiat Aug 2, 2026
9a8372f
Add godoc for solo constraints
mokiat Aug 2, 2026
fcf767b
Minor code alignment changes
mokiat Aug 2, 2026
f6c3c6f
Minor godoc adjustments
mokiat Aug 2, 2026
e251a68
More adjustments and godoc
mokiat Aug 2, 2026
7828db9
Minor code change
mokiat Aug 2, 2026
492cfe0
Further code changes
mokiat Aug 2, 2026
0d94c50
Further improvements to code
mokiat Aug 2, 2026
53120fd
Bug fix
mokiat Aug 2, 2026
0cbe3fc
More code changes in new direction
mokiat Aug 2, 2026
76096b1
More code changes
mokiat Aug 2, 2026
79d4b96
Bug fixes and godoc
mokiat Aug 2, 2026
400f18e
Bug fix to pair constraint deletion
mokiat Aug 2, 2026
fa150c3
Prevent pair constraint for single body
mokiat Aug 2, 2026
a24a964
Make impulse and nudge settings per-scene
mokiat Aug 2, 2026
70b896e
More code rework
mokiat Aug 2, 2026
4f78ba7
More code changes
mokiat Aug 2, 2026
8503235
Minor comment adjustments
mokiat Aug 2, 2026
bfdb2de
More code adjustments
mokiat Aug 2, 2026
18743b6
More code rework
mokiat Aug 2, 2026
0f9f878
Add Each mothods to views
mokiat Aug 2, 2026
9240a99
Bug fix and godoc
mokiat Aug 2, 2026
4a87b75
Changes to util
mokiat Aug 2, 2026
66a9660
More code changes
mokiat Aug 3, 2026
6a1fdbb
Mode core rework
mokiat Aug 3, 2026
f120873
Minor refactoring
mokiat Aug 3, 2026
805722d
Use world-space inertia tensor
mokiat Aug 3, 2026
c69ccc4
Implement solo collision solver
mokiat Aug 3, 2026
3ffdb7c
Minor adjustments and godoc to SoloConstraintContext
mokiat Aug 4, 2026
4867c1c
Add godoc to SoloCollisionSolver
mokiat Aug 4, 2026
ef27d84
Implement pair collision solver
mokiat Aug 4, 2026
91f57a0
Add godoc and remove old file
mokiat Aug 4, 2026
04422a8
Add fixed position constraint solver
mokiat Aug 5, 2026
d079306
Add FixedRotation constraint solver
mokiat Aug 5, 2026
6deee57
Add fixed distance constraint solver
mokiat Aug 5, 2026
f924e64
Add copy position constraint solver
mokiat Aug 5, 2026
28eebdf
Add copy rotation constraint solver
mokiat Aug 5, 2026
af41899
Add composite constraint solvers
mokiat Aug 5, 2026
b5045ad
Remove sold old files
mokiat Aug 5, 2026
689641f
Add helper CreateHandle methods
mokiat Aug 6, 2026
d76c23a
Add additional godoc to Handle types
mokiat Aug 6, 2026
9749447
Add coilover constraint solver
mokiat Aug 6, 2026
2cc458a
Rework of Constraint contract
mokiat Aug 6, 2026
e045139
Minor improvement to Coilover solveer
mokiat Aug 8, 2026
fab9d5a
Add distance constraint solver
mokiat Aug 8, 2026
b76fc03
Changes to acceleration solver API
mokiat Aug 8, 2026
a54f8d6
Add axis-force acceleration solver
mokiat Aug 8, 2026
9373fdb
Add new direction-force acceleration solver
mokiat Aug 8, 2026
4e51e0e
Add helper functions for friction and restitution coefficients
mokiat Aug 8, 2026
ac41325
Add AABB type to shape3d package
mokiat Aug 8, 2026
441cdb9
Add AABB type to shape2d package
mokiat Aug 8, 2026
2fd4e5f
Improve Octree API in query3d package
mokiat Aug 8, 2026
b4cbe44
Improve Quadtree API in query2d package
mokiat Aug 8, 2026
58842dd
Handle non-symmetric shapes better in query trees
mokiat Aug 8, 2026
1c6bfb4
Improvements to shape packages related to AABB
mokiat Aug 9, 2026
9037b94
Use tighter fit for meshes in placement scenes
mokiat Aug 9, 2026
813e108
Rework placement3d API
mokiat Aug 9, 2026
ae1359f
Align placement2d API to placement3d
mokiat Aug 9, 2026
3346951
Align physics with new placement API
mokiat Aug 9, 2026
1f9fcc6
Add hybrid contact sinks
mokiat Aug 9, 2026
1173301
Add axis-range constraint solver
mokiat Aug 9, 2026
5a23d22
Add axis-displacement constraint solver
mokiat Aug 9, 2026
995abba
Rework placement3d filtering
mokiat Aug 11, 2026
bb91fb6
Rework placement2d filtering
mokiat Aug 11, 2026
c5555c4
Add ball-joint constraint solver
mokiat Aug 11, 2026
53f3e2d
add match-axes constraint solver
mokiat Aug 11, 2026
4669145
add match-rotations constraint
mokiat Aug 11, 2026
a6f74ba
Add copy-axis constraint solver
mokiat Aug 11, 2026
c534baa
Add axis-angle-range constraint solver
mokiat Aug 12, 2026
ef9b56b
Add airfoil acceleration solver
mokiat Aug 12, 2026
c8aadbf
Remove old airfoil solver
mokiat Aug 12, 2026
665bb3e
Fixes to airfoil solver
mokiat Aug 12, 2026
f9f6b34
Add drag acceleration solver
mokiat Aug 12, 2026
15b4f35
Remove old aerodynamics file
mokiat Aug 12, 2026
497a78e
Load terrains from asset
mokiat Aug 16, 2026
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
153 changes: 0 additions & 153 deletions core/spatial/placement2d/contact.go

This file was deleted.

156 changes: 156 additions & 0 deletions core/spatial/placement2d/contact_hybrid.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
package placement2d

// DeepestContact is a contact sink that retains the added [ObjectContact] and
// [TerrainContact] with the greatest Depth across both kinds.
//
// Its AddObjectContact method satisfies [ObjectContactCallback] and its
// AddTerrainContact method satisfies [TerrainContactCallback], so both can be
// passed directly to intersection routines. This makes it possible to pick the
// single deepest intersection without having to know in advance whether it will
// be with an object shape or with a terrain shape.
//
// At most one of [DeepestContact.ObjectContact] and
// [DeepestContact.TerrainContact] returns a contact. Ties in Depth are resolved
// in favor of the object contact.
type DeepestContact struct {
objectSink DeepestObjectContact
terrainSink DeepestTerrainContact
}

// Reset clears any retained contacts.
func (c *DeepestContact) Reset() {
c.objectSink.Reset()
c.terrainSink.Reset()
}

// AddObjectContact retains the given contact if it is deeper than any
// previously retained object contact.
func (c *DeepestContact) AddObjectContact(contact ObjectContact) {
c.objectSink.AddContact(contact)
}

// AddTerrainContact retains the given contact if it is deeper than any
// previously retained terrain contact.
func (c *DeepestContact) AddTerrainContact(contact TerrainContact) {
c.terrainSink.AddContact(contact)
}

// ObjectContact returns the deepest retained object contact and whether it is
// the deepest contact overall.
//
// The result is false when no object contact was added since the last Reset, as
// well as when a strictly deeper terrain contact was added, in which case
// [DeepestContact.TerrainContact] holds the deepest contact instead.
func (c *DeepestContact) ObjectContact() (ObjectContact, bool) {
objectContact, ok := c.objectSink.Contact()
if !ok {
return ObjectContact{}, false
}
terrainContact, ok := c.terrainSink.Contact()
if !ok {
return objectContact, true
}
if objectContact.Depth < terrainContact.Depth {
return ObjectContact{}, false
}
return objectContact, true
}

// TerrainContact returns the deepest retained terrain contact and whether it is
// the deepest contact overall.
//
// The result is false when no terrain contact was added since the last Reset,
// as well as when an equally deep or deeper object contact was added, in which
// case [DeepestContact.ObjectContact] holds the deepest contact instead.
func (c *DeepestContact) TerrainContact() (TerrainContact, bool) {
terrainContact, ok := c.terrainSink.Contact()
if !ok {
return TerrainContact{}, false
}
objectContact, ok := c.objectSink.Contact()
if !ok {
return terrainContact, true
}
if terrainContact.Depth <= objectContact.Depth {
return TerrainContact{}, false
}
return terrainContact, true
}

// ShallowestContact is a contact sink that retains the added [ObjectContact]
// and [TerrainContact] with the smallest Depth across both kinds.
//
// Its AddObjectContact method satisfies [ObjectContactCallback] and its
// AddTerrainContact method satisfies [TerrainContactCallback], so both can be
// passed directly to intersection routines. This makes it possible to pick the
// single shallowest intersection without having to know in advance whether it
// will be with an object shape or with a terrain shape.
//
// At most one of [ShallowestContact.ObjectContact] and
// [ShallowestContact.TerrainContact] returns a contact. Ties in Depth are
// resolved in favor of the object contact.
type ShallowestContact struct {
objectSink ShallowestObjectContact
terrainSink ShallowestTerrainContact
}

// Reset clears any retained contacts.
func (c *ShallowestContact) Reset() {
c.objectSink.Reset()
c.terrainSink.Reset()
}

// AddObjectContact retains the given contact if it is shallower than any
// previously retained object contact.
func (c *ShallowestContact) AddObjectContact(contact ObjectContact) {
c.objectSink.AddContact(contact)
}

// AddTerrainContact retains the given contact if it is shallower than any
// previously retained terrain contact.
func (c *ShallowestContact) AddTerrainContact(contact TerrainContact) {
c.terrainSink.AddContact(contact)
}

// ObjectContact returns the shallowest retained object contact and whether it
// is the shallowest contact overall.
//
// The result is false when no object contact was added since the last Reset, as
// well as when a strictly shallower terrain contact was added, in which case
// [ShallowestContact.TerrainContact] holds the shallowest contact instead.
func (c *ShallowestContact) ObjectContact() (ObjectContact, bool) {
objectContact, ok := c.objectSink.Contact()
if !ok {
return ObjectContact{}, false
}
terrainContact, ok := c.terrainSink.Contact()
if !ok {
return objectContact, true
}
if objectContact.Depth > terrainContact.Depth {
return ObjectContact{}, false
}
return objectContact, true
}

// TerrainContact returns the shallowest retained terrain contact and whether it
// is the shallowest contact overall.
//
// The result is false when no terrain contact was added since the last Reset,
// as well as when an equally shallow or shallower object contact was added, in
// which case [ShallowestContact.ObjectContact] holds the shallowest contact
// instead.
func (c *ShallowestContact) TerrainContact() (TerrainContact, bool) {
terrainContact, ok := c.terrainSink.Contact()
if !ok {
return TerrainContact{}, false
}
objectContact, ok := c.objectSink.Contact()
if !ok {
return terrainContact, true
}
if terrainContact.Depth >= objectContact.Depth {
return TerrainContact{}, false
}
return terrainContact, true
}
Loading
Loading