Removed unused variables and added constructors for vec 4 to vec3

This commit is contained in:
Xiao Qi 2023-03-02 15:17:01 +08:00
parent 29b553ba0a
commit 2188aa4998
4 changed files with 34 additions and 10 deletions

View File

@ -138,6 +138,11 @@ namespace SH_COMP
sizeof(uint32_t)
);
file.write(
reinterpret_cast<char const*>(&header.startNode),
sizeof(uint32_t)
);
file.write(
reinterpret_cast<char const*>(header.charCounts.data()),
sizeof(uint32_t) * header.nodeCount

View File

@ -8,16 +8,29 @@ namespace SH_COMP
float x, y;
};
struct SHVec3
{
float x, y, z;
};
struct SHVec4
{
float x, y, z, w;
};
struct SHVec3
{
SHVec3()
:x{ 0.f }, y{ 0.f }, z{ 0.f }
{}
SHVec3(SHVec4 const& rhs)
:x{ rhs.x }, y{ rhs.y }, z{ rhs.z }
{}
SHVec3(float inx, float iny, float inz)
:x{ iny }, y{ iny }, z{ inz }
{}
float x, y, z;
};
struct SHVec4i
{
uint32_t x, y, z, w;

View File

@ -28,15 +28,23 @@ namespace SH_COMP
struct KeyBase
{
float time;
SHVec3 value;
};
// Smallest data containers
struct PositionKey :KeyBase {};
struct PositionKey :KeyBase
{
SHVec3 value;
};
struct RotationKey : KeyBase {};
struct RotationKey : KeyBase
{
SHVec4 value;
};
struct ScaleKey :KeyBase {};
struct ScaleKey :KeyBase
{
SHVec3 value;
};
struct AnimDataHeader
{

View File

@ -21,8 +21,6 @@ namespace SH_COMP
uint32_t nodeCount;
IndexType startNode;
std::vector<uint32_t> charCounts;
std::vector<uint32_t> childCount;
std::vector<NodeDataFlag> dataFlags;
};
struct NodeAsset