MCPcopy Create free account
hub / github.com/axmolengine/axmol / load

Method load

core/3d/Bundle3D.cpp:173–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173bool Bundle3D::load(std::string_view path)
174{
175 if (path.empty())
176 return false;
177
178 if (_path == path)
179 return true;
180
181 getModelRelativePath(path);
182
183 bool ret = false;
184 std::string ext = FileUtils::getPathExtension(path);
185 if (ext == ".c3t")
186 {
187 _isBinary = false;
188 ret = loadJson(path);
189 }
190 else if (ext == ".c3b")
191 {
192 _isBinary = true;
193 ret = loadBinary(path);
194 }
195 else
196 {
197 AXLOGW("warning: {} is invalid file format", path.data());
198 }
199
200 ret ? (_path = path) : (_path = "");
201
202 return ret;
203}
204
205bool Bundle3D::loadObj(MeshDatas& meshdatas,
206 MaterialDatas& materialdatas,

Callers 3

initWithFileMethod · 0.45
getTrianglesListMethod · 0.45
loadFromFileMethod · 0.45

Calls 2

emptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected