コード例 #1
0
        public void SetWeight_SolverUpdates([ValueSource("WeightTestCases")] WeightTestCase testCase)
        {
            var chain = solver.GetChain(0);

            chain.effector.position = testCase.effectorPosition;
            solver.weight           = testCase.weight;

            solver.UpdateIK(1f);
            Assert.That(chain.target.position, Is.EqualTo(testCase.expectedTargetPosition).Using(vec3Compare));
        }
コード例 #2
0
        public void SetWeight_NoEffector_PositionListProvided_SolverUpdates([ValueSource("WeightTestCases")] WeightTestCase testCase)
        {
            var chain = solver.GetChain(0);

            chain.effector = null;
            solver.weight  = testCase.weight;

            var positions = new List <Vector3>();

            positions.Add(testCase.effectorPosition);

            solver.UpdateIK(positions, 1f);
            Assert.That(chain.target.position, Is.EqualTo(testCase.expectedTargetPosition).Using(vec3Compare));
        }