]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
IQM base pose cleanups
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 8 Mar 2010 08:50:03 +0000 (08:50 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 8 Mar 2010 08:50:03 +0000 (08:50 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10043 d7cf8633-e32d-0410-b094-e92efae38249

model_alias.c
model_iqm.h

index d1c336b691ed7378f7c75092f806bccc2ee62478..91de0dc7dda9391de1b2277f01d4f6c3b7e7a1fa 100644 (file)
@@ -3091,7 +3091,6 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
        float biggestorigin;
        const int *inelements;
        int *outelements;
-       const float *inversebasepose;
        float *outvertex, *outnormal, *outtexcoord, *outsvector, *outtvector;
 
        pbase = (unsigned char *)buffer;
@@ -3122,7 +3121,6 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
        header->ofs_neighbors = LittleLong(header->ofs_neighbors);
        header->num_joints = LittleLong(header->num_joints);
        header->ofs_joints = LittleLong(header->ofs_joints);
-       header->ofs_inversebasepose = LittleLong(header->ofs_inversebasepose);
        header->num_poses = LittleLong(header->num_poses);
        header->ofs_poses = LittleLong(header->ofs_poses);
        header->num_anims = LittleLong(header->num_anims);
@@ -3258,6 +3256,7 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
        joint = (iqmjoint_t *) (pbase + header->ofs_joints);
        for (i = 0;i < loadmodel->num_bones;i++)
        {
+               matrix4x4_t base, invbase;
                joint[i].name = LittleLong(joint[i].name);
                joint[i].parent = LittleLong(joint[i].parent);
                for (j = 0;j < 3;j++)
@@ -3269,13 +3268,9 @@ 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);
-               }
+               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
@@ -3341,13 +3336,6 @@ void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
                }
        }
 
-       if (header->ofs_inversebasepose)
-       {
-               inversebasepose = (const float *) (pbase + header->ofs_inversebasepose);
-               for (i = 0;i < 12*(int)header->num_poses;i++)   
-                       loadmodel->data_baseboneposeinverse[i] = LittleFloat(inversebasepose[i]);
-       }
        // load bounding box data
        if (header->ofs_bounds)
        {
index 39249f88e05da64cf578a93dbb5222b404ab446a..2509e0346b71aa8b80d5c9d0c95acaefcf035384 100644 (file)
@@ -11,7 +11,7 @@ typedef struct iqmheader_s
        unsigned int num_meshes, ofs_meshes;
        unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays;
        unsigned int num_triangles, ofs_triangles, ofs_neighbors;
-       unsigned int num_joints, ofs_joints, ofs_inversebasepose;
+       unsigned int num_joints, ofs_joints;
        unsigned int num_poses, ofs_poses;
        unsigned int num_anims, ofs_anims;
        unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds;