Ejemplo n.º 1
0
		static void FrictionJointConfigure(unsigned int aId, const tinyxml2::XMLElement *element)
		{
			Typed<b2FrictionJointDef> defs = Database::frictionjointdef.Open(aId);

			// get the sub-identifier
			unsigned int aSubId;
			if (const char *name = element->Attribute("name"))
				aSubId = Hash(name);
			else
				aSubId = defs.GetCount() + 1;

			// configure the joint definition
			b2FrictionJointDef &def = defs.Open(aSubId);
			for (const tinyxml2::XMLElement *child = element->FirstChildElement(); child != NULL; child = child->NextSiblingElement())
			{
				ConfigureFrictionJointItem(child, def);
			}
			defs.Close(aSubId);

			Database::frictionjointdef.Close(aId);
		}