mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-25 02:51:43 +00:00
chore: set XSurface deformed property when applicable
This commit is contained in:
@@ -752,9 +752,16 @@ namespace
|
||||
|
||||
// Since bone weights are sorted by weight count, the last must have the highest weight count
|
||||
const auto maxWeightCount = common.m_vertex_bone_weights[xmodelToCommonVertexIndexLookup[xmodelToCommonVertexIndexLookup.size() - 1]].weightCount;
|
||||
const auto modelIsRigid = maxWeightCount <= 1;
|
||||
const auto surfaceIsRigid = maxWeightCount <= 1;
|
||||
|
||||
if (modelIsRigid)
|
||||
#if defined(FEATURE_IW3) || defined(FEATURE_IW4)
|
||||
surface.deformed = !surfaceIsRigid;
|
||||
#else
|
||||
if (!surfaceIsRigid)
|
||||
surface.flags |= XSURFACE_FLAG_DEFORMED;
|
||||
#endif
|
||||
|
||||
if (surfaceIsRigid)
|
||||
{
|
||||
constexpr auto maxVerticesForRigid = static_cast<size_t>(std::numeric_limits<decltype(XSurface::vertCount)>::max());
|
||||
if (vertexOffset + xmodelToCommonVertexIndexLookup.size() > maxVerticesForRigid)
|
||||
@@ -790,7 +797,7 @@ namespace
|
||||
|
||||
if (!common.m_bone_weight_data.weights.empty())
|
||||
{
|
||||
if (modelIsRigid)
|
||||
if (surfaceIsRigid)
|
||||
{
|
||||
CreateVertListData(surface, xmodelToCommonVertexIndexLookup, common);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user