Remove fake destructor definitions

Former-commit-id: 8281bd5424
This commit is contained in:
Phillip Stephens 2022-10-18 20:51:49 -07:00
parent f768c693d0
commit 3281966a44
2 changed files with 99 additions and 26 deletions

View File

@ -11,9 +11,9 @@
class CVEFastConstant : public CVectorElement { class CVEFastConstant : public CVectorElement {
public: public:
CVEFastConstant(float x, float y, float z); CVEFastConstant(float x, float y, float z);
~CVEFastConstant(); ~CVEFastConstant() override;
bool GetValue(int frame, CVector3f& valOut) const override; bool GetValue(int frame, CVector3f& valOut) const override;
bool IsFastConstant() const; bool IsFastConstant() const override { return true; }
private: private:
CVector3f x4_val; CVector3f x4_val;
@ -21,43 +21,43 @@ private:
class CVEParticleLocation : public CVectorElement { class CVEParticleLocation : public CVectorElement {
public: public:
~CVEParticleLocation(); ~CVEParticleLocation() override {}
bool GetValue(int frame, CVector3f& valOut) const; bool GetValue(int frame, CVector3f& valOut) const;
}; };
class CVEParticleColor : public CVectorElement { class CVEParticleColor : public CVectorElement {
public: public:
~CVEParticleColor(); ~CVEParticleColor() override {}
bool GetValue(int frame, CVector3f& valOut) const; bool GetValue(int frame, CVector3f& valOut) const;
}; };
class CVEParticleVelocity : public CVectorElement { class CVEParticleVelocity : public CVectorElement {
public: public:
~CVEParticleVelocity(); ~CVEParticleVelocity() override {}
bool GetValue(int frame, CVector3f& valOut) const; bool GetValue(int frame, CVector3f& valOut) const;
}; };
class CVEParticleSystemOrientationFront : public CVectorElement { class CVEParticleSystemOrientationFront : public CVectorElement {
public: public:
~CVEParticleSystemOrientationFront(); ~CVEParticleSystemOrientationFront() override {}
bool GetValue(int frame, CVector3f& valOut) const override; bool GetValue(int frame, CVector3f& valOut) const override;
}; };
class CVEParticleSystemOrientationUp : public CVectorElement { class CVEParticleSystemOrientationUp : public CVectorElement {
public: public:
~CVEParticleSystemOrientationUp(); ~CVEParticleSystemOrientationUp() override {}
bool GetValue(int frame, CVector3f& valOut) const override; bool GetValue(int frame, CVector3f& valOut) const override;
}; };
class CVEParticleSystemOrientationRight : public CVectorElement { class CVEParticleSystemOrientationRight : public CVectorElement {
public: public:
~CVEParticleSystemOrientationRight(); ~CVEParticleSystemOrientationRight() override {}
bool GetValue(int frame, CVector3f& valOut) const override; bool GetValue(int frame, CVector3f& valOut) const override;
}; };
class CVEParticleSystemTranslation : public CVectorElement { class CVEParticleSystemTranslation : public CVectorElement {
public: public:
~CVEParticleSystemTranslation(); ~CVEParticleSystemTranslation() override {}
bool GetValue(int frame, CVector3f& valOut) const override; bool GetValue(int frame, CVector3f& valOut) const override;
}; };
@ -73,4 +73,30 @@ public:
CRealElement* xc_z; CRealElement* xc_z;
}; };
class CVECone : public CVectorElement {
CVectorElement* x4_direction;
CRealElement* x8_magnitude;
CVector3f xc_xVec;
CVector3f x18_yVec;
public:
CVECone(CVectorElement* direction, CRealElement* magnitude);
~CVECone();
bool GetValue(int frame, CVector3f& valOut) const override;
};
class CVEAngleCone : public CVectorElement {
CRealElement* x4_angleXConstant;
CRealElement* x8_angleYConstant;
CRealElement* xc_angleXRange;
CRealElement* x10_angleYRange;
CRealElement* x14_magnitude;
public:
CVEAngleCone(CRealElement* angleXConstant, CRealElement* angleYConstant,
CRealElement* angleXRange, CRealElement* angleYRange, CRealElement* magnitude);
~CVEAngleCone();
bool GetValue(int frame, CVector3f& valOut) const override;
};
#endif // _CVECTORELEMENT #endif // _CVECTORELEMENT

