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

Function B2ContactFactory

DynamicsB2Contact.go:361–384  ·  view source on GitHub ↗
(fixtureA *B2Fixture, indexA int, fixtureB *B2Fixture, indexB int)

Source from the content-addressed store, hash-verified

359}
360
361func B2ContactFactory(fixtureA *B2Fixture, indexA int, fixtureB *B2Fixture, indexB int) B2ContactInterface { // returned contact should be a pointer
362
363 if s_initialized == false {
364 B2ContactInitializeRegisters()
365 s_initialized = true
366 }
367
368 type1 := fixtureA.GetType()
369 type2 := fixtureB.GetType()
370
371 B2Assert(0 <= type1 && type1 < B2Shape_Type.E_typeCount)
372 B2Assert(0 <= type2 && type2 < B2Shape_Type.E_typeCount)
373
374 createFcn := s_registers[type1][type2].CreateFcn
375 if createFcn != nil {
376 if s_registers[type1][type2].Primary {
377 return createFcn(fixtureA, indexA, fixtureB, indexB)
378 } else {
379 return createFcn(fixtureB, indexB, fixtureA, indexA)
380 }
381 }
382
383 return nil
384}
385
386func B2ContactDestroy(contact B2ContactInterface) {
387 B2Assert(s_initialized == true)

Callers 1

AddPairMethod · 0.85

Calls 3

B2AssertFunction · 0.85
GetTypeMethod · 0.65

Tested by

no test coverage detected