using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VisiMath;
using VisiMath.Geometry;

namespace VisimBox.Renderer
{
    /// <summary>
    /// interface for camera
    /// </summary>
    public interface ICamera : VisiMath.ITransformation
    {
        /// <summary>
        /// Returns projection transformation matrix for specified width/height of the rendering viewport
        /// </summary>
        /// <param name="width">width of the viewport</param>
        /// <param name="height">Height of the viewport</param>
        /// <returns>Perspective or orthonormal projection matrix</returns>
        Matrix4 GetProjectionTransformation(int width, int height);
        
        /// <summary>
        /// Returns view transformation (basicaly inverted matrix of normal transformation)
        /// </summary>
        /// <returns>Camera transformation</returns>
        Matrix4 GetViewTransformation();


        /// <summary>
        /// Creates (if possible) picking ray from the mouse click (ray from the eye through the clicked position)
        /// </summary>
        /// <param name="mousex">MouseX position</param>
        /// <param name="mousey">MouseY position</param>
        /// <returns>Picking ray</returns>
        Ray GetPickingRay(float mousex, float mousey);

        /// <summary>
        /// Sets specified ray to picking ray from the mouse click (ray from the eye through the clicked position)
        /// </summary>
        /// <param name="mousex">MouseX position</param>
        /// <param name="mousey">MouseY position</param>
        /// <param name="ray">Ray to be set to picking ray</param>
        /// <returns>True if ray was set sucessfully</returns>
        bool GetPickingRay(float mousex, float mousey, Ray ray);

        /// <summary>
        /// Returns view normal
        /// </summary>
        /// <returns>Normal pointing in the center of the camera</returns>
        Vector3 GetViewingNormal();

        /// <summary>
        /// Turns camera to look at specified position (X unit vector will be rotated to face position)
        /// </summary>
        /// <param name="position">Look position</param>
        void LookAt(Vector3 position);
    }
}
