(fixtureA *B2Fixture, indexA int, fixtureB *B2Fixture, indexB int)
| 359 | } |
| 360 | |
| 361 | func 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 | |
| 386 | func B2ContactDestroy(contact B2ContactInterface) { |
| 387 | B2Assert(s_initialized == true) |
no test coverage detected