(scene *core.Node, contact *collision.Contact)
| 69 | } |
| 70 | |
| 71 | func ShowContact(scene *core.Node, contact *collision.Contact) { |
| 72 | |
| 73 | vertices := math32.NewArrayF32(0, 16) |
| 74 | |
| 75 | size := float32(0.0005) |
| 76 | otherPoint := contact.Point.Clone().Add(contact.Normal.Clone().MultiplyScalar(-contact.Depth)) |
| 77 | vertices.AppendVector3(contact.Point.Clone().SetX(contact.Point.X - size)) |
| 78 | vertices.AppendVector3(contact.Point.Clone().SetX(contact.Point.X + size)) |
| 79 | vertices.AppendVector3(contact.Point.Clone().SetY(contact.Point.Y - size)) |
| 80 | vertices.AppendVector3(contact.Point.Clone().SetY(contact.Point.Y + size)) |
| 81 | vertices.AppendVector3(contact.Point.Clone().SetZ(contact.Point.Z - size)) |
| 82 | vertices.AppendVector3(contact.Point.Clone().SetZ(contact.Point.Z + size)) |
| 83 | vertices.AppendVector3(contact.Point.Clone()) |
| 84 | vertices.AppendVector3(otherPoint) |
| 85 | |
| 86 | geom := geometry.NewGeometry() |
| 87 | geom.AddVBO(gls.NewVBO(vertices).AddAttrib(gls.VertexPosition)) |
| 88 | |
| 89 | mat := material.NewStandard(&math32.Color{0, 0, 1}) |
| 90 | faceGraphic := graphic.NewLines(geom, mat) |
| 91 | scene.Add(faceGraphic) |
| 92 | } |
no test coverage detected