MCPcopy Create free account
hub / github.com/defold/defold / SetMorphWeights

Function SetMorphWeights

engine/rig/src/rig.cpp:1670–1682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1668 }
1669
1670 void SetMorphWeights(HRigInstance instance, uint64_t model_id, const float* weights, uint32_t count)
1671 {
1672 MorphWeightSlot* slot = GetMorphWeightSlot(instance, model_id);
1673 if (!slot)
1674 {
1675 return;
1676 }
1677 float* dest = instance->m_MorphWeightsBuffer.Begin() + slot->m_BufferOffset;
1678 uint32_t n = dmMath::Min(count, slot->m_MorphCount);
1679 memcpy(dest, weights, n * sizeof(float));
1680 if (n < slot->m_MorphCount)
1681 memset(dest + n, 0, (slot->m_MorphCount - n) * sizeof(float));
1682 }
1683
1684 void SetEventCallback(HRigInstance instance, RigEventCallback event_callback, void* user_data1, void* user_data2)
1685 {

Callers 1

TESTFunction · 0.50

Calls 3

GetMorphWeightSlotFunction · 0.85
MinFunction · 0.85
BeginMethod · 0.45

Tested by 1

TESTFunction · 0.40