metaforce/Runtime/Particle/CModVectorElement.hpp

161 lines
5.4 KiB
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CMODVECTORELEMENT_HPP__
#define __PSHAG_CMODVECTORELEMENT_HPP__
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#Mod_Vector_Elements */
2016-02-13 09:02:47 +00:00
namespace pshag
{
2016-02-05 08:34:14 +00:00
class CMVEImplosion : public CModVectorElement
{
2016-02-07 23:59:05 +00:00
std::unique_ptr<CVectorElement> x4_implPoint;
std::unique_ptr<CRealElement> x8_magScale;
std::unique_ptr<CRealElement> xc_maxMag;
std::unique_ptr<CRealElement> x10_minMag;
bool x14_enableMinMag;
2016-02-05 08:34:14 +00:00
public:
CMVEImplosion(CVectorElement* a, CRealElement* b, CRealElement* c, CRealElement* d, bool e)
2016-02-07 23:59:05 +00:00
: x4_implPoint(a), x8_magScale(b), xc_maxMag(c), x10_minMag(d), x14_enableMinMag(e) {}
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEExponentialImplosion : public CModVectorElement
{
2016-02-07 23:59:05 +00:00
std::unique_ptr<CVectorElement> x4_implPoint;
std::unique_ptr<CRealElement> x8_magScale;
std::unique_ptr<CRealElement> xc_maxMag;
std::unique_ptr<CRealElement> x10_minMag;
bool x14_enableMinMag;
2016-02-05 08:34:14 +00:00
public:
CMVEExponentialImplosion(CVectorElement* a, CRealElement* b, CRealElement* c, CRealElement* d, bool e)
2016-02-07 23:59:05 +00:00
: x4_implPoint(a), x8_magScale(b), xc_maxMag(c), x10_minMag(d), x14_enableMinMag(e) {}
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
};
class CMVELinearImplosion : public CModVectorElement
{
std::unique_ptr<CVectorElement> x4_implPoint;
std::unique_ptr<CRealElement> x8_magScale;
std::unique_ptr<CRealElement> xc_maxMag;
std::unique_ptr<CRealElement> x10_minMag;
bool x14_enableMinMag;
public:
CMVELinearImplosion(CVectorElement* a, CRealElement* b, CRealElement* c, CRealElement* d, bool e)
: x4_implPoint(a), x8_magScale(b), xc_maxMag(c), x10_minMag(d), x14_enableMinMag(e) {}
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVETimeChain : public CModVectorElement
{
std::unique_ptr<CModVectorElement> x4_a;
std::unique_ptr<CModVectorElement> x8_b;
2016-02-07 23:59:05 +00:00
std::unique_ptr<CIntElement> xc_swFrame;
2016-02-05 08:34:14 +00:00
public:
CMVETimeChain(CModVectorElement* a, CModVectorElement* b, CIntElement* c)
2016-02-07 23:59:05 +00:00
: x4_a(a), x8_b(b), xc_swFrame(c) {}
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEBounce : public CModVectorElement
{
2016-02-28 06:55:05 +00:00
std::unique_ptr<CVectorElement> x4_planePoint;
std::unique_ptr<CVectorElement> x8_planeNormal;
std::unique_ptr<CRealElement> xc_friction;
std::unique_ptr<CRealElement> x10_restitution;
bool x14_planePrecomputed;
bool x15_dieOnPenetrate;
Zeus::CVector3f x18_planeValidatedNormal;
float x24_planeD;
2016-02-05 08:34:14 +00:00
public:
2016-02-13 06:25:29 +00:00
CMVEBounce(CVectorElement* a, CVectorElement* b, CRealElement* c, CRealElement* d, bool e);
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEConstant : public CModVectorElement
{
2016-02-14 00:14:23 +00:00
std::unique_ptr<CRealElement> x4_x;
std::unique_ptr<CRealElement> x8_y;
std::unique_ptr<CRealElement> xc_z;
2016-02-05 08:34:14 +00:00
public:
CMVEConstant(CRealElement* a, CRealElement* b, CRealElement* c)
2016-02-14 00:14:23 +00:00
: x4_x(a), x8_y(b), xc_z(c) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEFastConstant : public CModVectorElement
{
Zeus::CVector3f x4_val;
2016-02-05 08:34:14 +00:00
public:
CMVEFastConstant(float a, float b, float c)
: x4_val(a, b, c) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEGravity : public CModVectorElement
{
std::unique_ptr<CVectorElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CMVEGravity(CVectorElement* a)
: x4_a(a) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEExplode : public CModVectorElement
{
std::unique_ptr<CRealElement> x4_a;
std::unique_ptr<CRealElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
CMVEExplode(CRealElement* a, CRealElement* b)
: x4_a(a), x8_b(b) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVESetPosition : public CModVectorElement
{
std::unique_ptr<CVectorElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
CMVESetPosition(CVectorElement* a)
: x4_a(a) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEPulse : public CModVectorElement
{
2016-02-14 00:14:23 +00:00
std::unique_ptr<CIntElement> x4_aDuration;
std::unique_ptr<CIntElement> x8_bDuration;
std::unique_ptr<CModVectorElement> xc_aVal;
std::unique_ptr<CModVectorElement> x10_bVal;
2016-02-05 08:34:14 +00:00
public:
CMVEPulse(CIntElement* a, CIntElement* b, CModVectorElement* c, CModVectorElement* d)
2016-02-14 00:14:23 +00:00
: x4_aDuration(a), x8_bDuration(b), xc_aVal(c), x10_bVal(d) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVEWind : public CModVectorElement
{
2016-02-14 00:14:23 +00:00
std::unique_ptr<CVectorElement> x4_direction;
std::unique_ptr<CRealElement> x8_speed;
2016-02-05 08:34:14 +00:00
public:
CMVEWind(CVectorElement* a, CRealElement* b)
2016-02-14 00:14:23 +00:00
: x4_direction(a), x8_speed(b) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
2016-02-05 08:34:14 +00:00
};
class CMVESwirl : public CModVectorElement
{
std::unique_ptr<CVectorElement> x4_a;
std::unique_ptr<CVectorElement> x8_b;
std::unique_ptr<CRealElement> xc_c;
std::unique_ptr<CRealElement> x10_d;
2016-02-05 08:34:14 +00:00
public:
CMVESwirl(CVectorElement* a, CVectorElement* b, CRealElement* c, CRealElement* d)
: x4_a(a), x8_b(b), xc_c(c), x10_d(d) {}
2016-02-07 23:59:05 +00:00
bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const;
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CMODVECTORELEMENT_HPP__