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

Method parseKe

loader/obj/obj.go:833–848  ·  view source on GitHub ↗

Parses emissive color: Ke r g b

(fields []string)

Source from the content-addressed store, hash-verified

831// Parses emissive color:
832// Ke r g b
833func (dec *Decoder) parseKe(fields []string) error {
834
835 if len(fields) < 3 {
836 return dec.formatError("'Ke' with less than 3 fields")
837 }
838 var colors [3]float32
839 for pos, f := range fields[:3] {
840 val, err := strconv.ParseFloat(f, 32)
841 if err != nil {
842 return err
843 }
844 colors[pos] = float32(val)
845 }
846 dec.matCurrent.Emissive.Set(colors[0], colors[1], colors[2])
847 return nil
848}
849
850// Parses specular reflectivity:
851// Ks r g b

Callers 1

parseMtlLineMethod · 0.95

Calls 2

formatErrorMethod · 0.95
SetMethod · 0.45

Tested by

no test coverage detected