Example #1
0
        public void TriangleMeshShapeTest()
        {
            var s = new CylinderShape(1, 2);
              var v0 = s.GetVolume(0.001f, 10);

              var m = s.GetMesh(0.001f, 10);
              var s1 = new TriangleMeshShape(m);
              var v1 = m.GetVolume();

              Assert.IsTrue(Numeric.AreEqual(v0, v1, 0.01f * (1 + v0)));  // 1% error is allowed.
        }
Example #2
0
        public void ScaledConvexShape()
        {
            var s = new CylinderShape(1, 2);
              var v0 = s.GetVolume(0.001f, 10);

              var s1 = new ScaledConvexShape(new CylinderShape(10, 10), new Vector3F(0.1f, 0.2f, 0.1f));
              var v1 = s1.GetVolume(0.0001f, 10);

              Assert.IsTrue(Numeric.AreEqual(v0, v1, 0.01f * (1 + v0)));  // 1% error is allowed.
        }