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

Method parseNi

loader/obj/obj.go:871–882  ·  view source on GitHub ↗

Parses optical density, also known as index of refraction Ni

(fields []string)

Source from the content-addressed store, hash-verified

869// Parses optical density, also known as index of refraction
870// Ni <optical_density>
871func (dec *Decoder) parseNi(fields []string) error {
872
873 if len(fields) < 1 {
874 return dec.formatError("'Ni' with no fields")
875 }
876 val, err := strconv.ParseFloat(fields[0], 32)
877 if err != nil {
878 return dec.formatError("'d' parse float error")
879 }
880 dec.matCurrent.Refraction = float32(val)
881 return nil
882}
883
884// Parses specular exponent
885// Ns <specular_exponent>

Callers 1

parseMtlLineMethod · 0.95

Calls 1

formatErrorMethod · 0.95

Tested by

no test coverage detected