2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-06-06 18:33:28 +00:00

Implement rest of elements

This commit is contained in:
Phillip Stephens 2016-02-13 23:38:01 -08:00
parent 43986b922b
commit 33f50789e4
5 changed files with 43 additions and 27 deletions

View File

@ -150,9 +150,9 @@ bool CCEPulse::GetValue(int frame, Zeus::CColor& valOut) const
return false; return false;
} }
bool CCEParticleColor::GetValue(int frame, Zeus::CColor& colorOut) const bool CCEParticleColor::GetValue(int /*frame*/, Zeus::CColor& colorOut) const
{ {
/* TODO: Do */ colorOut = CParticleGlobals::g_particleMetrics->x34_pcol;
return false; return false;
} }

View File

@ -139,9 +139,10 @@ bool CMVEBounce::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPo
return false; return false;
Zeus::CVector3f delta = pPos - pVel; Zeus::CVector3f delta = pPos - pVel;
pPos.x += ((-((((delta.z * ((delta.x * (delta.y * x18_g.y)) + ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x))) + x18_g.z) - x24_j)) / ((pVel.z * ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x)) + x18_g.z)) - ((x18_g.z * ((x18_g.x * (x18_g.y * pVel.y)) + pVel.x)) + pVel.z)) * pVel.x; pPos += Zeus::CVector3f{(-((((delta.z * ((delta.x * (delta.y * x18_g.y))
pPos.y += ((-((((delta.z * ((delta.x * (delta.y * x18_g.y)) + ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x))) + x18_g.z) - x24_j)) / ((pVel.z * ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x)) + x18_g.z)) - ((x18_g.z * ((x18_g.x * (x18_g.y * pVel.y)) + pVel.x)) + pVel.z)) * pVel.y; + ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x))) + x18_g.z) - x24_j)) /
pPos.z += ((-((((delta.z * ((delta.x * (delta.y * x18_g.y)) + ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x))) + x18_g.z) - x24_j)) / ((pVel.z * ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x)) + x18_g.z)) - ((x18_g.z * ((x18_g.x * (x18_g.y * pVel.y)) + pVel.x)) + pVel.z)) * pVel.z; ((pVel.z * ((pVel.x * (x18_g.y * pVel.y)) + x18_g.x)) + x18_g.z)) - (
(x18_g.z * ((x18_g.x * (x18_g.y * pVel.y)) + pVel.x)) + pVel.z)} * pVel;
float d = 0.0f; float d = 0.0f;
x10_d->GetValue(frame, d); x10_d->GetValue(frame, d);

View File

@ -15,5 +15,5 @@ float CParticleGlobals::g_ParticleLifetimePercentageRemainder = 0.0;
float* CParticleGlobals::g_papValues = nullptr; float* CParticleGlobals::g_papValues = nullptr;
CParticleGlobals::SParticleMetrics* CParticleGlobals::g_particleMetrics = nullptr; CParticleGlobals::SParticleMetrics* CParticleGlobals::g_particleMetrics = nullptr;
CParticleGlobals::SParticleSystem* CParticleGlobals::g_currentParticleSystem = nullptr;
} }

View File

@ -2,10 +2,12 @@
#define __PSHAG_CPARTICLEGLOBALS_HPP__ #define __PSHAG_CPARTICLEGLOBALS_HPP__
#include "CVector3f.hpp" #include "CVector3f.hpp"
#include "CColor.hpp"
#include "RetroTypes.hpp"
namespace pshag namespace pshag
{ {
class CParticleGen;
class CParticleGlobals class CParticleGlobals
{ {
public: public:
@ -45,8 +47,17 @@ public:
Zeus::CVector3f x1c_pvel; Zeus::CVector3f x1c_pvel;
float x2c_psll; float x2c_psll;
float x30_prlw; float x30_prlw;
Zeus::CColor x34_pcol;
}; };
struct SParticleSystem
{
FourCC x0_type;
CParticleGen* x4_system;
};
static SParticleMetrics* g_particleMetrics; static SParticleMetrics* g_particleMetrics;
static SParticleSystem* g_currentParticleSystem;
}; };
} }

View File

@ -1,6 +1,7 @@
#include "CVectorElement.hpp" #include "CVectorElement.hpp"
#include "CParticleGlobals.hpp" #include "CParticleGlobals.hpp"
#include "CRandom16.hpp" #include "CRandom16.hpp"
#include "CParticleGen.hpp"
#include <math.h> #include <math.h>
namespace pshag namespace pshag
@ -261,51 +262,54 @@ bool CVEPulse::GetValue(int frame, Zeus::CVector3f& valOut) const
return false; return false;
} }
bool CVEParticleVelocity::GetValue(int frame, Zeus::CVector3f& valOut) const bool CVEParticleVelocity::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const
{ {
/* TODO: Do */ valOut = CParticleGlobals::g_particleMetrics->x1c_pvel;
return false; return false;
} }
bool CVESPOS::GetValue(int frame, Zeus::CVector3f& valOut) const bool CVEPLCO::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const
{ {
/* TODO: Do */ valOut = CParticleGlobals::g_particleMetrics->x10_plco;
return false; return false;
} }
bool CVEPLCO::GetValue(int frame, Zeus::CVector3f& valOut) const bool CVEPLOC::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const
{ {
/* TODO: Do */ valOut = CParticleGlobals::g_particleMetrics->x0_ploc;
return false; return false;
} }
bool CVEPLOC::GetValue(int frame, Zeus::CVector3f& valOut) const bool CVEPSOF::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const
{ {
/* TODO: Do */ Zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation();
valOut.x = trans.m_basis[0][0];
valOut.y = trans.m_basis[1][1];
valOut.z = trans.m_basis[2][2];
return false; return false;
} }
bool CVEPSOF::GetValue(int frame, Zeus::CVector3f& valOut) const bool CVEPSOU::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const
{ {
/* TODO: Do */ Zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation();
valOut.x = trans.m_basis[0][0];
valOut.y = trans.m_basis[1][1];
valOut.z = trans.m_basis[2][2];
return false; return false;
} }
bool CVEPSOU::GetValue(int frame, Zeus::CVector3f& valOut) const bool CVEPSOR::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const
{ {
/* TODO: Do */ Zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation();
valOut.x = trans.m_basis[0][0];
valOut.y = trans.m_basis[1][1];
valOut.z = trans.m_basis[2][2];
return false; return false;
} }
bool CVEPSOR::GetValue(int frame, Zeus::CVector3f& valOut) const bool CVEPSTR::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const
{ {
/* TODO: Do */ valOut = CParticleGlobals::g_currentParticleSystem->x4_system->GetTranslation();
return false;
}
bool CVEPSTR::GetValue(int frame, Zeus::CVector3f& valOut) const
{
/* TODO: Do */
return false; return false;
} }