Beispiel #1
0
        /// <summary>
        ///     Draws a tangent handle.
        /// </summary>
        /// <returns>The new tangent.</returns>
        /// <param name="pointPosition">Point position.</param>
        /// <param name="tangent">Tangent.</param>
        public static Vector3 TangentHandle(Vector3 pointPosition, Vector3 tangent)
        {
            Vector3 tangentPosition = pointPosition + tangent;
            float   pointSize       = HandleUtils.GetDotSize(tangentPosition);

            Vector3 newTangentPosition = Handles.FreeMoveHandle(tangentPosition, Quaternion.identity, pointSize, Vector3.zero,
                                                                Handles.DotCap);

            Color oldColor = Handles.color;

            Handles.color = oldColor * new Color(1.0f, 1.0f, 1.0f, 0.5f);
            Handles.DrawLine(pointPosition, newTangentPosition);
            Handles.color = oldColor;

            return(newTangentPosition - pointPosition);
        }
Beispiel #2
0
        /// <summary>
        ///     Draws the handle for a bezier point.
        /// </summary>
        /// <param name="point">Point.</param>
        public static void BezierPointHandle(IBezierPoint point)
        {
            float pointSize = HandleUtils.GetDotSize(point.position);

            point.position = Handles.FreeMoveHandle(point.position, Quaternion.identity, pointSize, Vector3.zero, Handles.DotCap);
        }