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

Method OperateOnVertices

geometry/geometry.go:214–229  ·  view source on GitHub ↗

OperateOnVertices iterates over all the vertices and calls the specified callback function with a pointer to each vertex. The vertex pointers can be modified inside the callback and the modifications will be applied to the buffer at each iteration. The callback function returns false to continue or

(cb func(vertex *math32.Vector3) bool)

Source from the content-addressed store, hash-verified

212// the modifications will be applied to the buffer at each iteration.
213// The callback function returns false to continue or true to break.
214func (g *Geometry) OperateOnVertices(cb func(vertex *math32.Vector3) bool) {
215
216 // Get buffer with position vertices
217 vbo := g.VBO(gls.VertexPosition)
218 if vbo == nil {
219 return
220 }
221 vbo.OperateOnVectors3(gls.VertexPosition, cb)
222
223 // Geometric properties may have changed
224 g.boundingBoxValid = false
225 g.boundingSphereValid = false
226 g.areaValid = false
227 g.volumeValid = false
228 g.rotInertiaValid = false
229}
230
231// ReadVertices iterates over all the vertices and calls
232// the specified callback function with the value of each vertex.

Callers 2

ApplyMatrixMethod · 0.95
AddMorphTargetsMethod · 0.80

Calls 2

VBOMethod · 0.95
OperateOnVectors3Method · 0.80

Tested by

no test coverage detected