Exemple #1
0
        private void getSegment(AgentPrivate ap, ObjectPrivate op, out Vector start, out Vector end)
        {
            float            distance = 10;
            Quaternion       orientation;
            Vector           offset;
            ControlPointType controlPoint = ControlPointType.GazeTarget;

            if (ap.GetControlPointEnabled(controlPoint))
            {
                offset      = Vector.Forward * distance;
                start       = ap.GetControlPointPosition(controlPoint);
                orientation = ap.GetControlPointOrientation(controlPoint);
            }
            else
            {
                offset      = Vector.Left * distance;
                start       = op.Position + Vector.Up * 0.5f;
                orientation = op.Rotation;
            }

            offset = offset.Rotate(ref orientation);
            end    = start + offset;
        }