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

Method decPhong

loader/collada/library_effects.go:569–647  ·  view source on GitHub ↗
(start xml.StartElement, pc *ProfileCOMMON)

Source from the content-addressed store, hash-verified

567}
568
569func (d *Decoder) decPhong(start xml.StartElement, pc *ProfileCOMMON) error {
570
571 ph := new(Phong)
572 pc.Technique.ShaderElement = ph
573
574 for {
575 child, _, err := d.decNextChild(start)
576 if err != nil || child.Name.Local == "" {
577 return err
578 }
579 if child.Name.Local == "emission" {
580 err := d.decColorOrTexture(child, &ph.Emission)
581 if err != nil {
582 return err
583 }
584 continue
585 }
586 if child.Name.Local == "ambient" {
587 err := d.decColorOrTexture(child, &ph.Ambient)
588 if err != nil {
589 return err
590 }
591 continue
592 }
593 if child.Name.Local == "diffuse" {
594 err := d.decColorOrTexture(child, &ph.Diffuse)
595 if err != nil {
596 return err
597 }
598 continue
599 }
600 if child.Name.Local == "specular" {
601 err := d.decColorOrTexture(child, &ph.Specular)
602 if err != nil {
603 return err
604 }
605 continue
606 }
607 if child.Name.Local == "shininess" {
608 err := d.decFloatOrParam(child, &ph.Shininess)
609 if err != nil {
610 return err
611 }
612 continue
613 }
614 if child.Name.Local == "reflective" {
615 err := d.decFloatOrParam(child, &ph.Reflective)
616 if err != nil {
617 return err
618 }
619 continue
620 }
621 if child.Name.Local == "reflectivity" {
622 err := d.decFloatOrParam(child, &ph.Reflectivity)
623 if err != nil {
624 return err
625 }
626 continue

Callers 1

Calls 3

decNextChildMethod · 0.95
decColorOrTextureMethod · 0.95
decFloatOrParamMethod · 0.95

Tested by

no test coverage detected