2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 16:31:21 +00:00

Fix CRESineWave initialization

Resolves #470
This commit is contained in:
Luke Street 2025-04-16 11:14:09 -06:00
parent 17000766fe
commit f1ef7f5fd7
3 changed files with 8 additions and 7 deletions

View File

@ -507,10 +507,10 @@ std::unique_ptr<CRealElement> CParticleDataFactory::GetRealElement(CInputStream&
return std::make_unique<CRELifetimePercent>(std::move(a)); return std::make_unique<CRELifetimePercent>(std::move(a));
} }
case SBIG('SINE'): { case SBIG('SINE'): {
auto a = GetRealElement(in); auto frequency = GetRealElement(in);
auto b = GetRealElement(in); auto amplitude = GetRealElement(in);
auto c = GetRealElement(in); auto phase = GetRealElement(in);
return std::make_unique<CRESineWave>(std::move(a), std::move(b), std::move(c)); return std::make_unique<CRESineWave>(std::move(phase), std::move(frequency), std::move(amplitude));
} }
case SBIG('ISWT'): { case SBIG('ISWT'): {
auto a = GetRealElement(in); auto a = GetRealElement(in);

View File

@ -151,8 +151,9 @@ class CRESineWave : public CRealElement {
std::unique_ptr<CRealElement> xc_phase; std::unique_ptr<CRealElement> xc_phase;
public: public:
CRESineWave(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b, std::unique_ptr<CRealElement>&& c) CRESineWave(std::unique_ptr<CRealElement>&& phase, std::unique_ptr<CRealElement>&& frequency,
: x4_frequency(std::move(b)), x8_amplitude(std::move(c)), xc_phase(std::move(a)) {} std::unique_ptr<CRealElement>&& amplitude)
: x4_frequency(std::move(frequency)), x8_amplitude(std::move(amplitude)), xc_phase(std::move(phase)) {}
bool GetValue(int frame, float& valOut) const override; bool GetValue(int frame, float& valOut) const override;
}; };

View File

@ -57,7 +57,7 @@ bool CTargetableProjectile::Explode(const zeus::CVector3f& pos, const zeus::CVec
} }
void CTargetableProjectile::ResolveCollisionWithActor(const CRayCastResult& res, CActor& act, CStateManager& mgr) { void CTargetableProjectile::ResolveCollisionWithActor(const CRayCastResult& res, CActor& act, CStateManager& mgr) {
zeus::CTransform xf = zeus::lookAt(GetTranslation(), GetAimPosition(mgr, 0.1f)); zeus::CTransform xf = zeus::lookAt(GetTranslation(), GetAimPosition(mgr, 0.1f));
xf.origin = GetTranslation(); xf.origin = GetTranslation();
SetTransform(xf); SetTransform(xf);
CEnergyProjectile::ResolveCollisionWithActor(res, act, mgr); CEnergyProjectile::ResolveCollisionWithActor(res, act, mgr);