コード例 #1
0
        public void ClampChannels_WithSortWeights_ReducesChannelCount_GraterWeightsFirst()
        {
            var e = new EditableBoneWeight();

            e.AddChannel(0, 0.4f, true);
            e.AddChannel(1, 0.3f, true);
            e.AddChannel(2, 0.2f, true);
            e.AddChannel(3, 0.1f, true);
            e.AddChannel(4, 0.7f, true);
            e.AddChannel(5, 0.6f, true);
            e.AddChannel(6, 0.5f, true);

            e.Clamp(4, true);

            Assert.AreEqual(4, e.Count(), "Should contain four channels after clamp");
            Assert.AreEqual(4, e[0].boneIndex, "Channel does not contain the right bone index");
            Assert.AreEqual(5, e[1].boneIndex, "Channel does not contain the right bone index");
            Assert.AreEqual(6, e[2].boneIndex, "Channel does not contain the right bone index");
            Assert.AreEqual(0, e[3].boneIndex, "Channel does not contain the right bone index");
        }