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

Method decPoint

loader/collada/library_lights.go:286–328  ·  view source on GitHub ↗
(start xml.StartElement, li *Light)

Source from the content-addressed store, hash-verified

284}
285
286func (d *Decoder) decPoint(start xml.StartElement, li *Light) error {
287
288 pl := new(Point)
289 li.TechniqueCommon.Type = pl
290
291 for {
292 child, cdata, err := d.decNextChild(start)
293 if err != nil || child.Name.Local == "" {
294 return err
295 }
296 if child.Name.Local == "color" {
297 err := d.decLightColor(child, cdata, &pl.Color)
298 if err != nil {
299 return err
300 }
301 continue
302 }
303 if child.Name.Local == "constant_attenuation" {
304 fv, err := d.decFloatValue(child, cdata)
305 if err != nil {
306 return err
307 }
308 pl.ConstantAttenuation = fv
309 continue
310 }
311 if child.Name.Local == "linear_attenuation" {
312 fv, err := d.decFloatValue(child, cdata)
313 if err != nil {
314 return err
315 }
316 pl.LinearAttenuation = fv
317 continue
318 }
319 if child.Name.Local == "quadratic_attenuation" {
320 fv, err := d.decFloatValue(child, cdata)
321 if err != nil {
322 return err
323 }
324 pl.QuadraticAttenuation = fv
325 continue
326 }
327 }
328}
329
330func (d *Decoder) decSpot(start xml.StartElement, li *Light) error {
331

Callers 1

Calls 3

decNextChildMethod · 0.95
decLightColorMethod · 0.95
decFloatValueMethod · 0.95

Tested by

no test coverage detected