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

Method parseDissolve

loader/obj/obj.go:780–791  ·  view source on GitHub ↗

Parses the dissolve factor (opacity) d

(fields []string)

Source from the content-addressed store, hash-verified

778// Parses the dissolve factor (opacity)
779// d <factor>
780func (dec *Decoder) parseDissolve(fields []string) error {
781
782 if len(fields) < 1 {
783 return dec.formatError("'d' with no fields")
784 }
785 val, err := strconv.ParseFloat(fields[0], 32)
786 if err != nil {
787 return dec.formatError("'d' parse float error")
788 }
789 dec.matCurrent.Opacity = float32(val)
790 return nil
791}
792
793// Parses ambient reflectivity:
794// Ka r g b

Callers 1

parseMtlLineMethod · 0.95

Calls 1

formatErrorMethod · 0.95

Tested by

no test coverage detected