public void TestMultipleClosest() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10, true, new CameraSpacePoint() { Z = 0.2f }), FakeBodies.FakeSpineBody(20, true, new CameraSpacePoint() { Z = 0.02f }), FakeBodies.FakeSpineBody(30, true, new CameraSpacePoint() { Z = 0.02f }), FakeBodies.FakeSpineBody(40, true, new CameraSpacePoint() { Z = 0.7f }) }; var closest = bodies.ClosestBodies().ToArray(); Assert.AreEqual(closest.Length, 2); Assert.AreEqual(closest.Contains(bodies[1]), true); Assert.AreEqual(closest.Contains(bodies[2]), true); }
public void TestSingleClosest() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10, true, new CameraSpacePoint() { Z = 0.2f }), FakeBodies.FakeSpineBody(20, true, new CameraSpacePoint() { Z = 0.02f }), FakeBodies.FakeSpineBody(30, true, new CameraSpacePoint() { Z = 0.25f }), FakeBodies.FakeSpineBody(40, true, new CameraSpacePoint() { Z = 0.7f }) }; var closest = bodies.ClosestBodies().ToArray(); Assert.AreEqual(closest.Length, 1); Assert.AreEqual(closest[0], bodies[1]); }
public void TestSingleClosest() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10,true, new CameraSpacePoint() { Z = 0.2f }), FakeBodies.FakeSpineBody(20,true, new CameraSpacePoint() { Z = 0.02f }), FakeBodies.FakeSpineBody(30,true, new CameraSpacePoint() { Z = 0.25f }), FakeBodies.FakeSpineBody(40,true, new CameraSpacePoint() { Z = 0.7f }) }; var closest = bodies.ClosestBodies().ToArray(); Assert.AreEqual(closest.Length, 1); Assert.AreEqual(closest[0], bodies[1]); }
public void TestMultipleClosest() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10,true, new CameraSpacePoint() { Z = 0.2f }), FakeBodies.FakeSpineBody(20,true, new CameraSpacePoint() { Z = 0.02f }), FakeBodies.FakeSpineBody(30,true, new CameraSpacePoint() { Z = 0.02f }), FakeBodies.FakeSpineBody(40,true, new CameraSpacePoint() { Z = 0.7f }) }; var closest = bodies.ClosestBodies().ToArray(); Assert.AreEqual(closest.Length, 2); Assert.AreEqual(closest.Contains(bodies[1]), true); Assert.AreEqual(closest.Contains(bodies[2]), true); }