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

Method parseTex

loader/obj/obj.go:543–556  ·  view source on GitHub ↗

Parses a vertex texture coordinate line: vt

(fields []string)

Source from the content-addressed store, hash-verified

541// Parses a vertex texture coordinate line:
542// vt <u> <v> <w>
543func (dec *Decoder) parseTex(fields []string) error {
544
545 if len(fields) < 2 {
546 return errors.New("Less than 2 texture coords. in 'vt' line")
547 }
548 for _, f := range fields[:2] {
549 val, err := strconv.ParseFloat(f, 32)
550 if err != nil {
551 return err
552 }
553 dec.Uvs.Append(float32(val))
554 }
555 return nil
556}
557
558// parseFace parses a face decription line:
559// f v1[/vt1][/vn1] v2[/vt2][/vn2] v3[/vt3][/vn3] ...

Callers 1

parseObjLineMethod · 0.95

Calls 1

AppendMethod · 0.45

Tested by

no test coverage detected