本文整理汇总了C++中AudioManager::addSubSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioManager::addSubSystem方法的具体用法?C++ AudioManager::addSubSystem怎么用?C++ AudioManager::addSubSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioManager
的用法示例。
在下文中一共展示了AudioManager::addSubSystem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
string name = level["audio"][i]["name"].asString();
string path = level["audio"][i]["path"].asCString();
float vol = level["audio"][i]["default_volume"].asFloat();
am->loadSound(name, path.c_str(), vol);
}
//SHADERS
for (int i = 0; i < level["shaders"].size(); i++)
{
Shader* s = new Shader(level["shaders"][i]["vert"].asString(), level["shaders"][i]["frag"].asString());
map_shaders.insert(pair <string, Shader*>(level["shaders"][i]["name"].asString(), s));
}
//MESHES
for (int i = 0; i < level["meshes"].size(); i++)
{
string function = level["meshes"][i]["function"].asString();
Mesh * m;
if (function == "GenerateQuad") {
m = Mesh::GenerateQuad(level["meshes"][i]["x"].asFloat(), level["meshes"][i]["y"].asFloat());
}
else if (function == "GenerateTriFan") {
m = Mesh::GenerateTriFan(level["meshes"][i]["radius"].asFloat(), Vector4(level["meshes"][i]["x"].asFloat(), level["meshes"][i]["y"].asFloat(), level["meshes"][i]["z"].asFloat(), level["meshes"][i]["w"].asFloat()));
}
map_meshes.insert(pair<string, Mesh*>(level["meshes"][i]["name"].asString(), m));
}
//ENTITIES
for (int i = 0; i < level["entities"].size(); i++)
{
Entity *e = new Entity(
level["entities"][i]["name"].asString(),
level["entities"][i]["group"].asString(),
level["entities"][i]["subgroup"].asString(),
Vector3(
level["entities"][i]["position"][0].asFloat(),
level["entities"][i]["position"][1].asFloat(),
level["entities"][i]["position"][2].asFloat()
),
Vector3(
level["entities"][i]["acceleration"][0].asFloat(),
level["entities"][i]["acceleration"][1].asFloat(),
level["entities"][i]["acceleration"][2].asFloat()
),
Vector3(
level["entities"][i]["velocity"][0].asFloat(),
level["entities"][i]["velocity"][1].asFloat(),
level["entities"][i]["velocity"][2].asFloat()
),
map_meshes[level["entities"][i]["mesh"].asString()],
map_shaders[level["entities"][i]["shader"].asString()],
map_textures[level["entities"][i]["texture"].asString()]
);
e->setMass(level["entities"][i]["mass"].asFloat());
if (level["entities"][i]["hidden"].asBool() == true) {
e->is_renderable = false;
}
if (level["entities"][i]["collidable"].asBool()) {
if (level["entities"][i]["collision_object"].asString() == "CIRCLE")
cm->addObject(e, level["entities"][i]["collision_radius"].asFloat());
if (level["entities"][i]["collision_object"].asString() == "PLANE")
cm->addObject(e, e->getPhysicsObject()->getPos().Length(),
Vector3(
level["entities"][i]["normal"][0].asFloat(),
level["entities"][i]["normal"][1].asFloat(),
level["entities"][i]["normal"][2].asFloat()
));
}
if (level["entities"][i]["parent"].asString() == "")
map_entities.insert(pair<string, Entity*>(level["entities"][i]["name"].asString(), e));
else
map_entities[level["entities"][i]["parent"].asString()]->addChild(e);
}
// register entities
for (auto iterator = map_entities.begin(); iterator != map_entities.end(); iterator++)
gm->addEntity(iterator->second);
//register managers
gm->addSystemManager(am);
gm->addSystemManager(cm);
gm->addSystemManager(im);
gm->addSystemManager(em);
gm->addSystemManager(glm);
//register sub systems
im->addSubSystem(camera);
glm->addSubSystem(gl);
im->addSubSystem(gi);
am->addSubSystem(ga);
cm->addSubSystem(cr);
em->addSubSystem(ge);
gm->run();
}