TCamera


This template class has been removed in release 10.0.0. Use CCamera class instead.

Implements a base 3D camera. This class is supposed to be used as a base class for 3D camera implementations. It only implement 3D projection related features.

You can find more information in comments below.

template<class TYPE>
    class TCamera :public virtual ICamera<TYPE>
    {
    protected:
        ICameraListener<TYPE> *m_pListener; // Changes listener 
        PROJECTION_MODE m_eProjectionMode; // Current projection mode 
        math::TMat4<TYPE> m_sProjectionMatrix; // Current projection matrix 
    
        void BuildProjectionMatrix(); // Update projection matrix 
    
        virtual void NotifyOnChange() = 0; // Derived classes should implement this method. It is called when any changed in projection parameters happend 
    public:
        ICameraListener<TYPE> *getListener() override;
        PROJECTION_MODE getProjectionMode() override;
        TViewport<TYPE> getViewport() override;
        TYPE getFOV() override;
        TYPE getAspect() override;
        TYPE getNearPlane() override;
        TYPE getFarPlane() override;
        math::TMat4<TYPE> getProjectionMatrix() override;
    
        void setListener(ICameraListener<TYPE> *value) override;
        bool setProjectionMode(const PROJECTION_MODE value) override;
        bool setViewport(const TViewport<TYPE> &value) override;
        bool setFOV(const TYPE value) override;
        bool setAspect(const TYPE value) override;
        bool setNearPlane(const TYPE value) override;
        bool setFarPlane(const TYPE value) override;
    
        bool Planes(const TYPE near_plane, const TYPE far_plane) override;
        bool Frustum(const TViewport<TYPE> &viewport) override;
        bool Perspective(const TYPE fov, const TYPE aspect) override;
        bool Ortho(const TViewport<TYPE> &viewport) override;
    
        TCamera(ICameraListener<TYPE> *listener = nullptr); // Create with default parameters 
        virtual ~TCamera() = default;
    
        void Release() override;
    };
Namespace: nitisa::graphics3d
Include: Nitisa/Modules/Graphics3D/Core/Camera.h