forked from ByteArena/box2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DynamicsB2ContactPolygonAndCircle.go
34 lines (28 loc) · 1.26 KB
/
DynamicsB2ContactPolygonAndCircle.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 B2PolygonAndCircleContact struct {
B2Contact
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// B2ContactPolygonAndCircle.cpp
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
func B2PolygonAndCircleContact_Create(fixtureA *B2Fixture, indexA int, fixtureB *B2Fixture, indexB int) B2ContactInterface {
B2Assert(fixtureA.GetType() == B2Shape_Type.E_polygon)
B2Assert(fixtureB.GetType() == B2Shape_Type.E_circle)
res := &B2PolygonAndCircleContact{
B2Contact: MakeB2Contact(fixtureA, 0, fixtureB, 0),
}
return res
}
func B2PolygonAndCircleContact_Destroy(contact B2ContactInterface) { // should be a pointer
}
func (contact *B2PolygonAndCircleContact) Evaluate(manifold *B2Manifold, xfA B2Transform, xfB B2Transform) {
B2CollidePolygonAndCircle(
manifold,
contact.GetFixtureA().GetShape().(*B2PolygonShape), xfA,
contact.GetFixtureB().GetShape().(*B2CircleShape), xfB,
)
}