public void TestMultipleCenter() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10, true, new CameraSpacePoint() { X = 0.2f }), FakeBodies.FakeSpineBody(20, true, new CameraSpacePoint() { X = -0.02f //Center is an absolute value, so 1 and 2 should be same distance }), FakeBodies.FakeSpineBody(30, true, new CameraSpacePoint() { X = 0.02f }), FakeBodies.FakeSpineBody(40, true, new CameraSpacePoint() { X = 0.7f }) }; var closest = bodies.CenterBodies().ToArray(); Assert.AreEqual(closest.Length, 2); Assert.AreEqual(closest.Contains(bodies[1]), true); Assert.AreEqual(closest.Contains(bodies[2]), true); }
public void TestSingleCenter() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10, true, new CameraSpacePoint() { X = 0.2f, }), FakeBodies.FakeSpineBody(20, true, new CameraSpacePoint() { X = 0.1f, }), FakeBodies.FakeSpineBody(30, true, new CameraSpacePoint() { X = 0.01f, }), FakeBodies.FakeSpineBody(40, true, new CameraSpacePoint() { X = 0.7f }) }; var closest = bodies.CenterBodies().ToArray(); Assert.AreEqual(closest.Length, 1); Assert.AreEqual(closest[0], bodies[2]); }
public void TestMultipleCenter() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10,true, new CameraSpacePoint() { X = 0.2f }), FakeBodies.FakeSpineBody(20,true, new CameraSpacePoint() { X = -0.02f //Center is an absolute value, so 1 and 2 should be same distance }), FakeBodies.FakeSpineBody(30,true, new CameraSpacePoint() { X = 0.02f }), FakeBodies.FakeSpineBody(40,true, new CameraSpacePoint() { X = 0.7f }) }; var closest = bodies.CenterBodies().ToArray(); Assert.AreEqual(closest.Length, 2); Assert.AreEqual(closest.Contains(bodies[1]), true); Assert.AreEqual(closest.Contains(bodies[2]), true); }
public void TestSingleCenter() { KinectBody[] bodies = new KinectBody[] { FakeBodies.FakeSpineBody(10,true, new CameraSpacePoint() { X = 0.2f, }), FakeBodies.FakeSpineBody(20,true, new CameraSpacePoint() { X = 0.1f, }), FakeBodies.FakeSpineBody(30,true, new CameraSpacePoint() { X = 0.01f, }), FakeBodies.FakeSpineBody(40,true, new CameraSpacePoint() { X = 0.7f }) }; var closest = bodies.CenterBodies().ToArray(); Assert.AreEqual(closest.Length, 1); Assert.AreEqual(closest[0], bodies[2]); }