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

Function AddType

DynamicsB2Contact.go:346–359  ·  view source on GitHub ↗
(createFcn B2ContactCreateFcn, destroyFcn B2ContactDestroyFcn, type1 uint8, type2 uint8)

Source from the content-addressed store, hash-verified

344}
345
346func AddType(createFcn B2ContactCreateFcn, destroyFcn B2ContactDestroyFcn, type1 uint8, type2 uint8) {
347 B2Assert(0 <= type1 && type1 < B2Shape_Type.E_typeCount)
348 B2Assert(0 <= type2 && type2 < B2Shape_Type.E_typeCount)
349
350 s_registers[type1][type2].CreateFcn = createFcn
351 s_registers[type1][type2].DestroyFcn = destroyFcn
352 s_registers[type1][type2].Primary = true
353
354 if type1 != type2 {
355 s_registers[type2][type1].CreateFcn = createFcn
356 s_registers[type2][type1].DestroyFcn = destroyFcn
357 s_registers[type2][type1].Primary = false
358 }
359}
360
361func B2ContactFactory(fixtureA *B2Fixture, indexA int, fixtureB *B2Fixture, indexB int) B2ContactInterface { // returned contact should be a pointer
362

Callers 1

Calls 1

B2AssertFunction · 0.85

Tested by

no test coverage detected