bool Application::init( const int argc, char** argv ) { const eq::Strings& models = _parseArguments( argc, argv ); if( !seq::Application::init( argc, argv, 0 )) return false; _loadModel( models ); return true; }
void CObject::Cull() { if (!m_model) _loadModel(); if (m_updateMatrix) _updateMatrix(); byte outside[8]; memset(outside, 0, sizeof(outside)); int plane; for (int point = 0; point < 8; point++) { for (plane = 0; plane < 6; plane++) { if (g_planeFrustum[plane].a * m_bounds[point].x + g_planeFrustum[plane].b * m_bounds[point].y + g_planeFrustum[plane].c * m_bounds[point].z + g_planeFrustum[plane].d < 0) { outside[point] |= (1 << plane); } } if (outside[point] == 0) { m_visible = true; return; } } if ((outside[0] & outside[1] & outside[2] & outside[3] & outside[4] & outside[5] & outside[6] & outside[7]) != 0) { m_visible = false; return; } m_visible = true; }
void initialize( const char * xPath ) { _loadModel( xPath ); }
void model3DS::loadModel(string filename, float scale){ filename = ofToDataPath(filename); _loadModel((const char *)filename.c_str(), scale); }
bool CProject::Load(const string& filename) { CTextFile file; if (!file.Load(filename)) return false; QVector<string> models; QVector<string> terrains; QVector<string> propMovers; QVector<string> propItems; QVector<string> characters; const string keys[] = { "project", "define", "localdef", "string", "model", "terrain", "propmover", "propitem", "character" }; string tok; file.NextToken(); while (file.TokenType() != ETokenType::End) { tok = file.Token().toLower(); if (tok == keys[0]) m_name = file.GetString(); else if (tok == keys[1] || tok == keys[2]) CTextFile::LoadDefine(file.GetString(), false); else if (tok == keys[3]) CTextFile::LoadText(file.GetString()); else if (tok == keys[4]) models.push_back(file.GetString()); else if (tok == keys[5]) terrains.push_back(file.GetString()); else if (tok == keys[6]) propMovers.push_back(file.GetString()); else if (tok == keys[7]) propItems.push_back(file.GetString()); else if (tok == keys[8]) characters.push_back(file.GetString()); else file.NextToken(); file.NextToken(); } file.Close(); QVector<string>::iterator it; for (it = propMovers.begin(); it != propMovers.end(); it++) { if (!_loadPropMover(*it)) return false; } for (it = propItems.begin(); it != propItems.end(); it++) { if (!_loadPropItem(*it)) return false; } for (it = characters.begin(); it != characters.end(); it++) { if (!_loadCharacter(*it)) return false; } for (it = terrains.begin(); it != terrains.end(); it++) { if (!_loadTerrain(*it)) return false; } for (it = models.begin(); it != models.end(); it++) { if (!_loadModel(*it)) return false; } g_waterCount = m_waterListCount; return true; }