2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-02-05 01:27:03 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
#include "Runtime/Particle/IElement.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2016-02-05 08:34:14 +00:00
|
|
|
|
2016-02-28 06:55:05 +00:00
|
|
|
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Vector_Elements */
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
|
|
|
|
|
|
|
class CVEKeyframeEmitter : public CVectorElement {
|
|
|
|
u32 x4_percent;
|
|
|
|
u32 x8_unk1;
|
|
|
|
bool xc_loop;
|
|
|
|
bool xd_unk2;
|
|
|
|
u32 x10_loopEnd;
|
|
|
|
u32 x14_loopStart;
|
|
|
|
std::vector<zeus::CVector3f> x18_keys;
|
2016-02-05 01:27:03 +00:00
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVEKeyframeEmitter(CInputStream& in);
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVECone : public CVectorElement {
|
|
|
|
std::unique_ptr<CVectorElement> x4_direction;
|
|
|
|
std::unique_ptr<CRealElement> x8_magnitude;
|
|
|
|
zeus::CVector3f xc_xVec;
|
|
|
|
zeus::CVector3f x18_yVec;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVECone(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CRealElement>&& b);
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVETimeChain : public CVectorElement {
|
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
|
|
|
std::unique_ptr<CVectorElement> x8_b;
|
|
|
|
std::unique_ptr<CIntElement> xc_swFrame;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVETimeChain(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CVectorElement>&& b,
|
|
|
|
std::unique_ptr<CIntElement>&& c)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)), xc_swFrame(std::move(c)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEAngleCone : public CVectorElement {
|
|
|
|
std::unique_ptr<CRealElement> x4_angleXConstant;
|
|
|
|
std::unique_ptr<CRealElement> x8_angleYConstant;
|
|
|
|
std::unique_ptr<CRealElement> xc_angleXRange;
|
|
|
|
std::unique_ptr<CRealElement> x10_angleYRange;
|
|
|
|
std::unique_ptr<CRealElement> x14_magnitude;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVEAngleCone(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_angleXConstant(std::move(a))
|
|
|
|
, x8_angleYConstant(std::move(b))
|
|
|
|
, xc_angleXRange(std::move(c))
|
|
|
|
, x10_angleYRange(std::move(d))
|
|
|
|
, x14_magnitude(std::move(e)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEAdd : public CVectorElement {
|
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
|
|
|
std::unique_ptr<CVectorElement> x8_b;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CVEAdd(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CVectorElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2018-12-08 05:30:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CVECircleCluster : public CVectorElement {
|
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
|
|
|
zeus::CVector3f x8_xVec;
|
|
|
|
zeus::CVector3f x14_yVec;
|
|
|
|
float x20_deltaAngle;
|
|
|
|
std::unique_ptr<CRealElement> x24_magnitude;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVECircleCluster(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CVectorElement>&& b,
|
|
|
|
std::unique_ptr<CIntElement>&& c, std::unique_ptr<CRealElement>&& d);
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEConstant : public CVectorElement {
|
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
|
|
|
std::unique_ptr<CRealElement> xc_c;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVEConstant(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b, std::unique_ptr<CRealElement>&& c)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)), xc_c(std::move(c)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEFastConstant : public CVectorElement {
|
|
|
|
zeus::CVector3f x4_val;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVEFastConstant(float a, float b, float c) : x4_val(a, b, c) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
|
|
|
bool IsFastConstant() const override { return true; }
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVECircle : public CVectorElement {
|
|
|
|
std::unique_ptr<CVectorElement> x4_direction;
|
|
|
|
zeus::CVector3f x8_xVec;
|
|
|
|
zeus::CVector3f x14_yVec;
|
|
|
|
std::unique_ptr<CRealElement> x20_angleConstant;
|
|
|
|
std::unique_ptr<CRealElement> x24_angleLinear;
|
|
|
|
std::unique_ptr<CRealElement> x28_radius;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVECircle(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CVectorElement>&& b, std::unique_ptr<CRealElement>&& c,
|
|
|
|
std::unique_ptr<CRealElement>&& d, std::unique_ptr<CRealElement>&& e);
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEMultiply : public CVectorElement {
|
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
|
|
|
std::unique_ptr<CVectorElement> x8_b;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVEMultiply(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CVectorElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVERealToVector : public CVectorElement {
|
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVERealToVector(std::unique_ptr<CRealElement>&& a) : x4_a(std::move(a)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEPulse : public CVectorElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_aDuration;
|
|
|
|
std::unique_ptr<CIntElement> x8_bDuration;
|
|
|
|
std::unique_ptr<CVectorElement> xc_aVal;
|
|
|
|
std::unique_ptr<CVectorElement> x10_bVal;
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVEPulse(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CVectorElement>&& c,
|
|
|
|
std::unique_ptr<CVectorElement>&& d)
|
|
|
|
: x4_aDuration(std::move(a)), x8_bDuration(std::move(b)), xc_aVal(std::move(c)), x10_bVal(std::move(d)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEParticleVelocity : public CVectorElement {
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEParticleColor : public CVectorElement {
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEParticleLocation : public CVectorElement {
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEParticleSystemOrientationFront : public CVectorElement {
|
2016-02-12 06:06:17 +00:00
|
|
|
public:
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-12 06:06:17 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEParticleSystemOrientationUp : public CVectorElement {
|
2016-02-12 06:06:17 +00:00
|
|
|
public:
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-12 06:06:17 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEParticleSystemOrientationRight : public CVectorElement {
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEParticleSystemTranslation : public CVectorElement {
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVESubtract : public CVectorElement {
|
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
|
|
|
std::unique_ptr<CVectorElement> x8_b;
|
|
|
|
|
2016-02-12 06:06:17 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVESubtract(std::unique_ptr<CVectorElement>&& a, std::unique_ptr<CVectorElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-12 06:06:17 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVEColorToVector : public CVectorElement {
|
|
|
|
std::unique_ptr<CColorElement> x4_a;
|
|
|
|
|
2016-02-17 08:07:32 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CVEColorToVector(std::unique_ptr<CColorElement>&& a) : x4_a(std::move(a)) {}
|
2016-02-17 08:07:32 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
bool GetValue(int frame, zeus::CVector3f& valOut) const override;
|
2016-02-17 08:07:32 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|