Light.h
资源名称:g.rar [点击查看]
上传用户:laitongbao
上传日期:2021-02-20
资源大小:8176k
文件大小:1k
源码类别:
射击游戏
开发平台:
Visual C++
- #pragma once
- #include "NodeObject.h"
- /*
- 灯光类:继承NodeObject
- */
- class Light : public NodeObject
- {
- friend class TransitionController;
- friend class ShaderController;
- friend class FileController;
- friend class SceneTree;
- public:
- Light(Light& light);
- Light(TCHAR* name, VECTOR3 pos = VECTOR3(),float mutiple=1,DWORD diffuseColor=0xffffffff);
- Light(TCHAR* name,LIG_TYPE type, DWORD diffuseColor,DWORD specularColor,
- DWORD ambientColor, float mutiple ,VECTOR3 pos ,
- VECTOR3 direction,float range );
- void Enable(bool enable);
- virtual ~Light();
- void SetDirection(VECTOR3 direction);
- VECTOR3 GetDirection()const;
- void SetDiffuseColor(DWORD color);
- DWORD GetDiffuseColor()const;
- void SetSpecularColor(DWORD color);
- DWORD GetSpecularColor()const;
- void SetAmbientColor(DWORD color);
- DWORD GetAmbientColor()const;
- void SetLightType(LIG_TYPE type);
- LIG_TYPE GetLightType()const;
- void SetMutiple(float mut);
- float GetMutiple()const;
- void SetRange(float range);
- float GetRange()const;
- void DrawObject(){}; //绘制虚拟物体(灯)********没有实现
- void PreDraw();//设置灯光
- void CleanUp();
- private:
- static int ID;//公有ID
- int m_ID;//私有ID
- LIG_TYPE m_lightType;
- float m_mutiple;
- D3DXVECTOR3 m_vecDirection;
- D3DLIGHT9 m_light;
- bool enable;
- };