MCPcopy Create free account
hub / github.com/cinder/Cinder / load

Method load

src/cinder/ObjLoader.cpp:321–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void ObjLoader::load() const
322{
323 if( mOutputCached )
324 return;
325
326 mOutputVertices.clear();
327 mOutputNormals.clear();
328 mOutputTexCoords.clear();
329 mOutputColors.clear();
330 mOutputIndices.clear();
331
332 bool hasGroupIndex = ( mGroupIndex != numeric_limits<size_t>::max() );
333
334 bool texCoords;
335 if( hasGroupIndex ) {
336 texCoords = mGroups[mGroupIndex].mHasTexCoords;
337 }
338 else {
339 texCoords = false;
340 for( vector<Group>::const_iterator groupIt = mGroups.begin(); groupIt != mGroups.end(); ++groupIt ) {
341 if( groupIt->mHasTexCoords ) {
342 texCoords = true;
343 break;
344 }
345 }
346 }
347
348 bool normals;
349 if( hasGroupIndex ) {
350 normals = mGroups[mGroupIndex].mHasNormals;
351 }
352 else {
353 normals = false;
354 for( vector<Group>::const_iterator groupIt = mGroups.begin(); groupIt != mGroups.end(); ++groupIt ) {
355 if( groupIt->mHasNormals ) {
356 normals = true;
357 break;
358 }
359 }
360 }
361
362 if( normals && texCoords ) {
363 if( hasGroupIndex ) {
364 map<VertexTriple,int> uniqueVerts;
365 loadGroupNormalsTextures( mGroups[mGroupIndex], uniqueVerts );
366 }
367 else {
368 map<VertexTriple,int> uniqueVerts;
369 for( vector<Group>::const_iterator groupIt = mGroups.begin(); groupIt != mGroups.end(); ++groupIt )
370 loadGroupNormalsTextures( *groupIt, uniqueVerts );
371 }
372 }
373 else if( normals ) {
374 if( hasGroupIndex ) {
375 map<VertexPair,int> uniqueVerts;
376 loadGroupNormals( mGroups[mGroupIndex], uniqueVerts );
377 }
378 else {

Callers 15

listenMethod · 0.45
closeAcceptorMethod · 0.45
resizeMethod · 0.45
fileDropMethod · 0.45
keyDownMethod · 0.45
setupBufferPlayerNodeMethod · 0.45
openFileMethod · 0.45
setImageMethod · 0.45
writeImageFunction · 0.45
checkNewFrameMethod · 0.45
getSurfaceMethod · 0.45
load_optionMethod · 0.45

Calls 4

maxFunction · 0.50
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 2

setupBufferPlayerNodeMethod · 0.36
openFileMethod · 0.36