metaforce/Runtime/Particle/CRealElement.hpp

378 lines
11 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-02-05 08:34:14 +00:00
#include "IElement.hpp"
2016-02-28 06:55:05 +00:00
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Real_Elements */
2016-03-04 23:04:53 +00:00
namespace urde
{
2016-02-06 07:31:53 +00:00
class CREKeyframeEmitter : public CRealElement
{
u32 x4_percent;
u32 x8_unk1;
bool xc_loop;
bool xd_unk2;
u32 x10_loopEnd;
u32 x14_loopStart;
std::vector<float> x18_keys;
public:
CREKeyframeEmitter(CInputStream& in);
bool GetValue(int frame, float& valOut) const;
};
2016-02-05 08:34:14 +00:00
class CRELifetimeTween : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
public:
CRELifetimeTween(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_a(std::move(a)), x8_b(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREConstant : public CRealElement
{
float x4_val;
public:
CREConstant(float val) : x4_val(val) {}
bool GetValue(int frame, float& valOut) const;
bool IsConstant() const {return true;}
};
class CRETimeChain : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
std::unique_ptr<CIntElement> xc_swFrame;
2016-02-05 08:34:14 +00:00
public:
CRETimeChain(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b, std::unique_ptr<CIntElement>&& c)
: x4_a(std::move(a)), x8_b(std::move(b)), xc_swFrame(std::move(c)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREAdd : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
public:
CREAdd(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_a(std::move(a)), x8_b(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREClamp : public CRealElement
{
std::unique_ptr<CRealElement> x4_min;
std::unique_ptr<CRealElement> x8_max;
std::unique_ptr<CRealElement> xc_val;
2016-02-05 08:34:14 +00:00
public:
CREClamp(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b, std::unique_ptr<CRealElement>&& c)
: x4_min(std::move(a)), x8_max(std::move(b)), xc_val(std::move(c)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREInitialRandom : public CRealElement
{
std::unique_ptr<CRealElement> x4_min;
std::unique_ptr<CRealElement> x8_max;
2016-02-05 08:34:14 +00:00
public:
CREInitialRandom(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_min(std::move(a)), x8_max(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
bool IsConstant() const {return true;}
};
class CRERandom : public CRealElement
{
std::unique_ptr<CRealElement> x4_min;
std::unique_ptr<CRealElement> x8_max;
2016-02-05 08:34:14 +00:00
public:
CRERandom(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_min(std::move(a)), x8_max(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
2016-02-12 06:06:17 +00:00
class CREDotProduct : public CRealElement
{
std::unique_ptr<CVectorElement> x4_a;
std::unique_ptr<CVectorElement> x8_b;
public:
CREDotProduct(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CVectorElement>&& b)
: x4_a(std::move(a)), x8_b(std::move(b)) {}
2016-02-12 06:06:17 +00:00
bool GetValue(int frame, float& valOut) const;
};
2016-02-05 08:34:14 +00:00
class CREMultiply : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
CREMultiply(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_a(std::move(a)), x8_b(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREPulse : public CRealElement
{
2016-02-06 07:31:53 +00:00
std::unique_ptr<CIntElement> x4_aDuration;
std::unique_ptr<CIntElement> x8_bDuration;
std::unique_ptr<CRealElement> xc_valA;
std::unique_ptr<CRealElement> x10_valB;
2016-02-05 08:34:14 +00:00
public:
CREPulse(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b,
std::unique_ptr<CRealElement>&& c, std::unique_ptr<CRealElement>&& d)
: x4_aDuration(std::move(a)), x8_bDuration(std::move(b)), xc_valA(std::move(c)), x10_valB(std::move(d)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CRETimeScale : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CRETimeScale(std::unique_ptr<CRealElement>&& a)
: x4_a(std::move(a)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CRELifetimePercent : public CRealElement
{
2016-02-06 07:31:53 +00:00
std::unique_ptr<CRealElement> x4_percentVal;
2016-02-05 08:34:14 +00:00
public:
CRELifetimePercent(std::unique_ptr<CRealElement>&& a)
: x4_percentVal(std::move(a)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CRESineWave : public CRealElement
{
2016-02-06 07:31:53 +00:00
std::unique_ptr<CRealElement> x4_magnitude;
std::unique_ptr<CRealElement> x8_linearFrame;
std::unique_ptr<CRealElement> xc_constantFrame;
2016-02-05 08:34:14 +00:00
public:
CRESineWave(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b,
std::unique_ptr<CRealElement>&& c)
: x4_magnitude(std::move(a)), x8_linearFrame(std::move(b)), xc_constantFrame(std::move(c)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
2016-08-15 20:43:04 +00:00
class CREInitialSwitch : public CRealElement
2016-02-05 08:34:14 +00:00
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
CREInitialSwitch(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_a(std::move(a)), x8_b(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CRECompareLessThan : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
std::unique_ptr<CRealElement> xc_c;
std::unique_ptr<CRealElement> x10_d;
2016-02-05 08:34:14 +00:00
public:
CRECompareLessThan(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b,
std::unique_ptr<CRealElement>&& c, std::unique_ptr<CRealElement>&& d)
: x4_a(std::move(a)), x8_b(std::move(b)), xc_c(std::move(c)), x10_d(std::move(d)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CRECompareEquals : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
std::unique_ptr<CRealElement> xc_c;
std::unique_ptr<CRealElement> x10_d;
2016-02-05 08:34:14 +00:00
public:
CRECompareEquals(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b,
std::unique_ptr<CRealElement>&& c, std::unique_ptr<CRealElement>&& d)
: x4_a(std::move(a)), x8_b(std::move(b)), xc_c(std::move(c)), x10_d(std::move(d)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam1 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam2 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam3 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam4 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam5 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam6 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam7 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleAccessParam8 : public CRealElement
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleSizeOrLineLength : public CRealElement
2016-02-05 08:34:14 +00:00
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CREParticleRotationOrLineWidth : public CRealElement
2016-02-05 08:34:14 +00:00
{
public:
bool GetValue(int frame, float& valOut) const;
};
class CRESubtract : public CRealElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
CRESubtract(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_a(std::move(a)), x8_b(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREVectorMagnitude : public CRealElement
{
std::unique_ptr<CVectorElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CREVectorMagnitude(std::unique_ptr<CVectorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREVectorXToReal : public CRealElement
{
std::unique_ptr<CVectorElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CREVectorXToReal(std::unique_ptr<CVectorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREVectorYToReal : public CRealElement
{
std::unique_ptr<CVectorElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CREVectorYToReal(std::unique_ptr<CVectorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREVectorZToReal : public CRealElement
{
std::unique_ptr<CVectorElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CREVectorZToReal(std::unique_ptr<CVectorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CRECEXT : public CRealElement
{
std::unique_ptr<CIntElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CRECEXT(std::unique_ptr<CIntElement>&& a)
: x4_a(std::move(a)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
2016-02-07 00:19:59 +00:00
class CREIntTimesReal : public CRealElement
{
std::unique_ptr<CIntElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
CREIntTimesReal(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CRealElement>&& b)
: x4_a(std::move(a)), x8_b(std::move(b)) {}
2016-02-05 08:34:14 +00:00
bool GetValue(int frame, float& valOut) const;
};
2016-02-12 06:06:17 +00:00
class CREConstantRange : public CRealElement
{
std::unique_ptr<CRealElement> x4_val;
std::unique_ptr<CRealElement> x8_min;
std::unique_ptr<CRealElement> xc_max;
std::unique_ptr<CRealElement> x10_inRange;
std::unique_ptr<CRealElement> x14_outOfRange;
public:
CREConstantRange(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b,
std::unique_ptr<CRealElement>&& c, std::unique_ptr<CRealElement>&& d,
std::unique_ptr<CRealElement>&& e)
: x4_val(std::move(a)), x8_min(std::move(b)), xc_max(std::move(c)),
x10_inRange(std::move(d)), x14_outOfRange(std::move(e)) {}
2016-02-12 06:06:17 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREGetComponentRed : public CRealElement
{
std::unique_ptr<CColorElement> x4_a;
public:
CREGetComponentRed(std::unique_ptr<CColorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-12 06:06:17 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREGetComponentGreen : public CRealElement
{
std::unique_ptr<CColorElement> x4_a;
public:
CREGetComponentGreen(std::unique_ptr<CColorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-12 06:06:17 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREGetComponentBlue : public CRealElement
{
std::unique_ptr<CColorElement> x4_a;
public:
CREGetComponentBlue(std::unique_ptr<CColorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-12 06:06:17 +00:00
bool GetValue(int frame, float& valOut) const;
};
class CREGetComponentAlpha : public CRealElement
{
std::unique_ptr<CColorElement> x4_a;
public:
CREGetComponentAlpha(std::unique_ptr<CColorElement>&& a)
: x4_a(std::move(a)) {}
2016-02-12 06:06:17 +00:00
bool GetValue(int frame, float& valOut) const;
};
}