forked from ByteArena/box2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDynamicsB2ContactPolygon.go
34 lines (28 loc) · 1.16 KB
/
DynamicsB2ContactPolygon.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 PolygonContact struct {
Contact
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// B2ContactPolygon.go
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
func PolygonContact_Create(fixtureA *Fixture, indexA int, fixtureB *Fixture, indexB int) ContactInterface {
assert(fixtureA.GetType() == ShapeType.Polygon)
assert(fixtureB.GetType() == ShapeType.Polygon)
res := &PolygonContact{
Contact: MakeContact(fixtureA, 0, fixtureB, 0),
}
return res
}
func PolygonContact_Destroy(contact ContactInterface) { // should be a pointer
}
func (contact *PolygonContact) Evaluate(manifold *Manifold, xfA Transform, xfB Transform) {
CollidePolygons(
manifold,
contact.GetFixtureA().GetShape().(*PolygonShape), xfA,
contact.GetFixtureB().GetShape().(*PolygonShape), xfB,
)
}