public LineHandler(Trajectory.Node start, Trajectory.Node end, Trajectory.Side side)
        {
            this.start = start;
            this.end   = end;
            this.side  = side;

            float start_x = start.getX(), end_x = end.getX()
            , start_y = start.getY(), end_y = end.getY();

            this.function = new MathFunction(new Vector2(start_x, start_y), new Vector2(end_x, end_y));

            this.scale_function = new MathFunction(new Vector2(start_x, start.getScale()), new Vector2(end_x, end.getScale()));
        }
예제 #2
0
        public LineHandler(Trajectory.Node start, Trajectory.Node end, Trajectory.Side side)
        {
            this.start = start;
            this.end   = end;
            this.side  = side;

            float start_x = start.getX() / LineHandler.DIVISOR, end_x = end.getX() / LineHandler.DIVISOR
            , start_y = 60f - start.getY() / LineHandler.DIVISOR, end_y = 60f - end.getY() / LineHandler.DIVISOR;


            min_x = Mathf.Min(start_x, end_x);
            max_x = Mathf.Max(start_x, end_x);

            min_y = Mathf.Min(start_y, end_y);
            max_y = Mathf.Max(start_y, end_y);


            this.function = new MathFunction(new Vector2(start_x, start_y), new Vector2(end_x, end_y));

            this.scale_function = new MathFunction(new Vector2(start_x, start.getScale()), new Vector2(end_x, end.getScale()));
        }