Esempio n. 1
0
        public void Init(SplineDefinition data)
        {
            Spline.SetUnselectedColour(System.Drawing.Color.White);
            Spline.Init(data.Points);
            Vector3[] editPoints = (Vector3[])data.Points.Clone();

            if (data.HasToward)
            {
                towardLanes = new Render2DPlane[data.Toward.LaneSize0];

                for (int i = 0; i != data.Toward.LaneSize0; i++)
                {
                    Render2DPlane lane = new Render2DPlane();
                    lane.Init(ref editPoints, data.Toward.Lanes[i], data.Toward.Flags);
                    towardLanes[i] = lane;
                }

                Toward    = data.Toward;
                HasToward = data.HasToward;
            }

            editPoints = (Vector3[])data.Points.Clone();

            if (data.HasBackward)
            {
                backwardLanes = new Render2DPlane[data.Backward.LaneSize0];

                for (int i = 0; i != data.Backward.LaneSize0; i++)
                {
                    Render2DPlane lane = new Render2DPlane();
                    lane.Init(ref editPoints, data.Backward.Lanes[i], data.Backward.Flags);
                    backwardLanes[i] = lane;
                }

                Backward    = data.Backward;
                HasBackward = data.HasBackward;
            }

            BBox        = BoundingBox.CreateFromPoints(editPoints);
            IndexOffset = data.IndexOffset;
        }
Esempio n. 2
0
        public void Init(SplineDefinition data)
        {
            Spline.SetUnselectedColour(new Vector4(1.0f, 0.0f, 0.0f, 1.0f));
            Spline.Init(data.points);
            Vector3[] editPoints = (Vector3[])data.points.Clone();

            if (data.hasToward)
            {
                towardLanes = new Render2DPlane[data.toward.LaneSize0];

                for (int i = 0; i != data.toward.LaneSize0; i++)
                {
                    Render2DPlane lane = new Render2DPlane();
                    lane.Init(ref editPoints, data.toward.Lanes[i], data.toward.Flags);
                    towardLanes[i] = lane;
                }

                Toward    = data.toward;
                HasToward = data.hasToward;
            }

            editPoints = (Vector3[])data.points.Clone();

            if (data.hasBackward)
            {
                backwardLanes = new Render2DPlane[data.backward.LaneSize0];

                for (int i = 0; i != data.backward.LaneSize0; i++)
                {
                    Render2DPlane lane = new Render2DPlane();
                    lane.Init(ref editPoints, data.backward.Lanes[i], data.backward.Flags);
                    backwardLanes[i] = lane;
                }

                Backward    = data.backward;
                HasBackward = data.hasBackward;
            }

            BBox = BoundingBox.FromPoints(editPoints);
        }