// Simple Obj Loader from https://www.dkscript.com/wiki/SampleCodes/ObjLoader // but using tinyObjLoader for MTL convenience #pragma once #include class ObjImportUtil { public: struct ObjVertex { DKVector3 inPos; DKVector3 inColor; DKVector3 inNormal; DKVector2 inTexCoord; int Compare(const ObjVertex& Other) const; inline bool operator > (const ObjVertex& Other) const { return Compare(Other) > 0; } inline bool operator < (const ObjVertex& Other) const { return Compare(Other) < 0; } }; struct ObjImportedMeshData { DKArray vertices; DKArray indices; DKAabb aabb; uint32_t vertexSize; }; static ObjImportedMeshData LoadFromObjFile( const DKString& inPath , DKResourcePool& inDKResourcePool); };