'Ill
class Controller : public Object {
protected:
Model * model; // model we're rendering
View * view; // view, we're using for rendering
Camera * camera; // camera used for rendering
Timer * timer;
Console * console;
Font * font;
int numFrames; // # of rendered frames
float lastFrameTimes [8];
// time of processing of the last 8 frames float fps;
Vector3D pos; // position of player
float yaw, pitch, roll;
// euler angles of player bool resourcesUploaded; Vector3D velocity;
public:
Controller ( const char * theName, Model * theModel,
View * theView, Camera * theCamera ); -Controller ();
Timer * getTimer () const
return timer;
Model * getModel () const return model;
View * getView () const return view;
Camera * getCamera () const return camera;

Пишем портальный рендерер (часть I)

Console * getConsole () const return console;
float getFps () const return fps;
int getNumFrames () const return numFrames;
float getYaw () const return yaw;
float getPitch () const return pitch;
float getRoll () const return roll;
const Vector3D& getPos () const return pos;
void setView ( View * theView ); void setModel ( Model * theModel ); void setCamera ( Camera * theCamera );
virtual bool isOk () const;
virtual InputReader * createlnputReader ( View * ) {
return NULL;
}

А. В. Боресков. ['рафика трехмерной компьютерной игры

virtual void draw ();
virtual int update ();
virtual int handleChar ( int ch ) ,-virtual int handleKey ( int key, bool pressed );
virtual int handleKeyboard( const KeyboardState&
keys ) = 0 ;
virtual int handleMouse ( const MouseState&
mouse ) = 0 ,
static MetaClass classlnstance;
};

Метод createlnputReader предназначен для создания объекта класса InputReader, служащего для чтения ввода пользователя.

Метод draw предназначен для построения изображения сцены, ссылка на которую содержится в переменной model.


⇐ Предыдущая| |Следующая ⇒