guitscontrol.h

来自「五行MMORPG引擎系统V1.0」· C头文件 代码 · 共 78 行

H
78
字号
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

#ifndef _GUITSCONTROL_H_
#define _GUITSCONTROL_H_

#ifndef _GUICONTROL_H_
#include "gui/core/guiControl.h"
#endif
#ifndef _MMATH_H_
#include "math/mMath.h"
#endif
#ifndef _DGL_H_
#include "dgl/dgl.h"
#endif

struct CameraQuery
{
   CameraQuery()
   {
      ortho = false;
   }

   SimObject*  object;
   F32         nearPlane;
   F32         farPlane;
   F32         fov;
   MatrixF     cameraMatrix;

   F32         leftRight;
   F32         topBottom;
   bool        ortho;
   //Point3F position;
   //Point3F viewVector;
   //Point3F upVector;
};

class GuiTSCtrl : public GuiControl
{
   typedef GuiControl Parent;

protected:
   GLdouble       mSaveModelview[16];
   GLdouble       mSaveProjection[16];
   GLint          mSaveViewport[4];

   static U32     smFrameCount;
   F32            mCameraZRot;
   F32            mForceFOV;

   bool           mApplyFilterToChildren;

public:
   CameraQuery    mLastCameraQuery;

public:
   GuiTSCtrl();

   void onPreRender();
   void onRender(Point2I offset, const RectI &updateRect);
   virtual bool processCameraQuery(CameraQuery *query);
   virtual void renderWorld(const RectI &updateRect);

   static void initPersistFields();
   static void consoleInit();

   bool project(const Point3F &pt, Point3F *dest); // returns screen space X,Y and Z for world space point
   bool unproject(const Point3F &pt, Point3F *dest); // returns world space point for X, Y and Z



   DECLARE_CONOBJECT(GuiTSCtrl);
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?