forked from ByteArena/box2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDynamicsB2ContactEdgeAndCircle.go
34 lines (28 loc) · 1.19 KB
/
DynamicsB2ContactEdgeAndCircle.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 EdgeAndCircleContact struct {
Contact
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// B2ContactEdgeAndCircle.cpp
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
func EdgeAndCircleContact_Create(fixtureA *Fixture, indexA int, fixtureB *Fixture, indexB int) ContactInterface {
assert(fixtureA.GetType() == ShapeType.Edge)
assert(fixtureB.GetType() == ShapeType.Circle)
res := &EdgeAndCircleContact{
Contact: MakeContact(fixtureA, 0, fixtureB, 0),
}
return res
}
func EdgeAndCircleContact_Destroy(contact ContactInterface) { // should be a pointer
}
func (contact *EdgeAndCircleContact) Evaluate(manifold *Manifold, xfA Transform, xfB Transform) {
CollideEdgeAndCircle(
manifold,
contact.GetFixtureA().GetShape().(*EdgeShape), xfA,
contact.GetFixtureB().GetShape().(*CircleShape), xfB,
)
}