本文整理汇总了C++中PropertyBag::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyBag::getString方法的具体用法?C++ PropertyBag::getString怎么用?C++ PropertyBag::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyBag
的用法示例。
在下文中一共展示了PropertyBag::getString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void ComponentPhysicsGeom::load(const PropertyBag &data)
{
resetMembers();
desiredHeight = data.getFloat("height");
collisionRadius = data.getFloat("radius");
// Create as physics geometry
if(geom){dGeomDestroy(geom);} geom=0;
createGeom(data.getString("physicsGeometryType"));
// Set initial position
{
vec3 position;
if(data.get("position", position)) // optional tag
{
setPosition(position);
}
}
// Declare the initial state
getParentBlackBoard().relayMessage(MessagePositionHasBeenSet(getPosition()));
getParentBlackBoard().relayMessage(MessageOrientationHasBeenSet(getOrientation()));
getParentBlackBoard().relayMessage(MessageRequestSetHeight(desiredHeight));
}
示例2: loadParticleTemplates
void ParticleSystem::loadParticleTemplates(const PropertyBag &data)
{
const size_t n = data.getNumInstances("template");
for(size_t i=0; i<n; ++i)
{
const PropertyBag templateData = data.getBag("template", i);
const string templateName = templateData.getString("name");
const string materialName = templateData.getString("material");
Material *material = getMaterialPtr(materialName);
ParticleElement element(templateData, material);
templatesByName.insert(make_pair(templateName, element));
}
}
示例3: loadParticleMaterials
void ParticleSystem::loadParticleMaterials(const PropertyBag &data,
TextureFactory &textureFactory)
{
const size_t nMaterials = data.getNumInstances("material");
ASSERT(nMaterials>0, "particle system does not specify any materials");
for(size_t i=0; i<nMaterials; ++i)
{
PropertyBag MatBag = data.getBag("material", i);
Material material;
const string name = MatBag.getString("name");
const FileName fileName = MatBag.getString("image");
material.setTexture(textureFactory.load(fileName, false));
material.glow = MatBag.getBool("glow");
materials.insert(make_pair(name, material));
}
ASSERT(!materials.empty(),
"after loading, there are no particle materials in system");
}
示例4: load
void ComponentGate::load(const PropertyBag &data)
{
resetMembers();
state = ("a" == toLowerCase(data.getString("initialState")))
? STATE_A
: STATE_B;
positionA = data.getVec3("positionA");
positionB = data.getVec3("positionB");
timeToTransitionAB = data.getFloat("timeToTransitionAB");
timeToTransitionBA = data.getFloat("timeToTransitionBA");
}