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

Function SetModel

engine/rig/src/rig.cpp:191–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189 }
190
191 Result SetModel(HRigInstance instance, dmhash_t model_id)
192 {
193 if (model_id == 0)
194 {
195 instance->m_ModelId = model_id;
196 instance->m_Model = instance->m_MeshSet->m_Models.m_Data;
197 instance->m_NumModels = instance->m_MeshSet->m_Models.m_Count;
198 instance->m_DoRender = 1;
199 return dmRig::RESULT_OK;
200 }
201
202 for (uint32_t i = 0; i < instance->m_MeshSet->m_Models.m_Count; ++i)
203 {
204 const dmRigDDF::Model* model = &instance->m_MeshSet->m_Models[i];
205 if (model->m_Id == model_id)
206 {
207 instance->m_Model = model;
208 instance->m_NumModels = 1;
209 instance->m_ModelId = model_id;
210 instance->m_DoRender = 1;
211 return dmRig::RESULT_OK;
212 }
213 }
214 instance->m_Model = 0;
215 instance->m_ModelId = 0;
216 instance->m_DoRender = 0;
217 instance->m_NumModels = 0;
218 return dmRig::RESULT_ERROR;
219 }
220
221 static void UpdateBlend(RigInstance* instance, float dt)
222 {

Callers 3

InstanceCreateFunction · 0.70
TEST_FFunction · 0.50
CompModelSetPropertyFunction · 0.50

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.40