private void initializeRigidBodies(Document document) {
		NodeList rigidBodyList = document.getElementsByTagName("rigid_body");
		for (int i = 0; i < rigidBodyList.getLength(); i++) {
			Element rigidBodyElement = (Element) rigidBodyList.item(i);

			String typeAttribute = rigidBodyElement.getAttribute("type");
			int dynamicsType = typeAttribute.equals("static") ? RigidBody.STATIC
					: typeAttribute.equals("kinematic") ? RigidBody.KINEMATIC
							: RigidBody.DYNAMIC;
			RigidBody rigidBody = new RigidBody(dynamicsType);

			// Set up physical data
			Vector3d position = new Vector3d(parseDoubles(rigidBodyElement
					.getElementsByTagName("position").item(0).getTextContent()));
			Quat4d rotation = new Quat4d(parseDoubles(rigidBodyElement
					.getElementsByTagName("rotation").item(0).getTextContent()));
			Vector3d linearVelocity = new Vector3d(
					parseDoubles(rigidBodyElement
							.getElementsByTagName("linear_velocity").item(0)
							.getTextContent()));
			Vector3d angularVelocity = new Vector3d(
					parseDoubles(rigidBodyElement
							.getElementsByTagName("angular_velocity").item(0)
							.getTextContent()));
			double restitution = Double.parseDouble(rigidBodyElement
					.getElementsByTagName("restitution").item(0)
					.getTextContent());
			double friction = Double.parseDouble(rigidBodyElement
					.getElementsByTagName("friction").item(0).getTextContent());
			double mass = Double.parseDouble(rigidBodyElement
					.getElementsByTagName("mass").item(0).getTextContent());
			double lifeTime = Double
					.parseDouble(rigidBodyElement
							.getElementsByTagName("life_time").item(0)
							.getTextContent());

			Element geometryElement = (Element) rigidBodyElement
					.getElementsByTagName("geometry").item(0);
			Node geometryNode = null;
			Node wireframeGeometryNode = null;
			Appearance wireframeAppearance = new Appearance();
			wireframeAppearance.setPolygonAttributes(new PolygonAttributes(
					PolygonAttributes.POLYGON_LINE,
					PolygonAttributes.CULL_NONE, 0));

			// Geometry set up
			CollisionObject collisionObject = null;
			if (geometryElement.getAttribute("type").equals("sphere")) {
				// Sphere primitive
				float radius = Float.parseFloat(geometryElement
						.getElementsByTagName("radius").item(0)
						.getTextContent());
				int divisions = Integer.parseInt(geometryElement
						.getElementsByTagName("divisions").item(0)
						.getTextContent());
				geometryNode = new Sphere(radius, Primitive.GENERATE_NORMALS,
						divisions, null);
				wireframeGeometryNode = new Sphere(radius,
						Primitive.GENERATE_NORMALS, divisions,
						wireframeAppearance);
				collisionObject = new SphereObject(radius, divisions);

			} else if (geometryElement.getAttribute("type").equals("plane")
					&& dynamicsType == RigidBody.STATIC) {
				// Plane primitive
				float[] planeDimensions = parseFloats(geometryElement
						.getElementsByTagName("dimensions").item(0)
						.getTextContent());
				Point3f[] points = new Point3f[4];
				points[3] = new Point3f(-planeDimensions[0] / 2,
						-planeDimensions[1] / 2, 0);
				points[2] = new Point3f(-planeDimensions[0] / 2,
						planeDimensions[1] / 2, 0);
				points[1] = new Point3f(planeDimensions[0] / 2,
						planeDimensions[1] / 2, 0);
				points[0] = new Point3f(planeDimensions[0] / 2,
						-planeDimensions[1] / 2, 0);
				int[] stripCounts = new int[1];
				stripCounts[0] = 4;
				int[] contourCount = new int[1];
				contourCount[0] = 1;
				GeometryInfo geometryInfo = new GeometryInfo(
						GeometryInfo.POLYGON_ARRAY);

				geometryInfo.setCoordinates(points);
				geometryInfo.setStripCounts(stripCounts);
				geometryInfo.setContourCounts(contourCount);

				NormalGenerator normalGenerator = new NormalGenerator();
				normalGenerator.setCreaseAngle((float) Math.toRadians(30));
				normalGenerator.generateNormals(geometryInfo);
				collisionObject = new PlaneObject();
				((PlaneObject) collisionObject).setDimensions(planeDimensions);
				Appearance appearance = new Appearance();
				Color3f objColor = new Color3f(0.0f, 0.5f, 0.2f);
				Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
				appearance.setMaterial(new Material(objColor, black, objColor,
						black, 80.0f));
				geometryNode = new Shape3D(geometryInfo.getGeometryArray(),
						appearance);
				wireframeGeometryNode = new Shape3D(
						geometryInfo.getGeometryArray(), wireframeAppearance);

			} else if (geometryElement.getAttribute("type").equals("mesh")) {
				// Mesh
				int assetID = Integer.parseInt(geometryElement
						.getElementsByTagName("asset_id").item(0)
						.getTextContent());

				Asset meshAsset = assetLibrary.getAsset(assetID);
				collisionObject = new MeshObject(meshAsset);
				geometryNode = ((Mesh) meshAsset.getContent()).getShape();
				wireframeGeometryNode = ((Mesh) meshAsset.getContent())
						.getShape().cloneTree(true, false);
				((Shape3D) wireframeGeometryNode)
						.setAppearance(wireframeAppearance);
			}

			// Effect set up
			Element effectElement = (Element) rigidBodyElement
					.getElementsByTagName("effect").item(0);
			Effect effect = null;
			if (effectElement != null) {
				if (effectElement.getAttribute("type").equals("force_field")) {
					double strength = Double.parseDouble(effectElement
							.getElementsByTagName("strength").item(0)
							.getTextContent());
					double innerRadius = Double.parseDouble(effectElement
							.getElementsByTagName("inner_radius").item(0)
							.getTextContent());
					double outerRadius = Double.parseDouble(effectElement
							.getElementsByTagName("outer_radius").item(0)
							.getTextContent());
					effect = new ForceField(strength, innerRadius, outerRadius);
				} else if (effectElement.getAttribute("type").equals("vortex")) {
					double strength = Double.parseDouble(effectElement
							.getElementsByTagName("strength").item(0)
							.getTextContent());
					double innerRadius = Double.parseDouble(effectElement
							.getElementsByTagName("inner_radius").item(0)
							.getTextContent());
					double outerRadius = Double.parseDouble(effectElement
							.getElementsByTagName("outer_radius").item(0)
							.getTextContent());
					Vector3d localAxis = new Vector3d(
							parseDoubles(rigidBodyElement
									.getElementsByTagName("local_axis").item(0)
									.getTextContent()));
					effect = new Vortex(position, strength, innerRadius,
							outerRadius, localAxis);
				}
			}

			if (geometryNode != null) {
				rigidBody.initialize(position, rotation, linearVelocity,
						angularVelocity, restitution, friction, mass,
						collisionObject, lifeTime, effect);
				addRigidBody(rigidBody, geometryNode, wireframeGeometryNode);
			}
		}
	}