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

Method decMaterial

loader/collada/library_materials.go:93–113  ·  view source on GitHub ↗
(start xml.StartElement, lm *LibraryMaterials)

Source from the content-addressed store, hash-verified

91}
92
93func (d *Decoder) decMaterial(start xml.StartElement, lm *LibraryMaterials) error {
94
95 mat := new(Material)
96 mat.Id = findAttrib(start, "id").Value
97 mat.Name = findAttrib(start, "name").Value
98 lm.Material = append(lm.Material, mat)
99
100 for {
101 child, _, err := d.decNextChild(start)
102 if err != nil || child.Name.Local == "" {
103 return err
104 }
105 if child.Name.Local == "instance_effect" {
106 err := d.decInstanceEffect(child, &mat.InstanceEffect)
107 if err != nil {
108 return err
109 }
110 continue
111 }
112 }
113}
114
115func (d *Decoder) decInstanceEffect(start xml.StartElement, ie *InstanceEffect) error {
116

Callers 1

decLibraryMaterialsMethod · 0.95

Calls 3

decNextChildMethod · 0.95
decInstanceEffectMethod · 0.95
findAttribFunction · 0.85

Tested by

no test coverage detected