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

Method decLibraryGeometries

loader/collada/library_geometries.go:228–258  ·  view source on GitHub ↗

Decodes "library_geometry" children

(start xml.StartElement, dom *Collada)

Source from the content-addressed store, hash-verified

226
227// Decodes "library_geometry" children
228func (d *Decoder) decLibraryGeometries(start xml.StartElement, dom *Collada) error {
229
230 lg := new(LibraryGeometries)
231 dom.LibraryGeometries = lg
232
233 for {
234 // Get next child START
235 child, _, err := d.decNextChild(start)
236 if err != nil || child.Name.Local == "" {
237 return err
238 }
239 // Decode optional asset
240 if child.Name.Local == "asset" {
241 lg.Asset = new(Asset)
242 err = d.decAsset(child, lg.Asset)
243 if err != nil {
244 return err
245 }
246 continue
247 }
248 //log.Debug("decLibraryGeometries: %s", child.Name.Local)
249 // Decode geometry
250 if child.Name.Local == "geometry" {
251 err = d.decGeometry(child, lg)
252 if err != nil {
253 return err
254 }
255 continue
256 }
257 }
258}
259
260// decGeometry receives the start element of a geometry and
261// decodes all its children and appends the decoded geometry

Callers 1

decColladaMethod · 0.95

Calls 3

decNextChildMethod · 0.95
decAssetMethod · 0.95
decGeometryMethod · 0.95

Tested by

no test coverage detected