本文整理汇总了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);
}
示例2: load
void GateOpener::load(const PropertyBag &xml)
{
Listener::load(xml);
xml.get("gateName", gateName);
xml.get("open", open);
}
示例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;
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
}
示例8: load
void ComponentRenderAsModel::load(const PropertyBag &data)
{
resetMembers();
const FileName modelFileName = data.getFileName("model");
loadModel(modelFileName);
data.get("independentModelOrientation", independentModelOrientation);
}
示例9: load
void TriggerParticles::load(const PropertyBag &xml)
{
Trigger::load(xml);
xml.get("pfxFileName", pfxFileName);
xml.get("pfxLocation", pfxLocation);
showModel = false;
}
示例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
}
示例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
}
}
示例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;
}
示例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);
}
示例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)");
}
示例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);
//.........这里部分代码省略.........