mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:07:42 +00:00
New code style refactor
This commit is contained in:
@@ -3,76 +3,71 @@
|
||||
|
||||
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Emitter_Elements */
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
|
||||
bool CEESimpleEmitter::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const
|
||||
{
|
||||
x4_loc->GetValue(frame, pPos);
|
||||
bool CEESimpleEmitter::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const {
|
||||
x4_loc->GetValue(frame, pPos);
|
||||
|
||||
if (x8_vec)
|
||||
x8_vec->GetValue(frame, pVel);
|
||||
else
|
||||
pVel = zeus::CVector3f();
|
||||
if (x8_vec)
|
||||
x8_vec->GetValue(frame, pVel);
|
||||
else
|
||||
pVel = zeus::CVector3f();
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CVESphere::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const
|
||||
{
|
||||
zeus::CVector3f a;
|
||||
x4_sphereOrigin->GetValue(frame, a);
|
||||
float b;
|
||||
x8_sphereRadius->GetValue(frame, b);
|
||||
CRandom16* rand = CRandom16::GetRandomNumber();
|
||||
int rand1 = rand->Range(-100, 100);
|
||||
int rand2 = rand->Range(-100, 100);
|
||||
int rand3 = rand->Range(-100, 100);
|
||||
bool CVESphere::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const {
|
||||
zeus::CVector3f a;
|
||||
x4_sphereOrigin->GetValue(frame, a);
|
||||
float b;
|
||||
x8_sphereRadius->GetValue(frame, b);
|
||||
CRandom16* rand = CRandom16::GetRandomNumber();
|
||||
int rand1 = rand->Range(-100, 100);
|
||||
int rand2 = rand->Range(-100, 100);
|
||||
int rand3 = rand->Range(-100, 100);
|
||||
|
||||
zeus::CVector3f normVec1 = zeus::CVector3f(0.0099999998f * float(rand3),
|
||||
0.0099999998f * float(rand2),
|
||||
0.0099999998f * float(rand1));
|
||||
if (normVec1.canBeNormalized())
|
||||
normVec1.normalize();
|
||||
zeus::CVector3f normVec1 =
|
||||
zeus::CVector3f(0.0099999998f * float(rand3), 0.0099999998f * float(rand2), 0.0099999998f * float(rand1));
|
||||
if (normVec1.canBeNormalized())
|
||||
normVec1.normalize();
|
||||
|
||||
pPos = b * normVec1 + a;
|
||||
pPos = b * normVec1 + a;
|
||||
|
||||
zeus::CVector3f normVec2 = (pPos - a);
|
||||
if (normVec2.canBeNormalized())
|
||||
normVec2.normalize();
|
||||
zeus::CVector3f normVec2 = (pPos - a);
|
||||
if (normVec2.canBeNormalized())
|
||||
normVec2.normalize();
|
||||
|
||||
float c;
|
||||
xc_velocityMag->GetValue(frame, c);
|
||||
pVel = c * normVec2;
|
||||
float c;
|
||||
xc_velocityMag->GetValue(frame, c);
|
||||
pVel = c * normVec2;
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CVEAngleSphere::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const
|
||||
{
|
||||
zeus::CVector3f a;
|
||||
x4_sphereOrigin->GetValue(frame, a);
|
||||
bool CVEAngleSphere::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const {
|
||||
zeus::CVector3f a;
|
||||
x4_sphereOrigin->GetValue(frame, a);
|
||||
|
||||
float b, d, e, f, g;
|
||||
x8_sphereRadius->GetValue(frame, b);
|
||||
x10_angleXBias->GetValue(frame, d);
|
||||
x14_angleYBias->GetValue(frame, e);
|
||||
x18_angleXRange->GetValue(frame, f);
|
||||
x1c_angleYRange->GetValue(frame, g);
|
||||
CRandom16* rand = CRandom16::GetRandomNumber();
|
||||
d = zeus::degToRad(d + ((0.5f * (f * rand->Float())) - f));
|
||||
e = zeus::degToRad(e + ((0.5f * (g * rand->Float())) - g));
|
||||
float b, d, e, f, g;
|
||||
x8_sphereRadius->GetValue(frame, b);
|
||||
x10_angleXBias->GetValue(frame, d);
|
||||
x14_angleYBias->GetValue(frame, e);
|
||||
x18_angleXRange->GetValue(frame, f);
|
||||
x1c_angleYRange->GetValue(frame, g);
|
||||
CRandom16* rand = CRandom16::GetRandomNumber();
|
||||
d = zeus::degToRad(d + ((0.5f * (f * rand->Float())) - f));
|
||||
e = zeus::degToRad(e + ((0.5f * (g * rand->Float())) - g));
|
||||
|
||||
float cosD = std::cos(d);
|
||||
pPos.x() = a.x() + (b * (-std::sin(e) * cosD));
|
||||
pPos.y() = a.y() + (b * std::sin(d));
|
||||
pPos.z() = a.z() + (b * (cosD * cosD));
|
||||
zeus::CVector3f normVec = (pPos - a).normalized();
|
||||
float cosD = std::cos(d);
|
||||
pPos.x() = a.x() + (b * (-std::sin(e) * cosD));
|
||||
pPos.y() = a.y() + (b * std::sin(d));
|
||||
pPos.z() = a.z() + (b * (cosD * cosD));
|
||||
zeus::CVector3f normVec = (pPos - a).normalized();
|
||||
|
||||
float c;
|
||||
xc_velocityMag->GetValue(frame, c);
|
||||
pVel = c * normVec;
|
||||
return false;
|
||||
float c;
|
||||
xc_velocityMag->GetValue(frame, c);
|
||||
pVel = c * normVec;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user