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

Method decAnimation

loader/collada/library_animations.go:121–156  ·  view source on GitHub ↗
(start xml.StartElement, la *LibraryAnimations)

Source from the content-addressed store, hash-verified

119}
120
121func (d *Decoder) decAnimation(start xml.StartElement, la *LibraryAnimations) error {
122
123 anim := new(Animation)
124 la.Animation = append(la.Animation, anim)
125 anim.Id = findAttrib(start, "id").Value
126 anim.Name = findAttrib(start, "name").Value
127
128 for {
129 child, _, err := d.decNextChild(start)
130 if err != nil || child.Name.Local == "" {
131 return err
132 }
133 if child.Name.Local == "source" {
134 source, err := d.decSource(child)
135 if err != nil {
136 return err
137 }
138 anim.Source = append(anim.Source, source)
139 continue
140 }
141 if child.Name.Local == "sampler" {
142 err = d.decSampler(child, anim)
143 if err != nil {
144 return nil
145 }
146 continue
147 }
148 if child.Name.Local == "channel" {
149 err = d.decChannel(child, anim)
150 if err != nil {
151 return nil
152 }
153 continue
154 }
155 }
156}
157
158func (d *Decoder) decSampler(start xml.StartElement, anim *Animation) error {
159

Callers 1

decLibraryAnimationsMethod · 0.95

Calls 5

decNextChildMethod · 0.95
decSourceMethod · 0.95
decSamplerMethod · 0.95
decChannelMethod · 0.95
findAttribFunction · 0.85

Tested by

no test coverage detected