2015-09-10 20:30:35 +00:00
|
|
|
#ifndef _DNAMP1_WATER_HPP_
|
|
|
|
#define _DNAMP1_WATER_HPP_
|
|
|
|
|
|
|
|
#include "../../DNACommon/DNACommon.hpp"
|
|
|
|
#include "IScriptObject.hpp"
|
|
|
|
#include "Parameters.hpp"
|
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
namespace DataSpec
|
2015-09-10 20:30:35 +00:00
|
|
|
{
|
|
|
|
namespace DNAMP1
|
|
|
|
{
|
|
|
|
struct Water : IScriptObject
|
|
|
|
{
|
|
|
|
DECL_YAML
|
|
|
|
String<-1> name;
|
|
|
|
Value<atVec3f> location;
|
|
|
|
Value<atVec3f> volume;
|
|
|
|
DamageInfo damageInfo;
|
2017-08-13 07:56:35 +00:00
|
|
|
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;
|
2015-09-10 20:30:35 +00:00
|
|
|
struct FluidUVMotion : BigYAML
|
|
|
|
{
|
|
|
|
DECL_YAML
|
2016-04-20 05:44:08 +00:00
|
|
|
struct FluidLayerMotion : BigYAML
|
|
|
|
{
|
|
|
|
DECL_YAML
|
2017-08-13 07:56:35 +00:00
|
|
|
Value<atUint32> motionType;
|
|
|
|
Value<float> timeToWrap;
|
|
|
|
Value<float> orientation;
|
|
|
|
Value<float> magnitude;
|
|
|
|
Value<float> uvMul;
|
2016-04-20 05:44:08 +00:00
|
|
|
};
|
|
|
|
|
2017-08-13 07:56:35 +00:00
|
|
|
FluidLayerMotion pattern1Layer;
|
|
|
|
FluidLayerMotion pattern2Layer;
|
|
|
|
FluidLayerMotion colorLayer;
|
|
|
|
Value<float> timeToWrap;
|
|
|
|
Value<float> orientation;
|
2015-09-10 20:30:35 +00:00
|
|
|
} fluidUVMotion;
|
|
|
|
|
2017-08-13 07:56:35 +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> unkColor;
|
|
|
|
UniqueID32 splashParticle1;
|
|
|
|
UniqueID32 splashParticle2;
|
|
|
|
UniqueID32 splashParticle3;
|
2017-08-16 05:34:02 +00:00
|
|
|
UniqueID32 visorRunoffParticle;
|
|
|
|
UniqueID32 unmorphVisorRunoffParticle;
|
2017-08-13 07:56:35 +00:00
|
|
|
Value<atUint32> visorRunoffSfx;
|
2017-08-16 05:34:02 +00:00
|
|
|
Value<atUint32> unmorphVisorRunoffSfx;
|
2017-08-13 07:56:35 +00:00
|
|
|
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;
|
2017-08-14 03:55:06 +00:00
|
|
|
Value<atVec4f> fogColor;
|
2017-08-13 07:56:35 +00:00
|
|
|
UniqueID32 lightmap;
|
|
|
|
Value<float> unitsPerLightmapTexel;
|
|
|
|
Value<float> alphaInTime;
|
|
|
|
Value<float> alphaOutTime;
|
|
|
|
Value<atUint32> unusedInt1;
|
|
|
|
Value<atUint32> unusedInt2;
|
|
|
|
|
|
|
|
struct UnusedBitset : BigYAML
|
|
|
|
{
|
|
|
|
Delete _d;
|
|
|
|
void read(athena::io::IStreamReader& in)
|
|
|
|
{
|
|
|
|
if (in.readBool())
|
|
|
|
{
|
|
|
|
atUint32 bitVal0 = in.readUint16Big();
|
|
|
|
atUint32 bitVal1 = in.readUint16Big();
|
|
|
|
atUint32 len = ((bitVal0 * bitVal1) + 31) / 31;
|
|
|
|
in.seek(len * 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void write(athena::io::IStreamWriter& out) const { out.writeBool(false); }
|
|
|
|
void read(athena::io::YAMLDocReader& reader) {}
|
|
|
|
void write(athena::io::YAMLDocWriter& writer) const {}
|
|
|
|
size_t binarySize(size_t __isz) const { return __isz + 1; }
|
|
|
|
} unusedBitset;
|
2015-10-27 00:19:03 +00:00
|
|
|
|
|
|
|
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const
|
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
if (patternMap1)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternMap1);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_patternMap1";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (patternMap2)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternMap2);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_patternMap2";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (colorMap)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(colorMap);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_colorMap";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (bumpMap)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(bumpMap);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_bumpMap";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (envMap)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(envMap);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_envMap";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (envBumpMap)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(envBumpMap);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_envBumpMap";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (lightmap)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(lightmap);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_lightmap";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (splashParticle1)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle1);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_splashParticle1";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (splashParticle2)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle2);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_splashParticle2";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-13 07:56:35 +00:00
|
|
|
if (splashParticle3)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-13 07:56:35 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(splashParticle3);
|
2017-08-14 03:55:06 +00:00
|
|
|
ent->name = name + "_splashParticle3";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-16 05:34:02 +00:00
|
|
|
if (visorRunoffParticle)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-16 05:34:02 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(visorRunoffParticle);
|
|
|
|
ent->name = name + "_visorRunoffParticle";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
2017-08-16 05:34:02 +00:00
|
|
|
if (unmorphVisorRunoffParticle)
|
2015-10-27 00:19:03 +00:00
|
|
|
{
|
2017-08-16 05:34:02 +00:00
|
|
|
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unmorphVisorRunoffParticle);
|
|
|
|
ent->name = name + "_unmorphVisorRunoffParticle";
|
2015-10-27 00:19:03 +00:00
|
|
|
}
|
|
|
|
}
|
2016-10-02 22:41:36 +00:00
|
|
|
|
|
|
|
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const
|
|
|
|
{
|
2017-08-13 07:56:35 +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);
|
2017-08-16 05:34:02 +00:00
|
|
|
g_curSpec->flattenDependencies(visorRunoffParticle, pathsOut);
|
|
|
|
g_curSpec->flattenDependencies(unmorphVisorRunoffParticle, pathsOut);
|
2016-10-02 22:41:36 +00:00
|
|
|
}
|
2017-02-24 08:28:44 +00:00
|
|
|
|
|
|
|
zeus::CAABox getVISIAABB(hecl::BlenderToken& btok) const
|
|
|
|
{
|
|
|
|
zeus::CVector3f halfExtent = zeus::CVector3f(volume) / 2.f;
|
|
|
|
zeus::CVector3f loc(location);
|
|
|
|
return zeus::CAABox(loc - halfExtent, loc + halfExtent);
|
|
|
|
}
|
2015-09-10 20:30:35 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|