View File

@ -1,21 +1,9 @@
#include "Kyoto/Particles/CVectorElement.hpp" #include "Kyoto/Particles/CVectorElement.hpp"
bool CVEFastConstant::IsFastConstant() const { return true; } #include "Kyoto/CRandom16.hpp"
#include "Kyoto/Math/CMath.hpp"
CVEParticleLocation::~CVEParticleLocation() {}
CVEParticleColor::~CVEParticleColor() {}
CVEParticleVelocity::~CVEParticleVelocity() {}
CVEParticleSystemOrientationFront::~CVEParticleSystemOrientationFront() {}
CVEParticleSystemOrientationUp::~CVEParticleSystemOrientationUp() {}
CVEParticleSystemOrientationRight::~CVEParticleSystemOrientationRight() {}
CVEParticleSystemTranslation::~CVEParticleSystemTranslation() {}
#include "rstl/math.hpp"
CVEConstant::CVEConstant(CRealElement* x, CRealElement* y, CRealElement* z) CVEConstant::CVEConstant(CRealElement* x, CRealElement* y, CRealElement* z)
: x4_x(x), x8_y(y), xc_z(z) {} : x4_x(x), x8_y(y), xc_z(z) {}
@ -35,8 +23,7 @@ bool CVEConstant::GetValue(int frame, CVector3f& valOut) const {
return false; return false;
} }
CVEFastConstant::CVEFastConstant(float x, float y, float z) CVEFastConstant::CVEFastConstant(float x, float y, float z) : x4_val(x, y, z) {}
: x4_val(x, y, z) {}
CVEFastConstant::~CVEFastConstant() {} CVEFastConstant::~CVEFastConstant() {}
@ -44,3 +31,63 @@ bool CVEFastConstant::GetValue(int frame, CVector3f& valOut) const {
valOut = x4_val; valOut = x4_val;
return false; return false;
} }
CVECone::CVECone(CVectorElement* direction, CRealElement* magnitude)
: x4_direction(direction)
, x8_magnitude(magnitude)
, xc_xVec(CVector3f::Zero())
, x18_yVec(CVector3f::Zero()) {
CVector3f av(0.f, 0.f, 0.f);
x4_direction->GetValue(0, av);
CVector3f avNorm = av.AsNormalized();
if (avNorm.GetX() > 0.8f) {
xc_xVec = CVector3f::Cross(av, CVector3f(0.f, 1.f, 0.f));
} else {
xc_xVec = CVector3f::Cross(av, CVector3f(1.f, 0.f, 0.f));
}
x18_yVec = CVector3f::Cross(xc_xVec, avNorm);
}
CVECone::~CVECone() {
delete x4_direction;
delete x8_magnitude;
}
bool CVECone::GetValue(int frame, CVector3f& valOut) const {
float b;
CVector3f dir(0.f, 0.f, 0.f);
x8_magnitude->GetValue(frame, b);
x4_direction->GetValue(frame, dir);
float b2 = rstl::min_val(1.f, b);
float randX = 0.f, randY = 0.f;
do {
randX = 2.f * b2 * CRandom16::GetRandomNumber()->Float() - 0.5f;
randY = 2.f * b2 * CRandom16::GetRandomNumber()->Float() - 0.5f;
} while (randX * randX + randY * randY > 1.f);
valOut = xc_xVec * randX + x18_yVec * randY + dir;
return false;
}
CVEAngleCone::CVEAngleCone(CRealElement* angleXConstant, CRealElement* angleYConstant,
CRealElement* angleXRange, CRealElement* angleYRange,
CRealElement* magnitude)
: x4_angleXConstant(angleXConstant)
, x8_angleYConstant(angleYConstant)
, xc_angleXRange(angleXRange)
, x10_angleYRange(angleYRange)
, x14_magnitude(magnitude) {}
CVEAngleCone::~CVEAngleCone() {
delete x4_angleXConstant;
delete x8_angleYConstant;
delete xc_angleXRange;
delete x10_angleYRange;
delete x14_magnitude;
}
bool CVEAngleCone::GetValue(int frame, CVector3f& valOut) const {
return false;
}