MCPcopy Create free account
hub / github.com/ByteArena/box2d / B2MixRestitution

Function B2MixRestitution

DynamicsB2Contact.go:15–21  ·  view source on GitHub ↗

Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. For example, a superball bounces on anything.

(restitution1, restitution2 float64)

Source from the content-addressed store, hash-verified

13/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface.
14/// For example, a superball bounces on anything.
15func B2MixRestitution(restitution1, restitution2 float64) float64 {
16 if restitution1 > restitution2 {
17 return restitution1
18 }
19
20 return restitution2
21}
22
23type B2ContactCreateFcn func(fixtureA *B2Fixture, indexA int, fixtureB *B2Fixture, indexB int) B2ContactInterface // returned contact should be a pointer
24type B2ContactDestroyFcn func(contact B2ContactInterface) // contact should be a pointer

Callers 2

ResetRestitutionMethod · 0.85
MakeB2ContactFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected