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

Method NewGroup

loader/obj/obj.go:220–231  ·  view source on GitHub ↗

NewGroup creates and returns a group containing as children meshes with all the decoded objects. A group is returned even if there is only one object decoded.

()

Source from the content-addressed store, hash-verified

218// with all the decoded objects.
219// A group is returned even if there is only one object decoded.
220func (dec *Decoder) NewGroup() (*core.Node, error) {
221
222 group := core.NewNode()
223 for i := 0; i < len(dec.Objects); i++ {
224 mesh, err := dec.NewMesh(&dec.Objects[i])
225 if err != nil {
226 return nil, err
227 }
228 group.Add(mesh)
229 }
230 return group, nil
231}
232
233// NewMesh creates and returns a mesh from an specified decoded object.
234func (dec *Decoder) NewMesh(obj *Object) (*graphic.Mesh, error) {

Callers

nothing calls this directly

Calls 3

NewMeshMethod · 0.95
AddMethod · 0.95
NewNodeFunction · 0.92

Tested by

no test coverage detected