prime/include/Kyoto/Particles/IElement.hpp

74 lines
1.9 KiB
C++
Raw Normal View History

2022-10-09 16:34:58 +00:00
#ifndef _IELEMENT
#define _IELEMENT
#include "types.h"
2022-10-11 15:30:39 +00:00
#include "Kyoto/TToken.hpp"
2022-10-09 16:34:58 +00:00
class CColor;
2022-10-11 15:30:39 +00:00
class CTexture;
2022-10-09 16:34:58 +00:00
class CVector3f;
class IElement {
public:
virtual ~IElement(){};
// -> CFrameDelayedKiller
void* operator new(size_t sz, const char*, const char*);
void* operator new(size_t sz) { return operator new(sz, "??(??)", nullptr); }
2022-10-09 16:34:58 +00:00
void operator delete(void* ptr, size_t sz);
};
class CRealElement : public IElement {
public:
virtual bool GetValue(int frame, float& valOut) const = 0;
virtual bool IsConstant() const { return false; }
};
class CIntElement : public IElement {
public:
2023-02-06 17:01:01 +00:00
~CIntElement() override{};
2022-10-09 16:34:58 +00:00
virtual bool GetValue(int frame, int& valOut) const = 0;
};
class CVectorElement : public IElement {
public:
virtual bool GetValue(int frame, CVector3f& valOut) const = 0;
virtual bool IsFastConstant() const { return false; }
};
class CModVectorElement : public IElement {
public:
virtual bool GetValue(int frame, CVector3f& pVel, CVector3f& pPos) const = 0;
};
class CColorElement : public IElement {
public:
virtual bool GetValue(int frame, CColor& colorOut) const = 0;
};
class CEmitterElement : public IElement {
public:
virtual bool GetValue(int frame, CVector3f& pPos, CVector3f& pVel) const = 0;
};
2022-10-11 15:30:39 +00:00
struct SUVElementSet {
float xMin, yMin, xMax, yMax;
2022-10-17 02:33:08 +00:00
2022-10-18 23:13:51 +00:00
// SUVElementSet() : xMin(0.f), yMin(1.f), xMax(0.f), yMax(1.f) {}
//SUVElementSet(float xMin, float yMin, float xMax, float yMax)
//: xMin(xMin), yMin(yMin), xMax(xMax), yMax(yMax) {}
2022-10-18 23:13:51 +00:00
// SUVElementSet(const SUVElementSet& other)
// : xMin(other.xMin), yMin(other.yMin), xMax(other.xMax), yMax(other.yMax) {}
2022-10-11 15:30:39 +00:00
};
class CUVElement : public IElement {
public:
virtual TLockedToken< CTexture > GetValueTexture(int frame) const = 0;
virtual void GetValueUV(int frame, SUVElementSet& valOut) const = 0;
virtual bool HasConstantTexture() const = 0;
virtual bool HasConstantUV() const = 0;
};
2022-10-09 16:34:58 +00:00
#endif // _IELEMENT