示例#1
0
        public void ForwardSampleVerificationOnAStraightLine()
        {
            var points = new Vector3[] {
                new Vector3(-300.0f, 100.0f, 37.5f),
                new Vector3(1.2134f, -35.0f, 175.0f)
            };

            var bezier        = Bezier.ConstructSmoothSpline(points);
            var pntsDirection = (points[1] - points[0]).normalized;

            for (float t = 0.0f; t < 1.0f; t += 0.05f)
            {
                UAssert.Near(Vector3.Dot(bezier.ForwardSample(t), pntsDirection), 1.0f, 0.001f);
            }
        }