/*****************************************************************************
 * $LastChangedDate: 2011-04-09 21:58:06 -0400 (Sat, 09 Apr 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Viewpoint class (out-the-window).
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef VIEW_VIEWPOINT_OTW_HH
#define VIEW_VIEWPOINT_OTW_HH 1

#include "view/viewpoint.hh"
#include "view/observer.hh"

namespace view {

class View;

////////////////////////////////////////////////////////////////////////////////
/// @brief Functor that computes view matrix every frame (out-the-window).
/// See Viewpoint class.
///
class OtwViewpoint : public Viewpoint
{
PREVENT_COPYING(OtwViewpoint)
public:
                    OtwViewpoint( shptr<Observer> observer );
    virtual         ~OtwViewpoint();
protected:
    virtual Matrix  ComputeViewMatrix( shptr<View> view );

public:
    enum eOtwMode
    {
        // (update Lua)
        eOtwMode_OTW_NONE,  // an example of no OTW is chase-view
        eOtwMode_OTW_FRONT,
        eOtwMode_OTW_REAR,
        eOtwMode_OTW_LEFT,
        eOtwMode_OTW_RIGHT,
    };
    void        SetOtwMode( const eOtwMode otwMode );
    eOtwMode    GetOtwMode( void );
    void        SetObserver( shptr<Observer> observer );
    
private:
    shptr<Observer> mObserver;  ///< the observer of this view
    eOtwMode        mOtwMode;   ///< OTW front,rear,left,right (or none)
public:
    DECLARE_TYPESIG(TYPESIG_OTW_VIEWPOINT)
};

} // namespace view

#endif // VIEW_VIEWPOINT_OTW_HH
