当前位置: 首页>>代码示例>>C++>>正文


C++ PropertyBag::getString方法代码示例

本文整理汇总了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));
}
开发者ID:foxostro,项目名称:heroman,代码行数:25,代码来源:ComponentPhysicsGeom.cpp

示例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));
	}
}
开发者ID:foxostro,项目名称:heroman,代码行数:16,代码来源:ParticleSystem.cpp

示例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");
}
开发者ID:foxostro,项目名称:heroman,代码行数:18,代码来源:ParticleSystem.cpp

示例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");
}
开发者ID:foxostro,项目名称:heroman,代码行数:13,代码来源:ComponentGate.cpp


注:本文中的PropertyBag::getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。