From 8b02f897e6598ca8d0785b866a649a101836e919 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 4 Feb 2016 22:34:14 -1000 Subject: [PATCH] All MP1 element decls in --- Runtime/Particle/CColorElement.hpp | 42 ++++- Runtime/Particle/CEmitterElement.hpp | 17 +- Runtime/Particle/CIntElement.hpp | 102 ++++++++++- Runtime/Particle/CMakeLists.txt | 4 +- Runtime/Particle/CModVectorElement.hpp | 78 ++++++++- Runtime/Particle/CParticleGlobals.cpp | 16 ++ Runtime/Particle/CParticleGlobals.hpp | 40 +++++ Runtime/Particle/CRealElement.cpp | 109 ++++++++++++ Runtime/Particle/CRealElement.hpp | 234 ++++++++++++++++++++++++- Runtime/Particle/CUVElement.hpp | 27 ++- Runtime/Particle/CVectorElement.hpp | 110 +++++++++++- Runtime/Particle/IElement.hpp | 53 ++++++ 12 files changed, 824 insertions(+), 8 deletions(-) create mode 100644 Runtime/Particle/CParticleGlobals.cpp create mode 100644 Runtime/Particle/CParticleGlobals.hpp create mode 100644 Runtime/Particle/IElement.hpp diff --git a/Runtime/Particle/CColorElement.hpp b/Runtime/Particle/CColorElement.hpp index 62ed78416..50092a524 100644 --- a/Runtime/Particle/CColorElement.hpp +++ b/Runtime/Particle/CColorElement.hpp @@ -1,11 +1,51 @@ #ifndef __RETRO_CCOLORELEMENT_HPP__ #define __RETRO_CCOLORELEMENT_HPP__ +#include "IElement.hpp" + namespace Retro { -class CColorElement +class CCEKeyframeEmitter : public CColorElement { +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; +}; + +class CCEConstant : public CColorElement +{ +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; +}; + +class CCEFastConstant : public CColorElement +{ +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; +}; + +class CCETimeChain : public CColorElement +{ +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; +}; + +class CCEFadeEnd : public CColorElement +{ +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; +}; + +class CCEFade : public CColorElement +{ +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; +}; + +class CCEPulse : public CColorElement +{ +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; }; } diff --git a/Runtime/Particle/CEmitterElement.hpp b/Runtime/Particle/CEmitterElement.hpp index cd6c3df49..9db5f8442 100644 --- a/Runtime/Particle/CEmitterElement.hpp +++ b/Runtime/Particle/CEmitterElement.hpp @@ -1,13 +1,28 @@ #ifndef __RETRO_CEMITTERELEMENT_HPP__ #define __RETRO_CEMITTERELEMENT_HPP__ +#include "IElement.hpp" + namespace Retro { -class CEmitterElement +class CEmitterElement : public IElement { }; +class CEESimpleEmitter : public CEmitterElement +{ +}; + +class CVESphere : public CEmitterElement +{ +}; + +class CVEAngularSphere : public CEmitterElement +{ +}; + + } #endif // __RETRO_CEMITTERELEMENT_HPP__ diff --git a/Runtime/Particle/CIntElement.hpp b/Runtime/Particle/CIntElement.hpp index 4a882ba51..525de465c 100644 --- a/Runtime/Particle/CIntElement.hpp +++ b/Runtime/Particle/CIntElement.hpp @@ -1,11 +1,111 @@ #ifndef __RETRO_CINTELEMENT_HPP__ #define __RETRO_CINTELEMENT_HPP__ +#include "IElement.hpp" + namespace Retro { -class CIntElement +class CIEKeyframeEmitter : public CIntElement { +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEDeath : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEClamp : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIETimeChain : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEAdd : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEConstant : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEImpulse : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIELifetimePercent : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEInitialRandom : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEPulse : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEMultiply : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIESampleAndHold : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIERandom : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIETimeScale : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEGTCP : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIEModulo : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; +}; + +class CIESubtract : public CIntElement +{ +public: + bool GetValue(int frame, int& valOut) const; }; } diff --git a/Runtime/Particle/CMakeLists.txt b/Runtime/Particle/CMakeLists.txt index 51194ebcc..e300ea97f 100644 --- a/Runtime/Particle/CMakeLists.txt +++ b/Runtime/Particle/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(RuntimeCommonParticle + IElement.hpp CGenDescription.hpp CGenDescription.cpp CRealElement.hpp CRealElement.cpp CIntElement.hpp CIntElement.cpp @@ -19,4 +20,5 @@ add_library(RuntimeCommonParticle CParticleElectric.hpp CParticleElectric.cpp CDecalManager.hpp CDecalManager.cpp CSpawnSystemKeyframeData.hpp CSpawnSystemKeyframeData.cpp - CWarp.hpp CWarp.cpp) + CWarp.hpp CWarp.cpp + CParticleGlobals.hpp CParticleGlobals.cpp) diff --git a/Runtime/Particle/CModVectorElement.hpp b/Runtime/Particle/CModVectorElement.hpp index 68cd788f2..7ba31c507 100644 --- a/Runtime/Particle/CModVectorElement.hpp +++ b/Runtime/Particle/CModVectorElement.hpp @@ -1,11 +1,87 @@ #ifndef __RETRO_CMODVECTORELEMENT_HPP__ #define __RETRO_CMODVECTORELEMENT_HPP__ +#include "IElement.hpp" + namespace Retro { -class CModVectorElement +class CMVEImplosion : public CModVectorElement { +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEExponentialImplosion : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVETimeChain : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEBounce : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEConstant : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEFastConstant : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEGravity : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEExplode : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVESetPosition : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVELinearImplosion : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEPulse : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVEWind : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CMVESwirl : public CModVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; }; } diff --git a/Runtime/Particle/CParticleGlobals.cpp b/Runtime/Particle/CParticleGlobals.cpp new file mode 100644 index 000000000..9cff58fab --- /dev/null +++ b/Runtime/Particle/CParticleGlobals.cpp @@ -0,0 +1,16 @@ +#include "CParticleGlobals.hpp" + +namespace Retro +{ + +int CParticleGlobals::g_emitterTimeInt = 0; +float CParticleGlobals::g_emitterTimeFloat = 0.0; + +int CParticleGlobals::g_particleLifetimeInt = 0; +float CParticleGlobals::g_particleLifetimeFloat = 0.0; + +int CParticleGlobals::g_particleLifetimePercentTweenInt = 0; +float CParticleGlobals::g_particleLifetimePercentTweenFloat = 0.0; +float CParticleGlobals::g_particleLifetimePercentTweenIntFloatRem = 0.0; + +} diff --git a/Runtime/Particle/CParticleGlobals.hpp b/Runtime/Particle/CParticleGlobals.hpp new file mode 100644 index 000000000..6769887ed --- /dev/null +++ b/Runtime/Particle/CParticleGlobals.hpp @@ -0,0 +1,40 @@ +#ifndef __RETRO_CPARTICLEGLOBALS_HPP__ +#define __RETRO_CPARTICLEGLOBALS_HPP__ + +namespace Retro +{ + +class CParticleGlobals +{ +public: + static int g_emitterTimeInt; + static float g_emitterTimeFloat; + static void SetEmitterTime(int frame) + { + g_emitterTimeInt = frame; + g_emitterTimeFloat = frame; + } + + static int g_particleLifetimeInt; + static float g_particleLifetimeFloat; + static void SetParticleLifetime(int frame) + { + g_particleLifetimeInt = frame; + g_particleLifetimeFloat = frame; + } + + static int g_particleLifetimePercentTweenInt; + static float g_particleLifetimePercentTweenFloat; + static float g_particleLifetimePercentTweenIntFloatRem; + static void UpdateParticleLifetimeTweenValues(int frame) + { + float lt = g_particleLifetimeInt != 0.0f ? g_particleLifetimeInt : 1.0f; + g_particleLifetimePercentTweenFloat = 100.0f * frame / lt; + g_particleLifetimePercentTweenInt = g_particleLifetimePercentTweenFloat; + g_particleLifetimePercentTweenIntFloatRem = g_particleLifetimePercentTweenFloat - g_particleLifetimePercentTweenInt; + } +}; + +} + +#endif // __RETRO_CPARTICLEGLOBALS_HPP__ diff --git a/Runtime/Particle/CRealElement.cpp b/Runtime/Particle/CRealElement.cpp index e69de29bb..17db81fae 100644 --- a/Runtime/Particle/CRealElement.cpp +++ b/Runtime/Particle/CRealElement.cpp @@ -0,0 +1,109 @@ +#include "CRealElement.hpp" +#include "CParticleGlobals.hpp" + +namespace Retro +{ + +CREKeyframeEmitter::CREKeyframeEmitter(CInputStream& in) +{ + x4_percent = in.readUint32Big(); + x8_a = in.readUint32Big(); + xc_b = in.readBool(); + xd_c = in.readBool(); + x10_d = in.readUint32Big(); + x14_e = in.readUint32Big(); + + u32 count = in.readUint32Big(); + x18_keys.reserve(count); + for (u32 i=0 ; i= x10_d) + { + int v1 = emitterTime - x14_e; + int v2 = x10_d - x14_e; + calcKey = v1 / v2; + calcKey *= v2; + calcKey = v1 - calcKey; + calcKey += x14_e; + } + valOut = x18_keys[calcKey]; + } + else + { + int x10_d_m1 = x10_d - 1; + if (x10_d_m1 < calcKey) + calcKey = x10_d_m1; + valOut = x18_keys[calcKey]; + } + } + else + { + int ltPerc = CParticleGlobals::g_particleLifetimePercentTweenInt; + float ltPercRem = CParticleGlobals::g_particleLifetimePercentTweenIntFloatRem; + if (ltPerc == 100) + valOut = x18_keys[100]; + else + valOut = x18_keys[ltPerc+1] * ltPercRem + (1.0f - ltPercRem) * x18_keys[ltPerc]; + } + return false; +} + +bool CRELifetimeTween::GetValue(int frame, float& valOut) const +{ + float ltFac = frame / CParticleGlobals::g_particleLifetimeFloat; + float a, b; + x4_a->GetValue(frame, a); + x8_b->GetValue(frame, b); + valOut = b * ltFac + (1.0f - ltFac) * a; + return false; +} + +bool CREConstant::GetValue(int frame, float& valOut) const +{ + valOut = x4_val; + return false; +} + +bool CRETimeChain::GetValue(int frame, float& valOut) const +{ + int v; + xc_c->GetValue(frame, v); + if (frame >= v) + return x8_b->GetValue(frame, valOut); + else + return x4_a->GetValue(frame, valOut); +} + +bool CREAdd::GetValue(int frame, float& valOut) const +{ + float a, b; + x4_a->GetValue(frame, a); + x8_b->GetValue(frame, b); + valOut = a + b; + return false; +} + +bool CREClamp::GetValue(int frame, float &valOut) const +{ + float a, b; + x4_a->GetValue(frame, a); + x8_b->GetValue(frame, b); + xc_c->GetValue(frame, valOut); + if (valOut > b) + valOut = b; + if (valOut < a) + valOut = a; + return false; +} + +} diff --git a/Runtime/Particle/CRealElement.hpp b/Runtime/Particle/CRealElement.hpp index 6b5f3eab2..ff1fcba09 100644 --- a/Runtime/Particle/CRealElement.hpp +++ b/Runtime/Particle/CRealElement.hpp @@ -1,11 +1,243 @@ #ifndef __RETRO_CREALELEMENT_HPP__ #define __RETRO_CREALELEMENT_HPP__ +#include "IElement.hpp" + namespace Retro { -class CRealElement +class CRELifetimeTween : public CRealElement { + std::unique_ptr x4_a; + std::unique_ptr x8_b; +public: + CRELifetimeTween(CRealElement* a, CRealElement* b) + : x4_a(a), x8_b(b) {} + 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 x4_a; + std::unique_ptr x8_b; + std::unique_ptr xc_c; +public: + CRETimeChain(CRealElement* a, CRealElement* b, CIntElement* c) + : x4_a(a), x8_b(b), xc_c(c) {} + bool GetValue(int frame, float& valOut) const; +}; + +class CREAdd : public CRealElement +{ + std::unique_ptr x4_a; + std::unique_ptr x8_b; +public: + CREAdd(CRealElement* a, CRealElement* b) + : x4_a(a), x8_b(b) {} + bool GetValue(int frame, float& valOut) const; +}; + +class CREClamp : public CRealElement +{ + std::unique_ptr x4_a; + std::unique_ptr x8_b; + std::unique_ptr xc_c; +public: + CREClamp(CRealElement* a, CRealElement* b, CRealElement* c) + : x4_a(a), x8_b(b), xc_c(c) {} + bool GetValue(int frame, float& valOut) const; +}; + +class CREKeyframeEmitter : public CRealElement +{ + u32 x4_percent; + u32 x8_a; + bool xc_b; + bool xd_c; + u32 x10_d; + u32 x14_e; + std::vector x18_keys; +public: + CREKeyframeEmitter(CInputStream& in); + bool GetValue(int frame, float& valOut) const; +}; + +class CREInitialRandom : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; + bool IsConstant() const {return true;} +}; + +class CRERandom : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREMultiply : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREPulse : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CRETimeScale : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CRELifetimePercent : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CRESineWave : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREISWT : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CRECompareLessThan : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CRECompareEquals : public CRealElement +{ +public: + 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 CREPSLL : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREPRLW : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREPSOF : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CRESubtract : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREVectorMagnitude : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREVectorXToReal : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREVectorYToReal : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREVectorZToReal : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CRECEXT : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; +}; + +class CREITRL : public CRealElement +{ +public: + bool GetValue(int frame, float& valOut) const; }; } diff --git a/Runtime/Particle/CUVElement.hpp b/Runtime/Particle/CUVElement.hpp index 4b2e4dfe9..07b699934 100644 --- a/Runtime/Particle/CUVElement.hpp +++ b/Runtime/Particle/CUVElement.hpp @@ -1,11 +1,36 @@ #ifndef __RETRO_CUVELEMENT_HPP__ #define __RETRO_CUVELEMENT_HPP__ +#include "IElement.hpp" + namespace Retro { +class CToken; -class CUVElement +struct SUVElementSet { + float xMin, yMin, xMax, yMax; +}; + +class CUVElement : public IElement +{ +public: + virtual CToken GetValueTexture(int frame) const=0; + virtual void GetValueUV(int frame, SUVElementSet& valOut) const=0; +}; + +struct CUVEConstant : public CUVElement +{ +public: + CToken GetValueTexture(int frame) const; + void GetValueUV(int frame, SUVElementSet& valOut) const; +}; + +struct CUVEAnimTexture : public CUVElement +{ +public: + CToken GetValueTexture(int frame) const; + void GetValueUV(int frame, SUVElementSet& valOut) const; }; } diff --git a/Runtime/Particle/CVectorElement.hpp b/Runtime/Particle/CVectorElement.hpp index 3f7ad2589..5cbf3be76 100644 --- a/Runtime/Particle/CVectorElement.hpp +++ b/Runtime/Particle/CVectorElement.hpp @@ -1,11 +1,119 @@ #ifndef __RETRO_CVECTORELEMENT_HPP__ #define __RETRO_CVECTORELEMENT_HPP__ +#include "IElement.hpp" +#include "CVector3f.hpp" + namespace Retro { -class CVectorElement +class CVECone : public CVectorElement { +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVETimeChain : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEAngleCone : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEAdd : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVECircleCluster : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEConstant : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEFastConstant : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool IsFastConstant() const {return true;} +}; + +class CVECircle : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEKeyframeEmitter : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEMultiply : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVERealToVector : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEPulse : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEParticleVelocity : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVESPOS : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEPLCO : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEPLOC : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEPSOR : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEPSOF : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; }; } diff --git a/Runtime/Particle/IElement.hpp b/Runtime/Particle/IElement.hpp new file mode 100644 index 000000000..4eebf6e50 --- /dev/null +++ b/Runtime/Particle/IElement.hpp @@ -0,0 +1,53 @@ +#ifndef __RETRO_IELEMENT_HPP__ +#define __RETRO_IELEMENT_HPP__ + +#include +#include "GCNTypes.hpp" +#include "CVector3f.hpp" +#include "CColor.hpp" +#include "IOStreams.hpp" + +namespace Retro +{ + +class IElement +{ +public: + virtual ~IElement() = default; +}; + +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: + virtual bool GetValue(int frame, int& valOut) const=0; +}; + +class CVectorElement : public IElement +{ +public: + virtual bool GetValue(int frame, Zeus::CVector3f& valOut) const=0; + virtual bool IsFastConstant() const {return false;} +}; + +class CModVectorElement : public IElement +{ +public: + virtual bool GetValue(int frame, Zeus::CVector3f& vec1Out, Zeus::CVector3f& vec2Out) const=0; +}; + +class CColorElement : public IElement +{ +public: + virtual bool GetValue(int frame, Zeus::CColor& colorOut) const=0; +}; + +} + +#endif // __RETRO_IELEMENT_HPP__