Decoder contains all decoded data from the obj and mtl files. It also implements the xyz.Decoder interface and an instance is registered to handle .obj files.
| 38 | // It also implements the xyz.Decoder interface and an instance |
| 39 | // is registered to handle .obj files. |
| 40 | type Decoder struct { |
| 41 | FSys fs.FS // filesystem, used for all loading |
| 42 | Objfile string // .obj filename within FSys |
| 43 | Objects []Object // decoded objects |
| 44 | Matlib string // name of the material lib |
| 45 | Materials map[string]*Material // maps material name to object |
| 46 | Vertices math32.ArrayF32 // vertices positions array |
| 47 | Normals math32.ArrayF32 // vertices normals |
| 48 | Uvs math32.ArrayF32 // vertices texture coordinates |
| 49 | Warnings []string // warning messages |
| 50 | line uint // current line number |
| 51 | objCurrent *Object // current object |
| 52 | matCurrent *Material // current material |
| 53 | smoothCurrent bool // current smooth state |
| 54 | } |
| 55 | |
| 56 | func (dec *Decoder) New() xyz.Decoder { |
| 57 | di := new(Decoder) |
nothing calls this directly
no outgoing calls
no test coverage detected