XPlor/libs/xassets/xgfxworldvertex.cpp

48 lines
1.5 KiB
C++
Raw Normal View History

2025-08-17 13:14:17 -04:00
#include "xgfxworldvertex.h"
XGfxWorldVertex::XGfxWorldVertex()
2025-09-05 18:35:17 -04:00
: XAsset()
, mXYZ()
, mBinormalSign(0.0f)
, mColor()
, mTexCoord()
, mLmapCoord()
, mNormal()
, mTangent()
{
2025-09-10 21:58:26 -04:00
SetName("GFX World Vertex");
2025-09-05 18:35:17 -04:00
}
XGfxWorldVertex::~XGfxWorldVertex()
{
2025-08-17 13:14:17 -04:00
}
2025-09-10 21:58:26 -04:00
void XGfxWorldVertex::ParseData(XDataStream *aStream) {
2025-08-17 13:14:17 -04:00
if (GetPtr() == -1) {
2025-09-10 21:58:26 -04:00
mXYZ.setX(aStream->ParseSingle(QString("%1 xyz x").arg(GetName())));
mXYZ.setY(aStream->ParseSingle(QString("%1 xyz y").arg(GetName())));
mXYZ.setZ(aStream->ParseSingle(QString("%1 xyz z").arg(GetName())));
mBinormalSign = aStream->ParseSingle(QString("%1 binormal sign").arg(GetName()));
quint8 r = aStream->ParseUInt8(QString("%1 color r").arg(GetName()));
quint8 g = aStream->ParseUInt8(QString("%1 color g").arg(GetName()));
quint8 b = aStream->ParseUInt8(QString("%1 color b").arg(GetName()));
quint8 a = aStream->ParseUInt8(QString("%1 color a").arg(GetName()));
2025-09-05 18:35:17 -04:00
mColor.SetColor(r, g, b, a);
2025-08-17 13:14:17 -04:00
2025-09-10 21:58:26 -04:00
mTexCoord.setX(aStream->ParseSingle(QString("%1 texcoord u").arg(GetName())));
mTexCoord.setY(aStream->ParseSingle(QString("%1 texcoord v").arg(GetName())));
mLmapCoord.setX(aStream->ParseSingle(QString("%1 lmapcoord u").arg(GetName())));
mLmapCoord.setY(aStream->ParseSingle(QString("%1 lmapcoord v").arg(GetName())));
2025-08-17 13:14:17 -04:00
mNormal.ParseData(aStream);
mTangent.ParseData(aStream);
}
}
2025-09-05 18:35:17 -04:00
void XGfxWorldVertex::Clear()
{
2025-08-17 13:14:17 -04:00
}