From: eihrul Date: Sun, 7 Mar 2010 21:50:15 +0000 (+0000) Subject: build IQM inverse base pose from joints if necessary X-Git-Tag: xonotic-v0.1.0preview~230^2~430 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1758371577bf14719f55b96d613055d06a421996;p=xonotic%2Fdarkplaces.git build IQM inverse base pose from joints if necessary git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10039 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_alias.c b/model_alias.c index 587d81e5..9d2ee142 100644 --- a/model_alias.c +++ b/model_alias.c @@ -3267,6 +3267,13 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->data_bones[i].parent = joint[i].parent; if (loadmodel->data_bones[i].parent >= i) Host_Error("%s bone[%i].parent >= %i", loadmodel->name, i, i); + if (!header->ofs_inversebasepose) + { + matrix4x4_t base, invbase; + Matrix4x4_FromDoom3Joint(&base, joint[i].origin[0], joint[i].origin[1], joint[i].origin[2], joint[i].rotation[0], joint[i].rotation[1], joint[i].rotation[2]); + Matrix4x4_Invert_Simple(&invbase, &base); + Matrix4x4_ToArray12FloatD3D(&invbase, loadmodel->data_baseboneposeinverse[12*i]); + } } // set up the animscenes based on the anims @@ -3438,8 +3445,6 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend) if (loadmodel->surfmesh.data_element3s) for (i = 0;i < loadmodel->surfmesh.num_triangles*3;i++) loadmodel->surfmesh.data_element3s[i] = loadmodel->surfmesh.data_element3i[i]; - if (!header->ofs_inversebasepose) - Mod_BuildBaseBonePoses(); if (!vnormal) Mod_BuildNormals(0, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->surfmesh.data_vertex3f, loadmodel->surfmesh.data_element3i, loadmodel->surfmesh.data_normal3f, true); if (!vnormal || !vtangent)