mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-06-30 02:13:42 +00:00
CSkin: Make use of ranged for where applicable
Same behavior, less code.
This commit is contained in:
parent
32dafc6bb8
commit
4a020d1d4a
@ -28,19 +28,19 @@ public:
|
|||||||
const SVertexWeights& WeightsForVertex(uint32 VertIdx)
|
const SVertexWeights& WeightsForVertex(uint32 VertIdx)
|
||||||
{
|
{
|
||||||
// Null weights bind everything to the root bone in case there is no matching vertex group
|
// Null weights bind everything to the root bone in case there is no matching vertex group
|
||||||
static const SVertexWeights skNullWeights = {
|
static constexpr SVertexWeights skNullWeights{
|
||||||
{ 3, 0, 0, 0 },
|
{3, 0, 0, 0},
|
||||||
{ 1.f, 0.f, 0.f, 0.f }
|
{1.f, 0.f, 0.f, 0.f},
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32 Index = 0;
|
uint32 Index = 0;
|
||||||
|
|
||||||
for (uint32 iGrp = 0; iGrp < mVertGroups.size(); iGrp++)
|
for (const auto& group : mVertGroups)
|
||||||
{
|
{
|
||||||
if (VertIdx < Index + mVertGroups[iGrp].NumVertices)
|
if (VertIdx < Index + group.NumVertices)
|
||||||
return mVertGroups[iGrp].Weights;
|
return group.Weights;
|
||||||
|
|
||||||
Index += mVertGroups[iGrp].NumVertices;
|
Index += group.NumVertices;
|
||||||
}
|
}
|
||||||
|
|
||||||
return skNullWeights;
|
return skNullWeights;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user