()
| 539 | } |
| 540 | |
| 541 | func (collider *B2EPCollider) ComputeEdgeSeparation() B2EPAxis { |
| 542 | axis := MakeB2EPAxis() |
| 543 | axis.Type = B2EPAxis_Type.E_edgeA |
| 544 | if collider.M_front { |
| 545 | axis.Index = 0 |
| 546 | } else { |
| 547 | axis.Index = 1 |
| 548 | } |
| 549 | axis.Separation = B2_maxFloat |
| 550 | |
| 551 | for i := 0; i < collider.M_polygonB.Count; i++ { |
| 552 | s := B2Vec2Dot(collider.M_normal, B2Vec2Sub(collider.M_polygonB.Vertices[i], collider.M_v1)) |
| 553 | if s < axis.Separation { |
| 554 | axis.Separation = s |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | return axis |
| 559 | } |
| 560 | |
| 561 | func (collider *B2EPCollider) ComputePolygonSeparation() B2EPAxis { |
| 562 |
no test coverage detected