XPlor/libs/xassets/xphysgeominfo.cpp

60 lines
1.1 KiB
C++
Raw Normal View History

2025-09-03 13:20:29 -04:00
#include "xphysgeominfo.h"
XPhysGeomInfo::XPhysGeomInfo()
: XAsset()
2025-09-10 21:58:26 -04:00
, mBrush()
2025-09-03 13:20:29 -04:00
, mType(0)
, mOrientation()
, mOffset()
, mHalfLengths()
{
2025-09-10 21:58:26 -04:00
SetName("Phys Geometry Info");
2025-09-03 13:20:29 -04:00
}
XPhysGeomInfo::~XPhysGeomInfo()
{
}
2025-09-10 21:58:26 -04:00
void XPhysGeomInfo::ParseData(XDataStream *aStream)
2025-09-03 13:20:29 -04:00
{
2025-09-10 21:58:26 -04:00
qint32 brushPtr;
*aStream
>> brushPtr
>> mType;
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
quint32 rawOrientation;
*aStream >> rawOrientation;
memcpy(&mOrientation[i][j], &rawOrientation, sizeof(mOrientation[i][j]));
}
}
for (int i = 0; i < 3; i++)
{
quint32 rawOffset;
*aStream >> rawOffset;
memcpy(&mOffset[i], &rawOffset, sizeof(mOffset[i]));
}
for (int i = 0; i < 3; i++)
{
quint32 rawHalfLength;
*aStream >> rawHalfLength;
memcpy(&mHalfLengths[i], &rawHalfLength, sizeof(mHalfLengths[i]));
}
2025-09-03 13:20:29 -04:00
}
void XPhysGeomInfo::Clear()
{
2025-09-10 21:58:26 -04:00
mBrush.Clear();
2025-09-03 13:20:29 -04:00
mType = 0;
2025-09-10 21:58:26 -04:00
mOrientation.clear();
2025-09-03 13:20:29 -04:00
mOffset = QVector3D();
mHalfLengths = QVector3D();
}