MCPcopy Create free account
hub / github.com/Illation/ETEngine / SpawnComponent

Method SpawnComponent

Projects/Demo/source/Common/SpawnComponent.cpp:48–70  ·  view source on GitHub ↗

----------------------- SpawnComponent::c-tor load assets from ids

Source from the content-addressed store, hash-verified

46// load assets from ids
47//
48SpawnComponent::SpawnComponent(core::HashString const meshId,
49 core::HashString const materialId,
50 float const s,
51 btCollisionShape* const shape,
52 float const shapeMass,
53 float const interv,
54 float const imp
55)
56 : collisionShape(shape)
57 , mass(shapeMass)
58 , scale(s)
59 , interval(interv)
60 , impulse(imp)
61{
62 mesh = core::ResourceManager::Instance()->GetAssetData<render::MeshData>(meshId);
63
64 // Load material
65 material = core::ResourceManager::Instance()->GetAssetData<render::Material>(materialId, false);
66 if (material == nullptr)
67 {
68 material = core::ResourceManager::Instance()->GetAssetData<render::MaterialInstance>(materialId);
69 }
70}
71
72
73//============================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected