Netcode Bootstrap

This commit is contained in:
Luis Gonzalez
2026-05-31 14:27:52 -07:00
parent 99d8d2d2a9
commit 7fa77ce821
1813 changed files with 2921554 additions and 84 deletions
@@ -0,0 +1,58 @@
using Hash128 = Unity.Entities.Hash128;
using Unity.Mathematics;
using Unity.Entities;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace Rukhanka
{
public struct SkinnedMeshBoneInfo
{
#if RUKHANKA_DEBUG_INFO
public BlobString name;
#endif
public uint hash;
public float4x4 bindPose;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public struct BlendShapeInfo
{
#if RUKHANKA_DEBUG_INFO
public BlobString name;
#endif
public uint hash;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public struct SkinnedMeshInfoBlob: GenericAssetBlob
{
#if RUKHANKA_DEBUG_INFO
public BlobString skeletonName;
public string Name() => skeletonName.ToString();
public float bakingTime;
public float BakingTime() => bakingTime;
#endif
public Hash128 hash;
public Hash128 Hash() => hash;
public BlobArray<SkinnedMeshBoneInfo> bones;
public BlobArray<BlendShapeInfo> blendShapes;
// Each weight index is bone count for a vertex (lower 8 bits) and start bone weight data index (upper 24 bits)
// Bone weights index need to be used to index into Mesh.GetAllBoneWeights().
public BlobArray<uint> boneWeightsIndices;
public int meshBoneWeightsCount;
public int meshBlendShapesCount;
public int meshVerticesCount;
public static uint GetBoneWeightCount(uint packedBoneWeightsValue) => packedBoneWeightsValue & 0xff;
public static uint GetBoneWeightIndexOffset(uint packedBoneWeightsValue) => packedBoneWeightsValue >> 8;
public static uint PackBoneCountAndOffset(byte boneCount, uint offset)
{
var rv = boneCount | (offset << 8);
return rv;
}
}
}