190
190
std::string::size_type end = str.find_first_of(" \t\r\n", start);
192
192
if ((end > start) && (start != std::string::npos))
193
x = atof(str.substr(start, end-start).c_str());
193
x = osg::asciiToFloat(str.substr(start, end-start).c_str());
201
201
end = str.find_first_of(" \t\r\n", start);
203
203
if ((end > start) && (start != std::string::npos))
204
y = atof(str.substr(start, end-start).c_str());
204
y = osg::asciiToFloat(str.substr(start, end-start).c_str());
317
317
// Get the class name and process the entity appropriately
318
std::string className = (*param).second;
319
if (className.compare("worldspawn") == 0)
318
class_name = (*param).second;
319
if (class_name.compare("worldspawn") == 0)
321
321
// This is the entity that represents the main geometry of the map
322
322
// (the terrain and much of the static geometry)
323
323
entity_class = ENTITY_WORLDSPAWN;
324
324
processWorldSpawn();
326
else if (className.compare(0, 3, "env") == 0)
326
else if (class_name.compare(0, 3, "env") == 0)
328
328
// This is an environmental effect (such as a fire or dust cloud)
329
329
entity_class = ENTITY_ENV;
332
else if ((className.compare("func_brush") == 0) ||
333
(className.compare("func_illusionary") == 0) ||
334
(className.compare("func_wall_toggle") == 0) ||
335
(className.compare("func_breakable") == 0))
332
else if ((class_name.compare("func_brush") == 0) ||
333
(class_name.compare("func_illusionary") == 0) ||
334
(class_name.compare("func_wall_toggle") == 0) ||
335
(class_name.compare("func_breakable") == 0))
337
337
// This is secondary map geometry, created along with the main
338
338
// map geometry (not an external model)
339
339
entity_class = ENTITY_FUNC_BRUSH;
340
340
processFuncBrush();
342
else if (className.compare(0, 4, "prop") == 0)
342
else if (class_name.compare(0, 4, "prop") == 0)
344
344
// This is a "prop", an external model placed somewhere in the
346
346
entity_class = ENTITY_PROP;
349
else if (className.compare("infodecal") == 0)
349
else if (class_name.compare("infodecal") == 0)
351
351
// This is a decal, which applies a texture to some surface in the
353
353
entity_class = ENTITY_INFO_DECAL;
354
354
processInfoDecal();
356
else if (className.compare(0, 4, "item") == 0)
356
else if (class_name.compare(0, 4, "item") == 0)
358
358
// This is an "item". Like a prop, these are external models
359
359
// placed in the scene, but the specific model is determined
368
368
ref_ptr<Group> VBSPEntity::createBrushGeometry()
372
VBSPGeometry ** vbspGeomList;
375
TexInfo currentTexInfo;
376
TexData currentTexData;
377
const char * texName;
378
char currentTexName[256];
379
int currentGeomIndex;
380
VBSPGeometry * currentGeom;
381
ref_ptr<Group> entityGroup;
382
ref_ptr<Group> geomGroup;
372
VBSPGeometry ** vbspGeomList;
375
TexInfo currentTexInfo;
376
TexData currentTexData;
377
const char * texName;
378
char currentTexName[256];
379
int currentGeomIndex;
380
VBSPGeometry * currentGeom;
381
ref_ptr<Group> entityGroup;
382
ref_ptr<Group> geomGroup;
383
std::stringstream groupName;
384
385
// Create a list of VBSPGeometry objects for each texdata entry in the
385
386
// scene. These objects will hold the necessary geometry data until we