本文整理汇总了C++中varconf::Variable类的典型用法代码示例。如果您正苦于以下问题:C++ Variable类的具体用法?C++ Variable怎么用?C++ Variable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Variable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Config_ogreLogChanged
void OgreSetup::Config_ogreLogChanged(const std::string& section, const std::string& key, varconf::Variable& variable) {
if (variable.is_string()) {
auto string = variable.as_string();
if (string == "low") {
Ogre::LogManager::getSingleton().getDefaultLog()->setLogDetail(Ogre::LL_LOW);
} else if (string == "normal") {
Ogre::LogManager::getSingleton().getDefaultLog()->setLogDetail(Ogre::LL_NORMAL);
} else if (string == "boreme") {
Ogre::LogManager::getSingleton().getDefaultLog()->setLogDetail(Ogre::LL_BOREME);
}
}
}
示例2: Config_LodBias
void LodLevelManager::Config_LodBias(const std::string& section, const std::string& key, varconf::Variable& variable)
{
if (variable.is_double()) {
Ogre::Real lodBias = static_cast<double>(variable);
setLodBiasAll(lodBias / 100.0f);
}
}
示例3: Config_FoliageDensity
void FoliageDetailManager::Config_FoliageDensity(const std::string&, const std::string&, varconf::Variable& variable)
{
if (variable.is_double()) {
float density = static_cast<double>(variable);
setFoliageDensity(density / 100);
}
}
示例4: Config_FoliageFarDistance
void FoliageDetailManager::Config_FoliageFarDistance(const std::string&, const std::string&, varconf::Variable& variable)
{
if (variable.is_double()) {
float distanceFactor = static_cast<double>(variable);
setFoliageDistance(distanceFactor / 100);
}
}
示例5: Config_Enabled
void AutomaticGraphicsLevelManager::Config_Enabled(const std::string& section, const std::string& key, varconf::Variable& variable)
{
if (variable.is_bool() && static_cast<bool>(variable)) {
setEnabled(true);
} else {
setEnabled(false);
}
}
示例6: config_AuthoringVisualizations
void AuthoringManager::config_AuthoringVisualizations(const std::string& section, const std::string&, varconf::Variable& variable)
{
if (variable.is_bool()) {
if (static_cast<bool> (variable)) {
displayAuthoringVisualization();
} else {
hideAuthoringVisualization();
}
}
}
示例7: Config_CloudSpeed
void CaelumSky::Config_CloudSpeed(const std::string& section, const std::string& key, varconf::Variable& variable)
{
if (variable.is_string() && mCaelumSystem->getCloudSystem()) {
Ogre::Vector2 vector;
Tokeniser tokeniser(variable);
vector.x = atof(tokeniser.nextToken().c_str());
vector.y = atof(tokeniser.nextToken().c_str());
mCaelumSystem->getCloudSystem()->getLayer(0)->setCloudSpeed(vector);
}
}
示例8: Config_Compositors
void MainCamera::Config_Compositors(const std::string& section, const std::string& key, varconf::Variable& variable)
{
if (variable.is_string()) {
const std::vector<std::string> tokens = Tokeniser::split(variable.as_string(), ",");
for (std::vector<std::string>::const_iterator I = tokens.begin(); I != tokens.end(); ++I) {
enableCompositor(*I, true);
}
std::vector<std::string> compositorsToDisable;
for (CompositorNameStore::const_iterator I = mLoadedCompositors.begin(); I != mLoadedCompositors.end(); ++I) {
if (std::find(tokens.begin(), tokens.end(), *I) == tokens.end()) {
compositorsToDisable.push_back(*I);
}
}
for (std::vector<std::string>::const_iterator I = compositorsToDisable.begin(); I != compositorsToDisable.end(); ++I) {
enableCompositor(*I, false);
}
}
}
示例9: Config_DefaultFps
void AutomaticGraphicsLevelManager::Config_DefaultFps(const std::string& section, const std::string& key, varconf::Variable& variable)
{
if (variable.is_double()) {
int fps = static_cast<double>(variable);
//If set to 0, the fps the manager tries to achieve is 60
if (fps == 0.0f) {
fps = 60.0f;
}
mDefaultFps = fps;
}
}
示例10: parse
bool CaelumSun::parse(varconf::Variable& variable, Ogre::ColourValue& colour)
{
if (variable.is_string()) {
Tokeniser tokeniser(variable);
colour.r = atof(tokeniser.nextToken().c_str());
colour.g = atof(tokeniser.nextToken().c_str());
colour.b = atof(tokeniser.nextToken().c_str());
colour.a = atof(tokeniser.nextToken().c_str());
return true;
}
return false;
}
示例11: Config_DesiredFps
void Config_DesiredFps(const std::string& section, const std::string& key, varconf::Variable& variable)
{
//Check for double, but cast to int. That way we'll catch all numbers.
if (variable.is_double()) {
mDesiredFps = static_cast<int>(variable);
if (mDesiredFps != 0) {
mMicrosecondsPerFrame = 1000000L / mDesiredFps;
} else {
mMicrosecondsPerFrame = 0;
}
}
}
示例12: Config_CatchMouse
void Input::Config_CatchMouse(const std::string& section, const std::string& key, varconf::Variable& variable)
{
try {
if (variable.is_bool()) {
bool enabled = static_cast<bool> (variable);
if (enabled) {
mMouseGrabbingRequested = true;
} else {
setMouseGrab(false);
}
}
} catch (const std::exception& ex) {
S_LOG_FAILURE("Error when changing mouse grabbing." << ex);
}
}
示例13: Config_Foliage
void World::Config_Foliage(const std::string& section, const std::string& key, varconf::Variable& variable)
{
if (variable.is_bool() && static_cast<bool>(variable)) {
if (!mFoliage) {
//create the foliage
mFoliage = new Environment::Foliage(*mTerrainManager);
EventFoliageCreated.emit();
mFoliageInitializer = new DelayedFoliageInitializer(*mFoliage, mView, 1000, 15000);
}
} else {
delete mFoliage;
mFoliage = 0;
delete mFoliageInitializer;
mFoliageInitializer = 0;
}
}
示例14: Config_Foliage
void World::Config_Foliage(const std::string& section, const std::string& key, varconf::Variable& variable, GraphicalChangeAdapter& graphicalChangeAdapter)
{
if (variable.is_bool() && static_cast<bool>(variable)) {
if (!mFoliage) {
//create the foliage
mFoliage = new Environment::Foliage(*mTerrainManager);
EventFoliageCreated.emit();
mFoliageInitializer = new DelayedFoliageInitializer(sigc::bind(sigc::mem_fun(*this, &World::initializeFoliage), sigc::ref(graphicalChangeAdapter)), mView, 1000, 15000);
}
} else {
delete mFoliageDetailManager;
mFoliageDetailManager = 0;
delete mFoliageInitializer;
mFoliageInitializer = 0;
delete mFoliage;
mFoliage = 0;
}
}
示例15: Config_ClipDistances
void MainCamera::Config_ClipDistances(const std::string& section, const std::string& key, varconf::Variable& variable)
{
if (variable.is_string()) {
Tokeniser tokeniser(variable);
float nearDistance = atof(tokeniser.nextToken().c_str());
float farDistance = atof(tokeniser.nextToken().c_str());
S_LOG_INFO("Setting main camera clip distances to near: " << nearDistance << " far: " << farDistance);
mCamera.setNearClipDistance(nearDistance);
//set the far clip distance high to make sure that the sky is completely shown
if (Ogre::Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_INFINITE_FAR_PLANE)) {
/* //NOTE: this won't currently work with the sky
mCamera.setFarClipDistance(0);*/
mCamera.setFarClipDistance(farDistance);
} else {
mCamera.setFarClipDistance(farDistance);
}
}
}