void Placeable::load(const Aurora::GFF3Struct &placeable) { Common::UString temp = placeable.getString("TemplateResRef"); Common::ScopedPtr<Aurora::GFF3File> utp; if (!temp.empty()) utp.reset(loadOptionalGFF3(temp, Aurora::kFileTypeUTP, MKTAG('U', 'T', 'P', ' '))); Situated::load(placeable, utp ? &utp->getTopLevel() : 0); if (!utp) warning("Placeable \"%s\" has no blueprint", _tag.c_str()); readScripts(utp->getTopLevel()); }
void Trigger::load(const Aurora::GFF3Struct &gff) { Common::UString temp = gff.getString("TemplateResRef"); Common::ScopedPtr<Aurora::GFF3File> utt; if (!temp.empty()) utt.reset(loadOptionalGFF3(temp, Aurora::kFileTypeUTT, MKTAG('U', 'T', 'T', ' '))); loadBlueprint(utt->getTopLevel()); if (!utt) warning("Trigger \"%s\" has no blueprint", temp.c_str()); float x, y, z; x = (float)gff.getDouble("XPosition"); y = (float)gff.getDouble("YPosition"); z = (float)gff.getDouble("ZPosition"); glm::vec3 position(x, y, z); setPosition(x, y, z); x = (float)gff.getDouble("XOrientation"); y = (float)gff.getDouble("YOrientation"); z = (float)gff.getDouble("ZOrientation"); glm::vec3 orientation(x, y, z); const Aurora::GFF3List &geometry = gff.getList("Geometry"); for (Aurora::GFF3List::const_iterator p = geometry.begin(); p != geometry.end(); ++p) { x = (float)(*p)->getDouble("PointX"); y = (float)(*p)->getDouble("PointY"); z = (float)(*p)->getDouble("PointZ"); _geometry.push_back(position + glm::vec3(x, y, z)); } }
void Waypoint::load(const Aurora::GFF3Struct &waypoint) { Common::UString temp = waypoint.getString("TemplateResRef"); Common::ScopedPtr<Aurora::GFF3File> utw; if (!temp.empty()) utw.reset(loadOptionalGFF3(temp, Aurora::kFileTypeUTW, MKTAG('U', 'T', 'W', ' '))); load(waypoint, utw ? &utw->getTopLevel() : 0); }
void Door::load(const Aurora::GFF3Struct &door) { Common::UString temp = door.getString("TemplateResRef"); Common::ScopedPtr<Aurora::GFF3File> utd; if (!temp.empty()) utd.reset(loadOptionalGFF3(temp, Aurora::kFileTypeUTD, MKTAG('U', 'T', 'D', ' '))); Situated::load(door, utd ? &utd->getTopLevel() : 0); setModelState(); }
void Creature::load(const Aurora::GFF3Struct &creature) { Common::UString temp = creature.getString("TemplateResRef"); Common::ScopedPtr<Aurora::GFF3File> utc; if (!temp.empty()) utc.reset(loadOptionalGFF3(temp, Aurora::kFileTypeUTC, MKTAG('U', 'T', 'C', ' '))); load(creature, utc ? &utc->getTopLevel() : 0); if (!utc) warning("Creature \"%s\" has no blueprint", _tag.c_str()); }
void Door::load(const Aurora::GFF3Struct &door) { Common::UString temp = door.getString("TemplateResRef"); Common::ScopedPtr<Aurora::GFF3File> utd; if (!temp.empty()) utd.reset(loadOptionalGFF3(temp, Aurora::kFileTypeUTD, MKTAG('U', 'T', 'D', ' '))); Situated::load(door, utd ? &utd->getTopLevel() : 0); if (!utd) warning("Door \"%s\" has no blueprint", _tag.c_str()); if (!_modelName.empty()) { glm::mat4 transform; transform = glm::translate(transform, glm::make_vec3(_position)); transform = glm::rotate(transform, Common::deg2rad(_orientation[3]), glm::make_vec3(_orientation)); _walkmesh.load(_modelName + "0", ::Aurora::kFileTypeDWK, transform); } }