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

Method Setup

Source/Engine/Graphics/Models/SkinnedMeshDrawData.cpp:15–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15void SkinnedMeshDrawData::Setup(int32 bonesCount)
16{
17 if (BoneMatrices == nullptr)
18 {
19 BoneMatrices = GPUDevice::Instance->CreateBuffer(TEXT("BoneMatrices"));
20 }
21
22 const int32 elementsCount = bonesCount * 3; // 3 * float4 per bone
23 if (BoneMatrices->Init(GPUBufferDescription::Typed(elementsCount, PixelFormat::R32G32B32A32_Float, false, GPUResourceUsage::Dynamic)))
24 {
25 LOG(Error, "Failed to initialize the skinned mesh bones buffer");
26 return;
27 }
28
29 BonesCount = bonesCount;
30 _hasValidData = false;
31 _isDirty = true;
32 Data.Resize(BoneMatrices->GetSize());
33 SAFE_DELETE_GPU_RESOURCE(PrevBoneMatrices);
34}
35
36void SkinnedMeshDrawData::OnDataChanged(bool dropHistory)
37{

Callers

nothing calls this directly

Calls 4

CreateBufferMethod · 0.45
InitMethod · 0.45
ResizeMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected