metaforce/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp

211 lines
6.6 KiB
C++
Raw Normal View History

2015-09-10 20:30:35 +00:00
#ifndef _DNAMP1_OCULUS_HPP_
#define _DNAMP1_OCULUS_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 Oculus : IScriptObject
{
2015-10-13 01:04:36 +00:00
Delete expl;
2015-09-10 20:30:35 +00:00
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
Value<atVec3f> scale;
PatternedInfo patternedInfo;
ActorParameters actorParameters;
Value<float> unknown1;
Value<float> unknown2;
Value<float> unknown3;
Value<float> unknown4;
Value<float> unknown5;
Value<float> unknown6;
DamageVulnerability damageVulnerabilty;
Value<float> unknown7;
DamageInfo damageInfo;
2015-10-13 01:04:36 +00:00
/* Trilogy addition */
Value<float> unknown8;
2016-03-04 23:04:53 +00:00
void read(athena::io::IStreamReader& __dna_reader)
2015-10-13 01:04:36 +00:00
{
IScriptObject::read(__dna_reader);
/* name */
name = __dna_reader.readString(-1);
/* location */
location = __dna_reader.readVec3fBig();
/* orientation */
orientation = __dna_reader.readVec3fBig();
/* scale */
scale = __dna_reader.readVec3fBig();
/* patternedInfo */
patternedInfo.read(__dna_reader);
/* actorParameters */
actorParameters.read(__dna_reader);
/* unknown1 */
unknown1 = __dna_reader.readFloatBig();
/* unknown2 */
unknown2 = __dna_reader.readFloatBig();
/* unknown3 */
unknown3 = __dna_reader.readFloatBig();
/* unknown4 */
unknown4 = __dna_reader.readFloatBig();
/* unknown5 */
unknown5 = __dna_reader.readFloatBig();
/* unknown6 */
unknown6 = __dna_reader.readFloatBig();
/* damageVulnerabilty */
damageVulnerabilty.read(__dna_reader);
/* unknown7 */
unknown7 = __dna_reader.readFloatBig();
/* damageInfo */
damageInfo.read(__dna_reader);
if (propertyCount == 16)
unknown8 = __dna_reader.readFloatBig();
else
unknown8 = 0.0;
}
2016-03-04 23:04:53 +00:00
void write(athena::io::IStreamWriter& __dna_writer) const
2015-10-13 01:04:36 +00:00
{
IScriptObject::write(__dna_writer);
/* name */
__dna_writer.writeString(name, -1);
/* location */
__dna_writer.writeVec3fBig(location);
/* orientation */
__dna_writer.writeVec3fBig(orientation);
/* scale */
__dna_writer.writeVec3fBig(scale);
/* patternedInfo */
patternedInfo.write(__dna_writer);
/* actorParameters */
actorParameters.write(__dna_writer);
/* unknown1 */
__dna_writer.writeFloatBig(unknown1);
/* unknown2 */
__dna_writer.writeFloatBig(unknown2);
/* unknown3 */
__dna_writer.writeFloatBig(unknown3);
/* unknown4 */
__dna_writer.writeFloatBig(unknown4);
/* unknown5 */
__dna_writer.writeFloatBig(unknown5);
/* unknown6 */
__dna_writer.writeFloatBig(unknown6);
/* damageVulnerabilty */
damageVulnerabilty.write(__dna_writer);
/* unknown7 */
__dna_writer.writeFloatBig(unknown7);
/* damageInfo */
damageInfo.write(__dna_writer);
if (propertyCount == 16)
__dna_writer.writeFloatBig(unknown8);
}
2016-03-04 23:04:53 +00:00
void read(athena::io::YAMLDocReader& __dna_docin)
2015-10-13 01:04:36 +00:00
{
2016-01-04 05:31:02 +00:00
IScriptObject::read(__dna_docin);
2015-10-13 01:04:36 +00:00
/* name */
name = __dna_docin.readString("name");
/* location */
location = __dna_docin.readVec3f("location");
/* orientation */
orientation = __dna_docin.readVec3f("orientation");
/* scale */
scale = __dna_docin.readVec3f("scale");
/* patternedInfo */
__dna_docin.enumerate("patternedInfo", patternedInfo);
/* actorParameters */
__dna_docin.enumerate("actorParameters", actorParameters);
/* unknown1 */
unknown1 = __dna_docin.readFloat("unknown1");
/* unknown2 */
unknown2 = __dna_docin.readFloat("unknown2");
/* unknown3 */
unknown3 = __dna_docin.readFloat("unknown3");
/* unknown4 */
unknown4 = __dna_docin.readFloat("unknown4");
/* unknown5 */
unknown5 = __dna_docin.readFloat("unknown5");
/* unknown6 */
unknown6 = __dna_docin.readFloat("unknown6");
/* damageVulnerabilty */
__dna_docin.enumerate("damageVulnerabilty", damageVulnerabilty);
/* unknown7 */
unknown7 = __dna_docin.readFloat("unknown7");
/* damageInfo */
__dna_docin.enumerate("damageInfo", damageInfo);
if (propertyCount == 16)
unknown8 = __dna_docin.readFloat("unknown8");
else
unknown8 = 0.0;
}
2016-03-04 23:04:53 +00:00
void write(athena::io::YAMLDocWriter& __dna_docout) const
2015-10-13 01:04:36 +00:00
{
2016-01-04 05:31:02 +00:00
IScriptObject::write(__dna_docout);
2015-10-13 01:04:36 +00:00
/* name */
__dna_docout.writeString("name", name);
/* location */
__dna_docout.writeVec3f("location", location);
/* orientation */
__dna_docout.writeVec3f("orientation", orientation);
/* scale */
__dna_docout.writeVec3f("scale", scale);
/* patternedInfo */
__dna_docout.enumerate("patternedInfo", patternedInfo);
/* actorParameters */
__dna_docout.enumerate("actorParameters", actorParameters);
/* unknown1 */
__dna_docout.writeFloat("unknown1", unknown1);
/* unknown2 */
__dna_docout.writeFloat("unknown2", unknown2);
/* unknown3 */
__dna_docout.writeFloat("unknown3", unknown3);
/* unknown4 */
__dna_docout.writeFloat("unknown4", unknown4);
/* unknown5 */
__dna_docout.writeFloat("unknown5", unknown5);
/* unknown6 */
__dna_docout.writeFloat("unknown6", unknown6);
/* damageVulnerabilty */
__dna_docout.enumerate("damageVulnerabilty", damageVulnerabilty);
/* unknown7 */
__dna_docout.writeFloat("unknown7", unknown7);
/* damageInfo */
__dna_docout.enumerate("damageInfo", damageInfo);
if (propertyCount == 16)
__dna_docout.writeFloat("unknown8", unknown8);
}
static const char* DNAType()
{
2016-03-04 23:04:53 +00:00
return "urde::DNAMP1::Oculus";
2015-10-13 01:04:36 +00:00
}
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter,
std::unordered_map<UniqueID32, std::pair<UniqueID32, UniqueID32>>& addTo) const
{
actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter));
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const
{
patternedInfo.nameIDs(pakRouter, name + "_patterned");
actorParameters.nameIDs(pakRouter, name + "_actp");
}
2015-09-10 20:30:35 +00:00
};
}
}
#endif