metaforce/DataSpec/DNACommon/ParticleCommon.hpp

815 lines
21 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-02-02 04:29:58 +00:00
#include <memory>
#include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <logvisor/logvisor.hpp>
2016-02-02 04:29:58 +00:00
2018-12-08 05:30:43 +00:00
namespace DataSpec::DNAParticle {
2016-03-04 23:04:53 +00:00
extern logvisor::Module LogModule;
2016-02-02 04:29:58 +00:00
2018-12-08 05:30:43 +00:00
struct IElement : BigDNAVYaml {
Delete _d;
~IElement() override = default;
2018-12-08 05:30:43 +00:00
virtual const char* ClassID() const = 0;
const char* DNATypeV() const override { return ClassID(); }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IRealElement : IElement {
Delete _d2;
};
struct RealElementFactory : BigDNA {
AT_DECL_EXPLICIT_DNA_YAML
std::unique_ptr<IRealElement> m_elem;
operator bool() const { return m_elem.operator bool(); }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IIntElement : IElement {
Delete _d2;
};
struct IntElementFactory : BigDNA {
AT_DECL_EXPLICIT_DNA_YAML
std::unique_ptr<IIntElement> m_elem;
operator bool() const { return m_elem.operator bool(); }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IVectorElement : IElement {
Delete _d2;
};
struct VectorElementFactory : BigDNA {
AT_DECL_EXPLICIT_DNA_YAML
std::unique_ptr<IVectorElement> m_elem;
operator bool() const { return m_elem.operator bool(); }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IColorElement : IElement {
Delete _d2;
};
struct ColorElementFactory : BigDNA {
AT_DECL_EXPLICIT_DNA_YAML
std::unique_ptr<IColorElement> m_elem;
operator bool() const { return m_elem.operator bool(); }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IModVectorElement : IElement {
Delete _d2;
};
struct ModVectorElementFactory : BigDNA {
AT_DECL_EXPLICIT_DNA_YAML
std::unique_ptr<IModVectorElement> m_elem;
operator bool() const { return m_elem.operator bool(); }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEmitterElement : IElement {
Delete _d2;
};
struct EmitterElementFactory : BigDNA {
AT_DECL_EXPLICIT_DNA_YAML
std::unique_ptr<IEmitterElement> m_elem;
operator bool() const { return m_elem.operator bool(); }
};
2018-12-08 05:30:43 +00:00
struct IUVElement : IElement {
Delete _d2;
virtual void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const = 0;
2016-10-02 22:41:36 +00:00
};
2016-02-02 08:22:01 +00:00
2018-12-08 05:30:43 +00:00
struct BoolHelper : IElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
bool value = false;
operator bool() const { return value; }
BoolHelper& operator=(bool val) {
value = val;
return *this;
}
const char* ClassID() const override { return "BoolHelper"; }
2016-03-02 22:37:10 +00:00
};
2018-12-08 05:30:43 +00:00
struct RELifetimeTween : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "LFTW"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REConstant : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
Value<float> val;
const char* ClassID() const override { return "CNST"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct RETimeChain : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
IntElementFactory thresholdFrame;
const char* ClassID() const override { return "CHAN"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REAdd : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "ADD_"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REClamp : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory min;
RealElementFactory max;
RealElementFactory val;
const char* ClassID() const override { return "CLMP"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REKeyframeEmitter : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
Value<atUint32> percentageTween;
Value<atUint32> unk1;
Value<bool> loop;
Value<atUint8> unk2;
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<float, AT_DNA_COUNT(count)> keys;
const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REInitialRandom : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "IRND"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct RERandom : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "RAND"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REMultiply : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "MULT"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REPulse : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory aDuration;
IntElementFactory bDuration;
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "PULS"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct RETimeScale : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory dv;
const char* ClassID() const override { return "SCAL"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct RELifetimePercent : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory percent;
const char* ClassID() const override { return "RLPT"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct RESineWave : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory frequency;
RealElementFactory amplitude;
RealElementFactory phase;
const char* ClassID() const override { return "SINE"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REInitialSwitch : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "ISWT"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct RECompareLessThan : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory ca;
RealElementFactory cb;
RealElementFactory pass;
RealElementFactory fail;
const char* ClassID() const override { return "CLTN"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct RECompareEquals : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory ca;
RealElementFactory cb;
RealElementFactory pass;
RealElementFactory fail;
const char* ClassID() const override { return "CEQL"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam1 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP1"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam2 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP2"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam3 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP3"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam4 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP4"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam5 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP5"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam6 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP6"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam7 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP7"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleAdvanceParam8 : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PAP8"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleSizeOrLineLength : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PSLL"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REParticleRotationOrLineWidth : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PRLW"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct RESubtract : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "SUB_"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct REVectorMagnitude : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory vec;
const char* ClassID() const override { return "VMAG"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REVectorXToReal : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory vec;
const char* ClassID() const override { return "VXTR"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REVectorYToReal : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory vec;
const char* ClassID() const override { return "VYTR"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REVectorZToReal : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory vec;
const char* ClassID() const override { return "VZTR"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct RECEXT : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory index;
const char* ClassID() const override { return "CEXT"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct REIntTimesReal : IRealElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "ITRL"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEKeyframeEmitter : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
Value<atUint32> percentageTween;
Value<atUint32> unk1;
Value<bool> loop;
Value<atUint8> unk2;
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<atUint32, AT_DNA_COUNT(count)> keys;
const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEDeath : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory passthrough;
IntElementFactory thresholdFrame;
const char* ClassID() const override { return "DETH"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEClamp : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory min;
IntElementFactory max;
IntElementFactory val;
const char* ClassID() const override { return "CLMP"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IETimeChain : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory a;
IntElementFactory b;
IntElementFactory thresholdFrame;
const char* ClassID() const override { return "CHAN"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEAdd : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory a;
IntElementFactory b;
const char* ClassID() const override { return "ADD_"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEConstant : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
Value<atUint32> val;
const char* ClassID() const override { return "CNST"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEImpulse : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory val;
const char* ClassID() const override { return "IMPL"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IELifetimePercent : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory percent;
const char* ClassID() const override { return "ILPT"; }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEInitialRandom : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory a;
IntElementFactory b;
const char* ClassID() const override { return "IRND"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEPulse : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory aDuration;
IntElementFactory bDuration;
IntElementFactory a;
IntElementFactory b;
const char* ClassID() const override { return "PULS"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEMultiply : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory a;
IntElementFactory b;
const char* ClassID() const override { return "MULT"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct IESampleAndHold : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory val;
IntElementFactory waitMin;
IntElementFactory waitMax;
const char* ClassID() const override { return "SPAH"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IERandom : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory a;
IntElementFactory b;
const char* ClassID() const override { return "RAND"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IETimeScale : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory dv;
const char* ClassID() const override { return "TSCL"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEGTCP : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "GTCP"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IEModulo : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory a;
IntElementFactory b;
const char* ClassID() const override { return "MODU"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct IESubtract : IIntElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory direction;
IntElementFactory baseRadius;
const char* ClassID() const override { return "SUB_"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct VECone : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory a;
RealElementFactory b;
const char* ClassID() const override { return "CONE"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct VETimeChain : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory a;
VectorElementFactory b;
IntElementFactory thresholdFrame;
const char* ClassID() const override { return "CHAN"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct VEAngleCone : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory angleXBias;
RealElementFactory angleYBias;
RealElementFactory angleXRange;
RealElementFactory angleYRange;
RealElementFactory magnitude;
const char* ClassID() const override { return "ANGC"; }
2016-02-02 08:22:01 +00:00
};
2018-12-08 05:30:43 +00:00
struct VEAdd : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory a;
VectorElementFactory b;
const char* ClassID() const override { return "ADD_"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct VECircleCluster : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory circleOffset;
VectorElementFactory circleNormal;
IntElementFactory cycleFrames;
RealElementFactory randomFactor;
const char* ClassID() const override { return "CCLU"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct VEConstant : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory comps[3];
const char* ClassID() const override { return "CNST"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct VECircle : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory circleOffset;
VectorElementFactory circleNormal;
RealElementFactory angleConstant;
RealElementFactory angleLinear;
RealElementFactory circleRadius;
const char* ClassID() const override { return "CIRC"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct VEKeyframeEmitter : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
Value<atUint32> percentageTween;
Value<atUint32> unk1;
Value<bool> loop;
Value<atUint8> unk2;
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<atVec3f, AT_DNA_COUNT(count)> keys;
const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct VEMultiply : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory a;
VectorElementFactory b;
const char* ClassID() const override { return "MULT"; }
2016-02-04 00:55:39 +00:00
};
2018-12-08 05:30:43 +00:00
struct VERealToVector : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory a;
const char* ClassID() const override { return "RTOV"; }
2018-12-08 05:30:43 +00:00
};
struct VEPulse : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory aDuration;
IntElementFactory bDuration;
VectorElementFactory a;
VectorElementFactory b;
const char* ClassID() const override { return "PULS"; }
2018-12-08 05:30:43 +00:00
};
struct VEParticleVelocity : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PVEL"; }
2018-12-08 05:30:43 +00:00
};
struct VESPOS : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory a;
const char* ClassID() const override { return "SPOS"; }
2018-12-08 05:30:43 +00:00
};
struct VEPLCO : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PLCO"; }
2018-12-08 05:30:43 +00:00
};
struct VEPLOC : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PLOC"; }
2018-12-08 05:30:43 +00:00
};
struct VEPSOR : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PSOR"; }
2018-12-08 05:30:43 +00:00
};
struct VEPSOF : IVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "PSOF"; }
2018-12-08 05:30:43 +00:00
};
struct CEKeyframeEmitter : IColorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
Value<atUint32> percentageTween;
Value<atUint32> unk1;
Value<bool> loop;
Value<atUint8> unk2;
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<atVec4f, AT_DNA_COUNT(count)> keys;
const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
2018-12-08 05:30:43 +00:00
};
struct CEConstant : IColorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory comps[4];
const char* ClassID() const override { return "CNST"; }
2018-12-08 05:30:43 +00:00
};
struct CETimeChain : IColorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
ColorElementFactory a;
ColorElementFactory b;
IntElementFactory thresholdFrame;
const char* ClassID() const override { return "CHAN"; }
2018-12-08 05:30:43 +00:00
};
struct CEFadeEnd : IColorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
ColorElementFactory a;
ColorElementFactory b;
RealElementFactory startFrame;
RealElementFactory endFrame;
const char* ClassID() const override { return "CFDE"; }
2018-12-08 05:30:43 +00:00
};
struct CEFade : IColorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
ColorElementFactory a;
ColorElementFactory b;
RealElementFactory endFrame;
const char* ClassID() const override { return "FADE"; }
2018-12-08 05:30:43 +00:00
};
struct CEPulse : IColorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory aDuration;
IntElementFactory bDuration;
ColorElementFactory a;
ColorElementFactory b;
const char* ClassID() const override { return "PULS"; }
2018-12-08 05:30:43 +00:00
};
struct MVEImplosion : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory implodePoint;
RealElementFactory velocityScale;
RealElementFactory maxRadius;
RealElementFactory minRadius;
BoolHelper enableMinRadius;
const char* ClassID() const override { return "IMPL"; }
2018-12-08 05:30:43 +00:00
};
struct MVEExponentialImplosion : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory implodePoint;
RealElementFactory velocityScale;
RealElementFactory maxRadius;
RealElementFactory minRadius;
BoolHelper enableMinRadius;
const char* ClassID() const override { return "EMPL"; }
2018-12-08 05:30:43 +00:00
};
struct MVETimeChain : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
ModVectorElementFactory a;
ModVectorElementFactory b;
IntElementFactory thresholdFrame;
const char* ClassID() const override { return "CHAN"; }
2018-12-08 05:30:43 +00:00
};
struct MVEBounce : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory planePoint;
VectorElementFactory planeNormal;
RealElementFactory friction;
RealElementFactory restitution;
BoolHelper dieOnPenetrate;
const char* ClassID() const override { return "BNCE"; }
2018-12-08 05:30:43 +00:00
};
struct MVEConstant : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory comps[3];
const char* ClassID() const override { return "CNST"; }
2018-12-08 05:30:43 +00:00
};
struct MVEGravity : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory acceleration;
2019-08-11 00:49:41 +00:00
const char* ClassID() const override { return "GRAV"; }
2018-12-08 05:30:43 +00:00
};
struct MVEExplode : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
RealElementFactory impulseMagnitude;
RealElementFactory falloffFactor;
const char* ClassID() const override { return "EXPL"; }
2018-12-08 05:30:43 +00:00
};
struct MVESetPosition : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory position;
const char* ClassID() const override { return "SPOS"; }
2018-12-08 05:30:43 +00:00
};
struct MVELinearImplosion : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory implodePoint;
RealElementFactory velocityScale;
RealElementFactory maxRadius;
RealElementFactory minRadius;
BoolHelper enableMinRadius;
const char* ClassID() const override { return "LMPL"; }
2018-12-08 05:30:43 +00:00
};
struct MVEPulse : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
IntElementFactory aDuration;
IntElementFactory bDuration;
ModVectorElementFactory a;
ModVectorElementFactory b;
const char* ClassID() const override { return "PULS"; }
2018-12-08 05:30:43 +00:00
};
struct MVEWind : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory windVelocity;
RealElementFactory factor;
const char* ClassID() const override { return "WIND"; }
2018-12-08 05:30:43 +00:00
};
struct MVESwirl : IModVectorElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory helixPoint;
VectorElementFactory curveBinormal;
RealElementFactory filterGain;
RealElementFactory tangentialVelocity;
const char* ClassID() const override { return "SWRL"; }
2018-12-08 05:30:43 +00:00
};
struct EESimpleEmitter : IEmitterElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory position;
VectorElementFactory velocity;
const char* ClassID() const override { return "SEMR"; }
2018-12-08 05:30:43 +00:00
};
struct VESphere : IEmitterElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory sphereOrigin;
RealElementFactory sphereRadius;
RealElementFactory magnitude;
const char* ClassID() const override { return "SPHE"; }
2018-12-08 05:30:43 +00:00
};
struct VEAngleSphere : IEmitterElement {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
VectorElementFactory sphereOrigin;
RealElementFactory sphereRadius;
RealElementFactory magnitude;
RealElementFactory angleXBias;
RealElementFactory angleYBias;
RealElementFactory angleXRange;
RealElementFactory angleYRange;
const char* ClassID() const override { return "ASPH"; }
2018-12-08 05:30:43 +00:00
};
struct EESimpleEmitterTR : EESimpleEmitter {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
const char* ClassID() const override { return "SETR"; }
};
2016-02-02 08:22:01 +00:00
template <class IDType>
2018-12-08 05:30:43 +00:00
struct UVEConstant : IUVElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
AT_SUBDECL_DNA
CastIDToZero<IDType> tex;
const char* ClassID() const override { return "CNST"; }
2016-10-02 22:41:36 +00:00
2019-08-11 00:49:41 +00:00
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const override {
2018-12-08 05:30:43 +00:00
g_curSpec->flattenDependencies(tex, pathsOut);
}
2016-02-02 08:22:01 +00:00
};
template <class IDType>
2018-12-08 05:30:43 +00:00
struct UVEAnimTexture : IUVElement {
2019-08-11 00:49:41 +00:00
AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
2018-12-08 05:30:43 +00:00
AT_SUBDECL_DNA
CastIDToZero<IDType> tex;
IntElementFactory tileW;
IntElementFactory tileH;
IntElementFactory strideW;
IntElementFactory strideH;
IntElementFactory cycleFrames;
Value<bool> loop = false;
const char* ClassID() const override { return "ATEX"; }
2018-12-08 05:30:43 +00:00
2019-08-11 00:49:41 +00:00
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const override {
2018-12-08 05:30:43 +00:00
g_curSpec->flattenDependencies(tex, pathsOut);
}
2016-02-02 08:22:01 +00:00
};
template <class IDType>
2018-12-08 05:30:43 +00:00
struct UVElementFactory : BigDNA {
AT_DECL_EXPLICIT_DNA_YAML
AT_SUBDECL_DNA
DNAFourCC m_type;
std::unique_ptr<IUVElement> m_elem;
operator bool() const { return m_elem.operator bool(); }
2016-02-02 08:22:01 +00:00
};
2016-02-02 04:29:58 +00:00
template <class IDType>
2018-12-08 05:30:43 +00:00
struct SpawnSystemKeyframeData : BigDNA {
Value<atUint32> a;
Value<atUint32> b;
Value<atUint32> endFrame;
Value<atUint32> d;
struct SpawnSystemKeyframeInfo : BigDNA {
IDType id;
Value<atUint32> a;
Value<atUint32> b;
2018-12-08 05:30:43 +00:00
Value<atUint32> c;
AT_DECL_EXPLICIT_DNA_YAML
};
2018-12-08 05:30:43 +00:00
std::vector<std::pair<atUint32, std::vector<SpawnSystemKeyframeInfo>>> spawns;
2018-12-08 05:30:43 +00:00
AT_DECL_EXPLICIT_DNA_YAML
AT_SUBDECL_DNA
2016-02-04 00:55:39 +00:00
2018-12-08 05:30:43 +00:00
operator bool() const { return spawns.size() != 0; }
2016-10-02 22:41:36 +00:00
2018-12-08 05:30:43 +00:00
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const {
for (const auto& p : spawns)
for (const SpawnSystemKeyframeInfo& info : p.second)
g_curSpec->flattenDependencies(info.id, pathsOut);
}
};
template <class IDType>
2018-12-08 05:30:43 +00:00
struct ChildResourceFactory : BigDNA {
IDType id;
AT_DECL_EXPLICIT_DNA_YAML
AT_SUBDECL_DNA
2019-07-20 04:27:21 +00:00
operator bool() const { return id.isValid(); }
2016-02-02 04:29:58 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace DataSpec::DNAParticle