示例#1
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (PhysicsWorld != null)
     {
         PhysicsWorld.Dispose();
     }
     OnClosing();
 }
示例#2
0
        public void WorldTest()
        {
            {
                var world = new PhysicsWorld(staticBodyCount: 4, dynamicBodyCount: 10, jointCount: 23);

                Assert.AreEqual(4, world.StaticBodyCount);
                Assert.AreEqual(10, world.DynamicBodyCount);
                Assert.AreEqual(14, world.BodyCount);
                Assert.AreEqual(23, world.JointCount);

                world.Reset(0, 0, 0);
                Assert.AreEqual(0, world.StaticBodyCount);
                Assert.AreEqual(0, world.DynamicBodyCount);
                Assert.AreEqual(0, world.BodyCount);
                Assert.AreEqual(0, world.JointCount);

                world.Dispose();
            }

            {
                // World clone.
                var world = new PhysicsWorld(staticBodyCount: 40, dynamicBodyCount: 100, jointCount: 200);
                Assert.AreEqual(40, world.StaticBodyCount);
                Assert.AreEqual(100, world.DynamicBodyCount);
                Assert.AreEqual(140, world.BodyCount);
                Assert.AreEqual(200, world.JointCount);

                var worldClone = world.Clone();
                Assert.AreEqual(40, worldClone.StaticBodyCount);
                Assert.AreEqual(100, worldClone.DynamicBodyCount);
                Assert.AreEqual(140, worldClone.BodyCount);
                Assert.AreEqual(200, worldClone.JointCount);

                worldClone.Dispose();
                world.Dispose();
            }
        }
示例#3
0
 public void Dispose()
 {
     Physics.Dispose();
 }
 public void TearDown()
 {
     m_World.Dispose();
 }
示例#5
0
 public void Run()
 {
     RenderManager.Renderer.CreateContext(this, 1080, 720);
     physicsWorld.Dispose();
 }