x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
GameLevel.h - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\DarkPuzzle\GameEngine\GameLevel.h
旋转
特效
属性
历史版本
#pragma once #include "btBulletDynamicsCommon.h" #include "BulletColladaConverter\ColladaConverter.h" #include "dom\domphysics_model.h" #include "dom\domelements.h" #include "dom\domcollada.h" #include "GameScreen.h" //#include "Game3DObject.h" #include "Character.h" #include "Map.h" using namespace DarkBattle; namespace DarkBattle{ #define EFFECT_NUMPARAMS 16 extern const char* EffectParamNames[EFFECT_NUMPARAMS]; #define EPASS_RenderAmbient 0 #define EPASS_RenderShadowMesh 1 #define EPASS_RenderLight 2 #define RAY_STATIC_FILTER 2 #define RAY_DYNAMIC_FILTER 1 class Character; class Map; class GameLevel: public GameScreen{//tolua_export private: static GameLevel* theGameLevel; HRESULT hr; #define FRAME_RATE 30.0f //adjust this value to balanced between speed and accuracy of the simulation #define MAX_PROXIES 3000 //maximum number of physical object in the simulation #define GRAVITY_VALUE -98.0f Map* map; MyIterator
thinkingIter; //init anything related to bullet btDefaultCollisionConfiguration* m_collisionConfiguration; btCollisionDispatcher* m_dispatcher; btBroadphaseInterface* m_overlappingPairCache; btConstraintSolver* m_solver; btDynamicsWorld* m_dynamicsWorld; //keep the collision shapes, for deletion/cleanup btAlignedObjectArray
m_collisionShapes; char* levelName;///the file name of the current level bool hasShadow; //mean that the shadow is enable D3DXHANDLE techniqueRenderScene; // render scene with lighting only, z disable Vec3 mouseHitPos,mouseHitNorm; bool mouseIsHit; bool haveTimeLeft(); void renderDebugLines(); ///this function used to process all collision events static bool myContactCallback(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1){ return true; } void initBullet(); void framemoveBullet(float elapseTime); void destroyBullet(); class MyConverter : public ColladaConverter { private: btRigidBody* findRigidBodyBySID(const char* sid); public: MyConverter(btDynamicsWorld* dynaWorld): ColladaConverter(dynaWorld){}; ~MyConverter(void){}; bool load(IDirect3DDevice9* pd3dDevice, const char* fileName, bool hasShadow); }; void initPathFinding(); float mapSizeX, mapSizeY; inline static double GetCurrentTime(){return DXUTGetGlobalTimer()->GetTime();}; double previousTime; public: static enum EffectParamConst{MatWorld,MatView,MatProjection,MatWorldView,MatWorldViewProjection, BumpTexture,BaseTexture,LightShadowPos,LightShadowRange,LightShadowColor,LightFallOff, LightShadowDirView,LightIsSpotLight,LightShadowRadius,DebugMode,LightDirectionalDir}; //effect parameters management static D3DXHANDLE* effectParams; inline static D3DXHANDLE GetEffectParamConst(EffectParamConst id){ return effectParams[id]; } inline static GameLevel* GetInstance(){assert(theGameLevel!=NULL);return theGameLevel;}//tolua_export Character* controllableCharacter; ID3DXEffect* pEffect; //use to load effect file GameLevel(IDirect3DDevice9* pd3dDevice); ~GameLevel(void); void LoadContent(IDirect3DDevice9* pd3dDevice,const char* fileName); void OnResetDevice(IDirect3DDevice9* pd3dDevice); void renderPhysicsWorld(); void RemoveRigidBody(btRigidBody* pBody){m_dynamicsWorld->removeRigidBody(pBody);}; void AddRigidBody(btRigidBody* pBody){m_dynamicsWorld->addRigidBody(pBody);}; //TODO:need to clean these stuffs D3DLIGHT9 light; D3DXVECTOR3 eye; D3DXVECTOR3 at; D3DXVECTOR3 up; D3DXMATRIX view; D3DXMATRIX projection; D3DXMATRIX viewProjection; D3DXMATRIX world; D3DXMATRIX worldView; D3DXMATRIX worldViewProjection; float angle;//camera angle //bool isRenderingShadowMesh; UINT currentPass; void OnRender(IDirect3DDevice9* pd3dDevice); void OnFrameMove(float elapsedTime); void OnLostDevice(); inline bool IsMouseHit() {return mouseIsHit;}//tolua_export inline Vec3 GetMouseHitPos(){return mouseHitPos;};//tolua_export inline Vec3 GetMouseHitNorm(){return mouseHitNorm;};//tolua_export static void DrawDebugLine(Vec3 fromP, Vec3 toP, Vec3 color);//tolua_export static void DrawDebugLine(Vec3 fromP, Vec3 toP);//tolua_export static void DrawDebugLineDelta(Vec3 fromP, Vec3 delta);//tolua_export static void DrawDebugLineDelta(Vec3 fromP, Vec3 delta,Vec3 color);//tolua_export static bool RayCast(Vec3 fromP, Vec3 toP, Vec3* pHitPos, Vec3* pNormalVec);//tolua_export static bool RayCastTwoWay(Vec3 pos1, Vec3 pos2);//tolua_export inline Map* GetMap(){return map;};//tolua_export void SetMapSizeX(float size);//tolua_export void SetMapSizeY(float size);;//tolua_export };//tolua_export }
GameLevel.h
网页地址
文件地址
上一页
41/65
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.