80 lines
1.6 KiB
C
80 lines
1.6 KiB
C
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#ifndef XGFXLIGHT_H
|
||
|
|
#define XGFXLIGHT_H
|
||
|
|
|
||
|
|
#include "xasset.h"
|
||
|
|
|
||
|
|
class XGfxLight : public XAsset
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
explicit XGfxLight();
|
||
|
|
|
||
|
|
void ParseData(QDataStream *aStream) override;
|
||
|
|
|
||
|
|
unsigned char GetType() const;
|
||
|
|
void SetType(unsigned char type);
|
||
|
|
|
||
|
|
unsigned char CanUseShadowMap() const;
|
||
|
|
void SetCanUseShadowMap(bool canUse);
|
||
|
|
|
||
|
|
const float* GetColor() const;
|
||
|
|
void SetColor(const float* color, size_t count = 3);
|
||
|
|
|
||
|
|
const float* GetDir() const;
|
||
|
|
void SetDir(const float* dir, size_t count = 3);
|
||
|
|
|
||
|
|
const float* GetOrigin() const;
|
||
|
|
void SetOrigin(const float* origin, size_t count = 3);
|
||
|
|
|
||
|
|
float GetRadius() const;
|
||
|
|
void SetRadius(float radius);
|
||
|
|
|
||
|
|
float GetCosHalfFovOuter() const;
|
||
|
|
void SetCosHalfFovOuter(float cosHalfFov);
|
||
|
|
|
||
|
|
float GetCosHalfFovInner() const;
|
||
|
|
void SetCosHalfFovInner(float cosHalfFov);
|
||
|
|
|
||
|
|
int GetExponent() const;
|
||
|
|
void SetExponent(int exponent);
|
||
|
|
|
||
|
|
unsigned int GetSpotShadowIndex() const;
|
||
|
|
void SetSpotShadowIndex(unsigned int index);
|
||
|
|
|
||
|
|
// Note: XGfxLightDef is a placeholder - we need to handle this appropriately
|
||
|
|
int GetDefPtr() const;
|
||
|
|
void SetDefPtr(int ptr);
|
||
|
|
|
||
|
|
private:
|
||
|
|
unsigned char mType = 0;
|
||
|
|
unsigned char mCanUseShadowMap = 0;
|
||
|
|
unsigned char mUnused[2] = {0, 0};
|
||
|
|
float mColor[3] = {0.0f, 0.0f, 0.0f};
|
||
|
|
float mDir[3] = {0.0f, 0.0f, 0.0f};
|
||
|
|
float mOrigin[3] = {0.0f, 0.0f, 0.0f};
|
||
|
|
float mRadius = 0.0f;
|
||
|
|
float mCosHalfFovOuter = 0.0f;
|
||
|
|
float mCosHalfFovInner = 0.0f;
|
||
|
|
int mExponent = 0;
|
||
|
|
unsigned int mSpotShadowIndex = 0;
|
||
|
|
int mDefPtr = 0; // Placeholder for XGfxLightDef pointer
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // XGFXLIGHT_H
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|