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

Method decAcessor

loader/collada/common.go:212–234  ·  view source on GitHub ↗

decAcessore decodes the acessor from the specified source

(start xml.StartElement, source *Source)

Source from the content-addressed store, hash-verified

210
211// decAcessore decodes the acessor from the specified source
212func (d *Decoder) decAcessor(start xml.StartElement, source *Source) error {
213
214 // Sets accessor fields
215 source.TechniqueCommon.Accessor.Source = findAttrib(start, "source").Value
216 source.TechniqueCommon.Accessor.Count, _ = strconv.Atoi(findAttrib(start, "count").Value)
217 source.TechniqueCommon.Accessor.Stride, _ = strconv.Atoi(findAttrib(start, "stride").Value)
218
219 // Decodes accessor children
220 for {
221 // Get next child
222 child, _, err := d.decNextChild(start)
223 if err != nil || child.Name.Local == "" {
224 return err
225 }
226 // param
227 if child.Name.Local == "param" {
228 err = d.decParam(child, &source.TechniqueCommon.Accessor)
229 if err != nil {
230 return err
231 }
232 }
233 }
234}
235
236func (d *Decoder) decParam(start xml.StartElement, accessor *Accessor) error {
237

Callers 1

Calls 3

decNextChildMethod · 0.95
decParamMethod · 0.95
findAttribFunction · 0.85

Tested by

no test coverage detected