MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / parseVertexData

Function parseVertexData

Source/ThirdParty/OpenFBX/ofbx.cpp:3044–3072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3042}
3043
3044template <typename T> static bool parseVertexData(const Element& element, const char* name, const char* index_name, T& out, std::vector<ParseDataJob>& jobs) {
3045 const Element* data_element = findChild(element, name);
3046 if (!data_element || !data_element->first_property) return false;
3047
3048 const Element* mapping_element = findChild(element, "MappingInformationType");
3049 const Element* reference_element = findChild(element, "ReferenceInformationType");
3050 if (mapping_element && mapping_element->first_property) {
3051 if (mapping_element->first_property->value == "ByPolygonVertex") {
3052 out.mapping = VertexDataMapping::BY_POLYGON_VERTEX;
3053 } else if (mapping_element->first_property->value == "ByPolygon") {
3054 out.mapping = VertexDataMapping::BY_POLYGON;
3055 } else if (mapping_element->first_property->value == "ByVertice" || mapping_element->first_property->value == "ByVertex") {
3056 out.mapping = VertexDataMapping::BY_VERTEX;
3057 } else {
3058 return false;
3059 }
3060 }
3061 if (reference_element && reference_element->first_property) {
3062 if (reference_element->first_property->value == "IndexToDirect") {
3063 const Element* indices_element = findChild(element, index_name);
3064 if (indices_element && indices_element->first_property) {
3065 if (!pushJob(jobs, *indices_element->first_property, out.indices)) return false;
3066 }
3067 } else if (reference_element->first_property->value != "Direct") {
3068 return false;
3069 }
3070 }
3071 return pushJob(jobs, *data_element->first_property, out.values);
3072}
3073
3074static bool parseDouble(Property& property, double* out)
3075{

Callers 4

parseGeometryUVsFunction · 0.85
parseGeometryTangentsFunction · 0.85
parseGeometryColorsFunction · 0.85
parseGeometryNormalsFunction · 0.85

Calls 2

findChildFunction · 0.85
pushJobFunction · 0.85

Tested by

no test coverage detected