-
Notifications
You must be signed in to change notification settings - Fork 48
/
DynamicsB2ContactEdgeAndPolygon.go
34 lines (28 loc) · 1.25 KB
/
DynamicsB2ContactEdgeAndPolygon.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package box2d
type B2EdgeAndPolygonContact struct {
B2Contact
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// B2ContactEdgeAndPolygon.cpp
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
func B2EdgeAndPolygonContact_Create(fixtureA *B2Fixture, indexA int, fixtureB *B2Fixture, indexB int) B2ContactInterface {
B2Assert(fixtureA.GetType() == B2Shape_Type.E_edge)
B2Assert(fixtureB.GetType() == B2Shape_Type.E_polygon)
res := &B2EdgeAndPolygonContact{
B2Contact: MakeB2Contact(fixtureA, 0, fixtureB, 0),
}
return res
}
func B2EdgeAndPolygonContact_Destroy(contact B2ContactInterface) { // should be a pointer
}
func (contact *B2EdgeAndPolygonContact) Evaluate(manifold *B2Manifold, xfA B2Transform, xfB B2Transform) {
B2CollideEdgeAndPolygon(
manifold,
contact.GetFixtureA().GetShape().(*B2EdgeShape), xfA,
contact.GetFixtureB().GetShape().(*B2PolygonShape), xfB,
)
}