Changeset 605
- Timestamp:
- 07/17/08 22:38:24 (4 months ago)
- Files:
-
- branches/morph-targets/libx42/anim-skin.c (modified) (6 diffs)
- branches/morph-targets/libx42/include/x42.h (modified) (2 diffs)
- branches/morph-targets/libx42/local.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/morph-targets/libx42/anim-skin.c
r604 r605 187 187 } 188 188 189 void anim_skin_get_ influences( affine_t *infs, const x42data_t *x42, uint groupNum, const affine_t *boneMats )189 void anim_skin_get_group_influences( affine_t *infs, const x42data_t *x42, uint groupNum, const affine_t *boneMats ) 190 190 { 191 191 uint i; … … 207 207 } 208 208 209 void anim_skin_get_influences( affine_t *infs, const x42data_t *x42, const affine_t *boneMats ) 210 { 211 uint i; 212 for( i = 0; i < x42->header.numInfluences; i++ ) 213 { 214 const x42influence_t *inf = x42->influences + i; 215 216 if( inf->bone != X42_MODEL_BONE ) 217 affine_mul( infs + i, boneMats + inf->bone, &inf->meshToBone ); 218 else if( x42->header.runFlags & X42_RF_ROOT_MATRIX ) 219 affine_mul( infs + i, &x42->rootMatrix, &inf->meshToBone ); 220 else 221 affine_cpy( infs + i, &inf->meshToBone ); 222 } 223 } 224 209 225 bool anim_skin_vertices( x42memStream_t *oPos, x42memStream_t *oNorm, x42memStream_t *oTan, x42memStream_t *oBin, 210 226 x42memStream_t *iPos, x42vertNormal_t * RESTRICT iNorm, x42vertTangent_t * RESTRICT iTan, … … 215 231 affine_t infs[X42_MAX_INFLUENCES_PER_BATCH_V5]; 216 232 217 anim_skin_get_ influences( infs, x42, groupNum, boneMats );233 anim_skin_get_group_influences( infs, x42, groupNum, boneMats ); 218 234 219 235 grp = x42->groups + groupNum; … … 253 269 } 254 270 255 X42_EXPORT size_t X42_CALL x42_GetAnim InfluenceMatricesSize( const x42data_t *x42, uint groupNum )271 X42_EXPORT size_t X42_CALL x42_GetAnimGroupInfluenceMatricesSize( const x42data_t *x42, uint groupNum ) 256 272 { 257 273 #ifndef LIBX42_NO_PARAM_VALIDATION … … 264 280 } 265 281 266 X42_EXPORT affine_t* X42_CALL x42_GetAnim InfluenceMatrices( void *out_buffer, const x42data_t *x42,282 X42_EXPORT affine_t* X42_CALL x42_GetAnimGroupInfluenceMatrices( void *out_buffer, const x42data_t *x42, 267 283 const affine_t *boneMats, uint groupNum, x42opts_t *opts ) 268 284 { … … 281 297 ret = (affine_t*)out_buffer; 282 298 283 anim_skin_get_ influences( ret, x42, groupNum, boneMats );299 anim_skin_get_group_influences( ret, x42, groupNum, boneMats ); 284 300 285 301 return ret; 286 302 } 303 304 X42_EXPORT size_t X42_CALL x42_GetAnimInfluenceMatricesSize( const x42data_t *x42 ) 305 { 306 #ifndef LIBX42_NO_PARAM_VALIDATION 307 demand_rz( x42 != NULL, X42_ERR_BADPTR, "x42 is NULL" ); 308 demand_rz( x42_ValidateHeader( &x42->header ), X42_ERR_BADDATA, "invalid x42 header data" ); 309 #endif 310 311 return sizeof( affine_t ) * x42->header.numInfluences; 312 } 313 314 X42_EXPORT affine_t* X42_CALL x42_GetAnimInfluenceMatrices( void *out_buffer, const x42data_t *x42, 315 const affine_t *boneMats, x42opts_t *opts ) 316 { 317 affine_t *ret; 318 319 #ifndef LIBX42_NO_PARAM_VALIDATION 320 demand_rn( x42 != NULL, X42_ERR_BADPTR, "x42 is NULL" ); 321 demand_rn( x42_ValidateHeader( &x42->header ), X42_ERR_BADDATA, "invalid x42 header data" ); 322 demand_rn( out_buffer != NULL, X42_ERR_BADPTR, "out_buffer is NULL" ); 323 demand_rn( boneMats != NULL, X42_ERR_BADPTR, "boneMats is NULL" ); 324 #endif 325 326 REF_PARAM( opts ); 327 328 ret = (affine_t*)out_buffer; 329 330 anim_skin_get_influences( ret, x42, boneMats ); 331 332 return ret; 333 } branches/morph-targets/libx42/include/x42.h
r604 r605 445 445 X42_EXPORT size_t X42_CALL x42_GetAnimBoneMatricesSize( const x42data_t *x42 ); 446 446 X42_EXPORT size_t X42_CALL x42_GetAnimTagMatricesSize( const x42data_t *x42 ); 447 X42_EXPORT size_t X42_CALL x42_GetAnimInfluenceMatricesSize( const x42data_t *x42 ); 447 448 448 449 X42_EXPORT affine_t* X42_CALL x42_GetAnimBoneMatrices( void *out_buffer, const x42data_t *x42, 449 450 const x42animLerp_t *lerp, x42opts_t *opts ); 450 451 X42_EXPORT affine_t* X42_CALL x42_GetAnimTagMatrices( void *out_buffer, const x42data_t *x42, 452 const affine_t *boneMats, x42opts_t *opts ); 453 X42_EXPORT affine_t* X42_CALL x42_GetAnimInfluenceMatrices( void *out_buffer, const x42data_t *x42, 451 454 const affine_t *boneMats, x42opts_t *opts ); 452 455 … … 474 477 */ 475 478 476 X42_EXPORT size_t X42_CALL x42_GetAnim InfluenceMatricesSize( const x42data_t *x42, uint groupNum );477 X42_EXPORT affine_t* X42_CALL x42_GetAnim InfluenceMatrices( void *out_buffer, const x42data_t *x42,479 X42_EXPORT size_t X42_CALL x42_GetAnimGroupInfluenceMatricesSize( const x42data_t *x42, uint groupNum ); 480 X42_EXPORT affine_t* X42_CALL x42_GetAnimGroupInfluenceMatrices( void *out_buffer, const x42data_t *x42, 478 481 const affine_t *boneMats, uint groupNum, x42opts_t *opts ); 479 482 branches/morph-targets/libx42/local.h
r604 r605 125 125 126 126 /* internal calls */ 127 void anim_skin_get_influences( affine_t *infs, const x42data_t *x42, uint groupNum, const affine_t *boneMats ); 127 void anim_skin_get_group_influences( affine_t *infs, const x42data_t *x42, uint groupNum, const affine_t *boneMats ); 128 void anim_skin_get_influences( affine_t *infs, const x42data_t *x42, const affine_t *boneMats ); 128 129 129 130 bool anim_morph_vertices( vec4_t * RESTRICT oPos, x42vertNormal_t * RESTRICT oNorm, x42vertTangent_t * RESTRICT oTan,
