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

Method parseVertex

loader/obj/obj.go:509–522  ·  view source on GitHub ↗

Parses a vertex position line v [w]

(fields []string)

Source from the content-addressed store, hash-verified

507// Parses a vertex position line
508// v <x> <y> <z> [w]
509func (dec *Decoder) parseVertex(fields []string) error {
510
511 if len(fields) < 3 {
512 return errors.New("Less than 3 vertices in 'v' line")
513 }
514 for _, f := range fields[:3] {
515 val, err := strconv.ParseFloat(f, 32)
516 if err != nil {
517 return err
518 }
519 dec.Vertices.Append(float32(val))
520 }
521 return nil
522}
523
524// Parses a vertex normal line
525// vn <x> <y> <z>

Callers 1

parseObjLineMethod · 0.95

Calls 1

AppendMethod · 0.45

Tested by

no test coverage detected