| 58 | func (edge *B2PolygonShape) Destroy() {} |
| 59 | |
| 60 | func (poly *B2PolygonShape) SetAsBox(hx float64, hy float64) { |
| 61 | poly.M_count = 4 |
| 62 | poly.M_vertices[0].Set(-hx, -hy) |
| 63 | poly.M_vertices[1].Set(hx, -hy) |
| 64 | poly.M_vertices[2].Set(hx, hy) |
| 65 | poly.M_vertices[3].Set(-hx, hy) |
| 66 | poly.M_normals[0].Set(0.0, -1.0) |
| 67 | poly.M_normals[1].Set(1.0, 0.0) |
| 68 | poly.M_normals[2].Set(0.0, 1.0) |
| 69 | poly.M_normals[3].Set(-1.0, 0.0) |
| 70 | poly.M_centroid.SetZero() |
| 71 | } |
| 72 | |
| 73 | func (poly *B2PolygonShape) SetAsBoxFromCenterAndAngle(hx float64, hy float64, center B2Vec2, angle float64) { |
| 74 | poly.M_count = 4 |