| 3126 | } |
| 3127 | |
| 3128 | static OptionalError<Object*> parseGeometry(const Element& element, GeometryImpl& geom, std::vector<ParseDataJob> &jobs, Allocator& allocator) { |
| 3129 | assert(element.first_property); |
| 3130 | |
| 3131 | const Element* vertices_element = findChild(element, "Vertices"); |
| 3132 | if (!vertices_element || !vertices_element->first_property) |
| 3133 | { |
| 3134 | return &geom; |
| 3135 | } |
| 3136 | |
| 3137 | const Element* polys_element = findChild(element, "PolygonVertexIndex"); |
| 3138 | if (!polys_element || !polys_element->first_property) return Error("Indices missing"); |
| 3139 | |
| 3140 | if (!pushJob(jobs, *vertices_element->first_property, geom.positions.values)) return Error("Invalid vertices"); |
| 3141 | if (!pushJob(jobs, *polys_element->first_property, geom.positions.indices)) return Error("Invalid vertices"); |
| 3142 | |
| 3143 | if (!parseGeometryMaterials(geom, element, jobs)) return Error("Invalid materials"); |
| 3144 | if (!parseGeometryUVs(geom, element, jobs)) return Error("Invalid vertex attributes"); |
| 3145 | if (!parseGeometryTangents(geom, element, jobs)) return Error("Invalid vertex attributes"); |
| 3146 | if (!parseGeometryColors(geom, element, jobs)) return Error("Invalid vertex attributes"); |
| 3147 | if (!parseGeometryNormals(geom, element, jobs)) return Error("Invalid vertex attributes"); |
| 3148 | |
| 3149 | return &geom; |
| 3150 | } |
| 3151 | |
| 3152 | |
| 3153 | bool ShapeImpl::postprocess(GeometryImpl& geom, Allocator& allocator) { |
no test coverage detected