Fix VEAngleSphere element ordering & calculations

This commit is contained in:
Luke Street 2020-09-24 02:42:15 -04:00
parent 5bfdb4312f
commit d5596e6430
4 changed files with 7 additions and 7 deletions

View File

@ -1247,12 +1247,12 @@ struct VESphere : IEmitterElement {
struct VEAngleSphere : IEmitterElement { struct VEAngleSphere : IEmitterElement {
AT_DECL_DNA_YAMLV_NO_TYPE AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory sphereOrigin; VectorElementFactory sphereOrigin;
RealElementFactory sphereRadius;
RealElementFactory magnitude;
RealElementFactory angleXBias; RealElementFactory angleXBias;
RealElementFactory angleYBias; RealElementFactory angleYBias;
RealElementFactory angleXRange; RealElementFactory angleXRange;
RealElementFactory angleYRange; RealElementFactory angleYRange;
RealElementFactory sphereRadius;
RealElementFactory magnitude;
std::string_view ClassID() const override { return "ASPH"sv; } std::string_view ClassID() const override { return "ASPH"sv; }
}; };

View File

@ -56,8 +56,8 @@ bool CVEAngleSphere::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f&
x18_angleXRange->GetValue(frame, f); x18_angleXRange->GetValue(frame, f);
x1c_angleYRange->GetValue(frame, g); x1c_angleYRange->GetValue(frame, g);
CRandom16* rand = CRandom16::GetRandomNumber(); CRandom16* rand = CRandom16::GetRandomNumber();
d = zeus::degToRad(d + ((0.5f * (f * rand->Float())) - f)); d = zeus::degToRad(d + (0.5f * f - f * rand->Float()));
e = zeus::degToRad(e + ((0.5f * (g * rand->Float())) - g)); e = zeus::degToRad(e + (0.5f * g - g * rand->Float()));
float cosD = std::cos(d); float cosD = std::cos(d);
pPos.x() = a.x() + (b * (-std::sin(e) * cosD)); pPos.x() = a.x() + (b * (-std::sin(e) * cosD));

View File

@ -294,8 +294,8 @@ std::unique_ptr<CEmitterElement> CParticleDataFactory::GetEmitterElement(CInputS
auto e = GetRealElement(in); auto e = GetRealElement(in);
auto f = GetRealElement(in); auto f = GetRealElement(in);
auto g = GetRealElement(in); auto g = GetRealElement(in);
return std::make_unique<CVEAngleSphere>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e), return std::make_unique<CVEAngleSphere>(std::move(a), std::move(f), std::move(g), std::move(b), std::move(c),
std::move(f), std::move(g)); std::move(d), std::move(e));
} }
default: default:
break; break;

View File

@ -23,7 +23,7 @@ struct CParticle {
int x28_startFrame = 0; int x28_startFrame = 0;
float x2c_lineLengthOrSize = 0.f; float x2c_lineLengthOrSize = 0.f;
float x30_lineWidthOrRota = 0.f; float x30_lineWidthOrRota = 0.f;
zeus::CColor x34_color = {0.f, 0.f, 0.f, 1.f}; zeus::CColor x34_color = {1.f, 0.f, 1.f, 1.f};
}; };
class CParticleGen { class CParticleGen {