Example #1
0
            public static void RenderAndDeleteTrajectory(IntPtr trajectory_iterator,
                                               UnityEngine.Color colour,
                                               Style style)
            {
                try {
                  Vector3d? previous_point = null;

                  UnityEngine.GL.Color(colour);
                  int size = trajectory_iterator.IteratorSize();

                  for (int i = 0;
                   !trajectory_iterator.IteratorAtEnd();
                   trajectory_iterator.IteratorIncrement(), ++i) {
                Vector3d current_point = (Vector3d)trajectory_iterator.IteratorGetXYZ();
                if (previous_point.HasValue) {
                  if (style == Style.FADED) {
                colour.a = (float)(4 * i + size) / (float)(5 * size);
                UnityEngine.GL.Color(colour);
                  }
                  if (style != Style.DASHED || i % 2 == 1) {
                AddSegment(previous_point.Value,
                       current_point,
                       hide_behind_bodies : true);
                  }
                }
                previous_point = current_point;
                  }
                } finally {
                  Interface.IteratorDelete(ref trajectory_iterator);
                }
            }