Example #1
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="TransformedFigure" /> class.
        /// </summary>
        /// <param name="child">The figure that is transformed.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="child"/> is <see langword="null"/>.
        /// </exception>
        public TransformedFigure(Figure child)
        {
            if (child == null)
            throw new ArgumentNullException("child");

              _child = child;
              Pose = Pose.Identity;
              Scale = new Vector3F(1, 1, 1);
        }
Example #2
0
        public void Update(Figure figure)
        {
            if (Vertices != null)
            Vertices.Clear();
              else
            Vertices = new ArrayList<Vector3F>(2);

              if (StrokeIndices != null)
            StrokeIndices.Clear();
              else
            StrokeIndices = new ArrayList<int>(2);

              if (FillIndices != null)
            FillIndices.Clear();
              else if (figure.HasFill)
            FillIndices = new ArrayList<int>(3);

              figure.Flatten(Vertices, StrokeIndices, FillIndices);

              UpdateBoundingShape();
              UpdateHitShape();
        }