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

Method parseNormal

loader/obj/obj.go:526–539  ·  view source on GitHub ↗

Parses a vertex normal line vn

(fields []string)

Source from the content-addressed store, hash-verified

524// Parses a vertex normal line
525// vn <x> <y> <z>
526func (dec *Decoder) parseNormal(fields []string) error {
527
528 if len(fields) < 3 {
529 return errors.New("Less than 3 normals in 'vn' line")
530 }
531 for _, f := range fields[:3] {
532 val, err := strconv.ParseFloat(f, 32)
533 if err != nil {
534 return err
535 }
536 dec.Normals.Append(float32(val))
537 }
538 return nil
539}
540
541// Parses a vertex texture coordinate line:
542// vt <u> <v> <w>

Callers 1

parseObjLineMethod · 0.95

Calls 1

AppendMethod · 0.45

Tested by

no test coverage detected