MCPcopy
hub / github.com/g3n/engine / ShowPenAxis

Function ShowPenAxis

experimental/physics/debug.go:41–69  ·  view source on GitHub ↗
(scene *core.Node, axis *math32.Vector3)

Source from the content-addressed store, hash-verified

39}
40
41func ShowPenAxis(scene *core.Node, axis *math32.Vector3) { //}, min, max float32) {
42
43 vertices := math32.NewArrayF32(0, 16)
44
45 size := float32(100)
46 minPoint := axis.Clone().MultiplyScalar(size)
47 maxPoint := axis.Clone().MultiplyScalar(-size)
48 //vertices.AppendVector3(minPoint.Clone().SetX(minPoint.X - size))
49 //vertices.AppendVector3(minPoint.Clone().SetX(minPoint.X + size))
50 //vertices.AppendVector3(minPoint.Clone().SetY(minPoint.Y - size))
51 //vertices.AppendVector3(minPoint.Clone().SetY(minPoint.Y + size))
52 //vertices.AppendVector3(minPoint.Clone().SetZ(minPoint.Z - size))
53 //vertices.AppendVector3(minPoint.Clone().SetZ(minPoint.Z + size))
54 vertices.AppendVector3(minPoint)
55 //vertices.AppendVector3(maxPoint.Clone().SetX(maxPoint.X - size))
56 //vertices.AppendVector3(maxPoint.Clone().SetX(maxPoint.X + size))
57 //vertices.AppendVector3(maxPoint.Clone().SetY(maxPoint.Y - size))
58 //vertices.AppendVector3(maxPoint.Clone().SetY(maxPoint.Y + size))
59 //vertices.AppendVector3(maxPoint.Clone().SetZ(maxPoint.Z - size))
60 //vertices.AppendVector3(maxPoint.Clone().SetZ(maxPoint.Z + size))
61 vertices.AppendVector3(maxPoint)
62
63 geom := geometry.NewGeometry()
64 geom.AddVBO(gls.NewVBO(vertices).AddAttrib(gls.VertexPosition))
65
66 mat := material.NewStandard(&math32.Color{1, 1, 1})
67 faceGraphic := graphic.NewLines(geom, mat)
68 scene.Add(faceGraphic)
69}
70
71func ShowContact(scene *core.Node, contact *collision.Contact) {
72

Callers 1

ConvexConvexMethod · 0.85

Calls 11

AppendVector3Method · 0.95
AddVBOMethod · 0.95
NewArrayF32Function · 0.92
NewGeometryFunction · 0.92
NewVBOFunction · 0.92
NewStandardFunction · 0.92
NewLinesFunction · 0.92
CloneMethod · 0.65
MultiplyScalarMethod · 0.45
AddAttribMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected