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


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

本文整理汇总了C++中PropertyBag::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyBag::get方法的具体用法?C++ PropertyBag::get怎么用?C++ PropertyBag::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyBag的用法示例。


在下文中一共展示了PropertyBag::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: load

void PowerupHeal::load(const PropertyBag &xml)
{
	Powerup::load(xml);

	xml.get("healValue", healValue);
	xml.get("healTime", healTime);
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:7,代码来源:PowerupHeal.cpp

示例2: load

void GateOpener::load(const PropertyBag &xml)
{
	Listener::load(xml);

	xml.get("gateName", gateName);
	xml.get("open", open);
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:7,代码来源:GateOpener.cpp

示例3: animationSequence

AnimationController* _3dsLoader::loadFromFile(const string &fileName) const
{
	PropertyBag xml;
	bool truespaceModel = false;
	string skin;

	TRACE(string("Loading 3DS model from \"") + fileName + string("\""));
	
	xml.loadFromFile(fileName);

	AnimationController* controller = new AnimationController();

	xml.get_optional("Truespace", truespaceModel);
	xml.get_optional("forceSkin", skin);

	for(size_t i=0, numAnimations=xml.count("animation"); i<numAnimations; ++i)
	{
		PropertyBag animation;
		string name;
		float fps = 0.0;
		bool looping = false;
		float priority = 0.0f;

		xml.get("animation", animation, i);

		animation.get("name", name);
		animation.get_optional("fps", fps);
		animation.get_optional("looping", looping);
		animation.get_optional("priority", priority);

		// Load all the keyframes
		vector<KeyFrame> keyFrames;
		const size_t length=animation.count("keyframe");
		for(size_t j=0; j<length; ++j)
		{
			string keyFrameFile;

			animation.get("keyframe", keyFrameFile, j);

			Model keyFrame = loadKeyFrame(keyFrameFile);

			cullDegenerateMeshes(keyFrame);

			if(!skin.empty()) forceSkin(keyFrame, skin);

			if(truespaceModel) fixTrueSpaceVertices(keyFrame);

			keyFrames.push_back(keyFrame);
		}

		TRACE(string("Adding 3DS animation \"") + name + string("\" from ") + fileName);

		// Add it to the controller
		AnimationSequence animationSequence(keyFrames, name, priority, looping, 0, length, fps);
		controller->addAnimation(animationSequence);
	}

	return controller;
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:59,代码来源:3dsLoader.cpp

示例4: load

void Spawn::load(const PropertyBag &xml)
{
	Listener::load(xml);

	xml.get("monsterDataFile", monsterDataFile);
	xml.get("minMonsters", minMonsters);
	xml.get("maxMonsters", maxMonsters);
	xml.get("separationDistance", separationDistance);
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:9,代码来源:Spawn.cpp

示例5: load

void ComponentBrainShooter::load(const PropertyBag &data)
{
	resetMembers();

	data.get("fov", fov); // optional tag
	data.get("maxSightDistance", maxSightDistance); // optional tag
	data.get("shootDistance", shootDistance); // optional tag

	wanderAngle = FRAND_RANGE(0.0f, 2.0f * (float)M_PI);
}
开发者ID:foxostro,项目名称:heroman,代码行数:10,代码来源:ComponentBrainShooter.cpp

示例6: 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

示例7: load

void ActorSet::load(const PropertyBag &objects, World *_world)
{
	ASSERT(_world!=0, "world was null");
	world = _world;

	for(size_t i=0, n=objects.getNumInstances("object"); i<n; ++i)
	{
		const tuple<OBJECT_ID, ActorPtr> t = create();
		const ActorPtr object = t.get<1>();

		const PropertyBag decl = objects.getBag("object", i);
		const FileName templateFile = decl.getFileName("template");
		const vec3 initialPosition = decl.getVec3("position");
		const PropertyBag templateData = PropertyBag::fromFile(templateFile);
		const PropertyBag base = templateData.getBag("components");

		ComponentDataSet s = ComponentDataSet::load(base, decl);

		// get actor name
		object->actorName = "(no name)";
		templateData.get("name", object->actorName);

		object->load(s, initialPosition, vec3(0,0,0), world);
		object->setParentBlackBoard(this);
	}
}
开发者ID:foxostro,项目名称:heroman,代码行数:26,代码来源:ActorSet.cpp

示例8: load

void ComponentRenderAsModel::load(const PropertyBag &data)
{
	resetMembers();
	const FileName modelFileName = data.getFileName("model");
	loadModel(modelFileName);
	data.get("independentModelOrientation", independentModelOrientation);
}
开发者ID:foxostro,项目名称:heroman,代码行数:7,代码来源:ComponentRenderAsModel.cpp

示例9: load

void TriggerParticles::load(const PropertyBag &xml)
{
	Trigger::load(xml);

	xml.get("pfxFileName", pfxFileName);
	xml.get("pfxLocation", pfxLocation);

	showModel = false;
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:9,代码来源:TriggerParticles.cpp

示例10: load

void ComponentHealth::load(const PropertyBag &data)
{
    resetMembers();
    health = data.getInt("health");
    maxHealth = data.getInt("maxHealth");
    damageToPowerRatio = data.getFloat("damageToPowerRatio");
    willResurrectAfterCountDown = data.getBool("willResurrectAfterCountDown");
    timeUntilResurrection = data.getFloat("timeUntilResurrection");

    data.get("displayPower", displayPower); // optional tag
}
开发者ID:foxostro,项目名称:heroman,代码行数:11,代码来源:ComponentHealth.cpp

示例11: load

void Trigger::load(const PropertyBag &xml)
{
	Actor::load(xml);

	loadList(xml, "sounds", sounds);

	if(xml.exists("triggerRadius")) {
		xml.get("triggerRadius", triggerRadius);
	} else {
		triggerRadius = getCylinderRadius(); // default
	}
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:12,代码来源:Trigger.cpp

示例12: fromXml

bool Light::fromXml(PropertyBag &xml)
{
	destroy();

	xml.get("constantAttenuation", constantAttenuation);
	xml.get("linearAttenuation", linearAttenuation);
	xml.get("quadraticAttenuation", quadraticAttenuation);
	xml.get("lightPosition", lightPosition);;
	xml.get("pointLight", pointLight);
	xml.get("lightDirection", lightDirection);
	xml.get("spotAngle", spotAngle);
	xml.get("spotExponent", spotExponent);
	xml.get("enable", enable);

	calculateMatrices();

    return true;
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:18,代码来源:Light.cpp

示例13: load

void SpellFireBall::load(PropertyBag &xml, Engine::World *zone, Engine::OBJECT_ID ownerID)
{
	Spell::load(xml, zone, ownerID);

	xml.get("damageValue", damageValue);
	xml.get("bulletSpeed", bulletSpeed);
	xml.get("particleFile", particleFile);
	xml.get("explosionParticleFile", explosionParticleFile);
	xml.get("explosionSoundEffectFile", explosionSoundEffectFile);
	xml.get("causesFreeze", causesFreeze);
	xml.get("knockbackMagnitude", knockbackMagnitude);
	xml.get("height", height);
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:13,代码来源:SpellFireBall.cpp

示例14: load

void ActorSet::load(const PropertyBag &xml, World *world)
{
	ASSERT(world!=0, "world was null");

	TRACE("Loading ActorSet...");

	for(size_t i=0, numObjects=xml.count("object"); i<numObjects; ++i)
	{
		PropertyBag ThisObjBag;
		xml.get("object", ThisObjBag, i);
		spawnNow(ThisObjBag, world);
	}

	// Player data is saved separately
	deleteActors<Player>();

	TRACE("...finished (Loading ActorSet)");
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:18,代码来源:ActorSet.cpp

示例15: onLeftMouseDown

void EditorToolBar::onLeftMouseDown()
{
	ASSERT(world!=0, "world was null!  Call setWorld first!");

	if(g_GUI.mouseOverSomeWidget) return;

	// Get a position on the ground beneath the cursor
	float e = selected ? selected->getPos().y : 0.0f;
	const vec3 groundPos = getGroundPickPos(e);

	// Grab the pool of objects we are working from
	ActorSet &objects = world->getObjects();

	// Get the id of the object under the mouse cursor
	OBJECT_ID id = objects.getClosest<Actor>(groundPos, 2.0f);

	// Process the action depending on the current tool
	switch(toolBarTools->getTool())
	{
	case ToolBarForEditorTools::EDITOR_SELECT_TOOL:
		if(objects.isMember(id))
		{
			Actor * p = &objects.get(id);
			showActorPane(p);
		}
		else
		{
			hideActorPane();
		}
		break;

	case ToolBarForEditorTools::EDITOR_MOVE_TOOL:
		{
			if(selected)
			{
				// Hold the right mouse button to slide objects along the y-axis
				if(g_Input.MouseRight)
				{
					vec3 delta = groundPos - selected->getPos();
					delta.y=0;
					float dist = delta.getMagnitude()*0.3f;

					// Place the object on this spot
					selected->Place(vec3(selected->getPos().x, dist, selected->getPos().z));
				}
				else
				{
					selected->Place(groundPos);
				}
			}
		}
		break;

	case ToolBarForEditorTools::EDITOR_ROTATE_TOOL:
		{
			if(selected)
			{
				const vec3 delta = vec3(selected->getPos().x-groundPos.x, 0, selected->getPos().z-groundPos.z);
				const vec3 zAxis = delta.getNormal();
				const vec3 yAxis = vec3(0,1,0);
				const vec3 xAxis = yAxis.cross(zAxis).getNormal();

				mat4 orientation = selected->getOrientation();
				orientation.setAxisZ(zAxis);
				orientation.setAxisY(yAxis);
				orientation.setAxisX(xAxis);
				orientation.setPos(vec3(0,0,0));
				selected->setOrientation(orientation);
			}
		}
		break;

	case ToolBarForEditorTools::EDITOR_ROTATE_X_TOOL:
		{
			if(selected)
			{
				vec3 delta = groundPos - selected->getPos();
				float angle = atan2f(delta.x, delta.y) * 0.1f;

				mat4 rot;
				rot.rotateX(angle);

		                mat4 orientation = selected->getOrientation();

				orientation *= rot;

				selected->setOrientation(orientation);
			}
		}
		break;

	case ToolBarForEditorTools::EDITOR_ROTATE_Z_TOOL:
		{
			if(selected)
			{
				vec3 delta = groundPos - selected->getPos();
				float angle = atan2f(delta.x, delta.y) * 0.1f;

				mat4 rot;
				rot.rotateZ(angle);
//.........这里部分代码省略.........
开发者ID:foxostro,项目名称:arbarlith2,代码行数:101,代码来源:EditorToolBar.cpp


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