MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / NormalizeBlendWeights

Method NormalizeBlendWeights

Source/Engine/Graphics/Models/ModelData.cpp:285–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void MeshData::NormalizeBlendWeights()
286{
287 ASSERT(Positions.Count() == BlendWeights.Count());
288 for (int32 i = 0; i < Positions.Count(); i++)
289 {
290 Float4& weights = BlendWeights.Get()[i];
291 const float sum = weights.SumValues();
292 const float invSum = sum > ZeroTolerance ? 1.0f / sum : 0.0f;
293 weights *= invSum;
294 }
295}
296
297void MeshData::Merge(MeshData& other)
298{

Callers 3

ProcessMeshFunction · 0.80
ProcessMeshFunction · 0.80
ProcessMeshFunction · 0.80

Calls 3

CountMethod · 0.45
GetMethod · 0.45
SumValuesMethod · 0.45

Tested by

no test coverage detected