metaforce/DataSpec/DNAMP1/ScriptObjects/Water.hpp

164 lines
5.3 KiB
C++
Raw 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 {
AT_DECL_DNA_YAML
AT_DECL_DNAV
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;
2018-12-08 05:30:43 +00:00
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
if (patternMap1) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternMap1);
ent->name = name + "_patternMap1";
}
2018-12-08 05:30:43 +00:00
if (patternMap2) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternMap2);
ent->name = name + "_patternMap2";
2016-10-02 22:41:36 +00:00
}
2018-12-08 05:30:43 +00:00
if (colorMap) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(colorMap);
ent->name = name + "_colorMap";
2017-02-24 08:28:44 +00:00
}
2018-12-08 05:30:43 +00:00
if (bumpMap) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(bumpMap);
ent->name = name + "_bumpMap";
}
if (envMap) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(envMap);
ent->name = name + "_envMap";
}
if (envBumpMap) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(envBumpMap);
ent->name = name + "_envBumpMap";
}
if (lightmap) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(lightmap);
ent->name = name + "_lightmap";
}
if (splashParticle1) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle1);
ent->name = name + "_splashParticle1";
}
if (splashParticle2) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle2);
ent->name = name + "_splashParticle2";
}
if (splashParticle3) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle3);
ent->name = name + "_splashParticle3";
}
if (visorRunoffParticle) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(visorRunoffParticle);
ent->name = name + "_visorRunoffParticle";
}
if (unmorphVisorRunoffParticle) {
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 {
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
2018-12-08 05:30:43 +00:00
zeus::CAABox getVISIAABB(hecl::blender::Token& btok) const {
zeus::CVector3f halfExtent = zeus::CVector3f(volume) / 2.f;
zeus::CVector3f loc(location);
return zeus::CAABox(loc - halfExtent, loc + halfExtent);
}
};
} // namespace DataSpec::DNAMP1