XPlor/libs/xassets/xgfxpackedvertex.cpp

48 lines
1.0 KiB
C++
Raw Normal View History

2025-09-03 13:07:08 -04:00
#include "xgfxpackedvertex.h"
XGfxPackedVertex::XGfxPackedVertex()
: XAsset()
, mXYZ()
, mBinormalSign(0)
, mColor()
, mTexCoord()
, mNormal()
, mTangent()
{
2025-09-10 21:58:26 -04:00
SetName("GFX Packed Vertex");
2025-09-03 13:07:08 -04:00
}
2025-09-10 21:58:26 -04:00
void XGfxPackedVertex::ParseData(XDataStream *aStream)
2025-09-03 13:07:08 -04:00
{
2025-09-07 23:11:57 -04:00
if (GetPtr() == -1)
{
2025-09-10 21:58:26 -04:00
quint32 rawCoord;
for (int i = 0; i < 3; i++)
{
*aStream >> rawCoord;
memcpy(&mXYZ[i], &rawCoord, sizeof(mXYZ[i]));
if (IsDebug())
{
qDebug() << QString("[%1] mXYZ[%2] = %3").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(i).arg(mXYZ[0]);
}
}
*aStream >> mBinormalSign;
if (IsDebug())
{
qDebug() << QString("[%1] mBinormalSign = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mBinormalSign);
}
2025-09-07 23:11:57 -04:00
mColor.ParseData(aStream);
mTexCoord.ParseData(aStream);
mNormal.ParseData(aStream);
mTangent.ParseData(aStream);
}
2025-09-03 13:07:08 -04:00
}
void XGfxPackedVertex::Clear()
{
}