metaforce/DataSpec/DNAMP1/ScriptObjects/Water.hpp

164 lines
5.5 KiB
C++
Raw Permalink Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-09-10 20:30:35 +00:00
#include "../../DNACommon/DNACommon.hpp"
#include "IScriptObject.hpp"
#include "Parameters.hpp"
2018-12-08 05:30:43 +00:00
namespace DataSpec::DNAMP1 {
struct Water : IScriptObject {
2019-08-11 00:49:41 +00:00
AT_DECL_DNA_YAMLV
2018-12-08 05:30:43 +00:00
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> volume;
DamageInfo damageInfo;
Value<atVec3f> orientedForce;
Value<atUint32> triggerFlags;
Value<bool> thermalCold;
Value<bool> displaySurface;
UniqueID32 patternMap1;
UniqueID32 patternMap2;
UniqueID32 colorMap;
UniqueID32 bumpMap;
UniqueID32 envMap;
UniqueID32 envBumpMap;
Value<atVec3f> bumpLightDir;
Value<float> bumpScale;
Value<float> morphInTime;
Value<float> morphOutTime;
Value<bool> active;
Value<atUint32> fluidType;
Value<bool> unknownBool;
Value<float> alpha;
struct FluidUVMotion : BigDNA {
AT_DECL_DNA
struct FluidLayerMotion : BigDNA {
AT_DECL_DNA
Value<atUint32> motionType;
Value<float> timeToWrap;
Value<float> orientation;
Value<float> magnitude;
Value<float> uvMul;
};
2016-04-20 05:44:08 +00:00
2018-12-08 05:30:43 +00:00
FluidLayerMotion pattern1Layer;
FluidLayerMotion pattern2Layer;
FluidLayerMotion colorLayer;
Value<float> timeToWrap;
Value<float> orientation;
} fluidUVMotion;
2015-09-10 20:30:35 +00:00
2018-12-08 05:30:43 +00:00
Value<float> turbulenceSpeed;
Value<float> turbulenceDistance;
Value<float> turbulenceFrequencyMax;
Value<float> turbulenceFrequencyMin;
Value<float> turbulencePhaseMax;
Value<float> turbulencePhaseMin;
Value<float> turbulenceAmplitudeMax;
Value<float> turbulenceAmplitudeMin;
Value<atVec4f> splashColor;
Value<atVec4f> insideFogColor;
UniqueID32 splashParticle1;
UniqueID32 splashParticle2;
UniqueID32 splashParticle3;
UniqueID32 visorRunoffParticle;
UniqueID32 unmorphVisorRunoffParticle;
Value<atUint32> visorRunoffSfx;
Value<atUint32> unmorphVisorRunoffSfx;
Value<atUint32> splashSfx1;
Value<atUint32> splashSfx2;
Value<atUint32> splashSfx3;
Value<float> tileSize;
Value<atUint32> tileSubdivisions;
Value<float> specularMin;
Value<float> specularMax;
Value<float> reflectionSize;
Value<float> rippleIntensity;
Value<float> reflectionBlend;
Value<float> fogBias;
Value<float> fogMagnitude;
Value<float> fogSpeed;
Value<atVec4f> fogColor;
UniqueID32 lightmap;
Value<float> unitsPerLightmapTexel;
Value<float> alphaInTime;
Value<float> alphaOutTime;
Value<atUint32> unusedInt1;
Value<atUint32> unusedInt2;
2017-08-13 07:56:35 +00:00
2018-12-08 05:30:43 +00:00
struct UnusedBitset : BigDNA{AT_DECL_EXPLICIT_DNA} unusedBitset;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
2019-07-20 04:27:21 +00:00
if (patternMap1.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternMap1);
ent->name = name + "_patternMap1";
}
2019-07-20 04:27:21 +00:00
if (patternMap2.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternMap2);
ent->name = name + "_patternMap2";
2016-10-02 22:41:36 +00:00
}
2019-07-20 04:27:21 +00:00
if (colorMap.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(colorMap);
ent->name = name + "_colorMap";
2017-02-24 08:28:44 +00:00
}
2019-07-20 04:27:21 +00:00
if (bumpMap.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(bumpMap);
ent->name = name + "_bumpMap";
}
2019-07-20 04:27:21 +00:00
if (envMap.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(envMap);
ent->name = name + "_envMap";
}
2019-07-20 04:27:21 +00:00
if (envBumpMap.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(envBumpMap);
ent->name = name + "_envBumpMap";
}
2019-07-20 04:27:21 +00:00
if (lightmap.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(lightmap);
ent->name = name + "_lightmap";
}
2019-07-20 04:27:21 +00:00
if (splashParticle1.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle1);
ent->name = name + "_splashParticle1";
}
2019-07-20 04:27:21 +00:00
if (splashParticle2.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle2);
ent->name = name + "_splashParticle2";
}
2019-07-20 04:27:21 +00:00
if (splashParticle3.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle3);
ent->name = name + "_splashParticle3";
}
2019-07-20 04:27:21 +00:00
if (visorRunoffParticle.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(visorRunoffParticle);
ent->name = name + "_visorRunoffParticle";
}
2019-07-20 04:27:21 +00:00
if (unmorphVisorRunoffParticle.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unmorphVisorRunoffParticle);
ent->name = name + "_unmorphVisorRunoffParticle";
}
}
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
2018-12-08 05:30:43 +00:00
g_curSpec->flattenDependencies(patternMap1, pathsOut);
g_curSpec->flattenDependencies(patternMap2, pathsOut);
g_curSpec->flattenDependencies(colorMap, pathsOut);
g_curSpec->flattenDependencies(bumpMap, pathsOut);
g_curSpec->flattenDependencies(envMap, pathsOut);
g_curSpec->flattenDependencies(envBumpMap, pathsOut);
g_curSpec->flattenDependencies(lightmap, pathsOut);
g_curSpec->flattenDependencies(splashParticle1, pathsOut);
g_curSpec->flattenDependencies(splashParticle2, pathsOut);
g_curSpec->flattenDependencies(splashParticle3, pathsOut);
g_curSpec->flattenDependencies(visorRunoffParticle, pathsOut);
g_curSpec->flattenDependencies(unmorphVisorRunoffParticle, pathsOut);
}
2015-09-10 20:30:35 +00:00
zeus::CAABox getVISIAABB(hecl::blender::Token& btok) const override {
2018-12-08 05:30:43 +00:00
zeus::CVector3f halfExtent = zeus::CVector3f(volume) / 2.f;
zeus::CVector3f loc(location);
return zeus::CAABox(loc - halfExtent, loc + halfExtent);
}
};
} // namespace DataSpec::DNAMP1