MCPcopy Index your code
hub / github.com/g3n/engine / decInstanceGeometry

Method decInstanceGeometry

loader/collada/library_visual_scenes.go:401–425  ·  view source on GitHub ↗
(start xml.StartElement, n *Node)

Source from the content-addressed store, hash-verified

399}
400
401func (d *Decoder) decInstanceGeometry(start xml.StartElement, n *Node) error {
402
403 // Creates new InstanceGeometry,sets its attributes and associates with node
404 ig := new(InstanceGeometry)
405 ig.Url = findAttrib(start, "url").Value
406 ig.Name = findAttrib(start, "name").Value
407 n.Instance = ig
408
409 // Decodes instance geometry children
410 for {
411 // Get next child element
412 child, _, err := d.decNextChild(start)
413 if err != nil || child.Name.Local == "" {
414 return err
415 }
416 // Decodes bind_material
417 if child.Name.Local == "bind_material" {
418 err := d.decBindMaterial(child, &ig.BindMaterial)
419 if err != nil {
420 return err
421 }
422 continue
423 }
424 }
425}
426
427func (d *Decoder) decBindMaterial(start xml.StartElement, dest **BindMaterial) error {
428

Callers 1

decNodeMethod · 0.95

Calls 3

decNextChildMethod · 0.95
decBindMaterialMethod · 0.95
findAttribFunction · 0.85

Tested by

no test coverage detected