Esempio n. 1
0
        //constructor
        public Point(Vector3 coordinate, Vector3 v0, float curveLenght, int numberOfPoints, float step, WalkOnTheCurve curve)
        {
            Debug.Log("Computing point after the start point");
            this.curve          = curve;
            this.coordinate     = coordinate;                   //coordinate of the point
            this.curveLenght    = curveLenght;                  //total length of the curve
            this.numberOfPoints = numberOfPoints;
            intervalLenght      = curveLenght / numberOfPoints; //size of the interval between the points (key frames) on the curve
            this.step           = step;                         //which t is equivalent to this coordinate (index of the point)
            Debug.Log("Point constructor");
            //Debug.Log(curve.numberOfPoints);

            //find the next point
            findNextPoint();
            //calculate the v1 vector
            calculateVelocity();
            //calculate acceleration
            calculateAcc();
            //calculate the T vector
            calculateT();
            //calculate B vector
            calculateB();
            //calculate N vector
            calculateN();
        }
Esempio n. 2
0
        //constructor for the startPoint
        public Point(Vector3 coordinate, float curveLenght, int numberOfPoints, float step, WalkOnTheCurve curve)
        {
            Debug.Log("Start point constructor");

            this.curve          = curve;
            this.coordinate     = coordinate;                   //coordinate of the point
            this.curveLenght    = curveLenght;                  //total length of the curve
            this.numberOfPoints = numberOfPoints;
            intervalLenght      = curveLenght / numberOfPoints; //size of the interval between the points (key frames) on the curve

            findNextPoint();
            calculateVelocity();
        }