コード例 #1
0
        public void NormalizeChannels_OutputsNormalizedWeights()
        {
            EditableBoneWeight editableBoneWeight = new EditableBoneWeight();

            editableBoneWeight.AddChannel(new BoneWeightData(0, 1f), true);
            editableBoneWeight.AddChannel(new BoneWeightData(1, 1f), true);
            editableBoneWeight.AddChannel(new BoneWeightData(2, 1f), true);
            editableBoneWeight.AddChannel(new BoneWeightData(3, 1f), true);

            editableBoneWeight.NormalizeChannels();

            Assert.AreEqual(0.25f, editableBoneWeight.GetBoneWeightData(0).weight, "Weight should be normalized");
            Assert.AreEqual(0.25f, editableBoneWeight.GetBoneWeightData(1).weight, "Weight should be normalized");
            Assert.AreEqual(0.25f, editableBoneWeight.GetBoneWeightData(2).weight, "Weight should be normalized");
            Assert.AreEqual(0.25f, editableBoneWeight.GetBoneWeightData(3).weight, "Weight should be normalized");
        }