Changeset 515
- Timestamp:
- 02/22/08 12:55:54 (11 months ago)
- Files:
-
- branches/morph-targets/libx42make/helpers.h (added)
- branches/morph-targets/libx42make/include/x42make-helpers.h (deleted)
- branches/morph-targets/libx42make/include/x42make-modelbuilder.h (modified) (10 diffs)
- branches/morph-targets/libx42make/include/x42make.h (modified) (1 diff)
- branches/morph-targets/libx42make/libx42make.vcproj (modified) (3 diffs)
- branches/morph-targets/libx42make/local.h (modified) (1 diff)
- branches/morph-targets/libx42make/modelbuilder-animation.cpp (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/morph-targets/libx42make/include/x42make-modelbuilder.h
r514 r515 122 122 }; 123 123 124 typedef anim_track_elem< ::x42::math::vec3 > vec3_track_elem;125 typedef anim_track_elem< ::x42::math::quat > quat_track_elem;126 typedef anim_track_elem< ::x42::math::affine > affine_track_elem;127 128 class animation_tracks129 {130 public:131 std::vector< vec3_track_elem > position;132 std::vector< quat_track_elem > rotation;133 std::vector< vec3_track_elem > scale;134 135 std::vector< affine_track_elem > world_matrices;136 std::vector< affine_track_elem > local_matrices;137 };138 139 124 struct animation_tolerances 140 125 { … … 171 156 }; 172 157 158 typedef anim_track_elem< ::x42::math::vec3 > vec3_track_elem; 159 typedef anim_track_elem< ::x42::math::quat > quat_track_elem; 160 typedef anim_track_elem< ::x42::math::affine > affine_track_elem; 161 162 class animation_tracks 163 { 164 public: 165 std::vector< vec3_track_elem > position; 166 std::vector< quat_track_elem > rotation; 167 std::vector< vec3_track_elem > scale; 168 169 std::vector< affine_track_elem > world_matrices; 170 171 std::vector< affine_track_elem > local_matrices; 172 173 void require_tracks(); 174 void require_local(); 175 void require_world(); 176 177 void clean_tracks(); 178 179 private: 180 bone *owner; 181 182 animation_tracks() 183 { 184 } 185 186 void set_tracks( const std::vector< vec3_track_elem > &pos, 187 const std::vector< quat_track_elem > &rot, 188 const std::vector< vec3_track_elem > &scale ); 189 void set_world_mats( const std::vector< affine_track_elem > &world_mats ); 190 void set_local_mats( const std::vector< affine_track_elem > &local_mats ); 191 192 void make_tracks_from_local(); 193 void make_local_from_tracks(); 194 void make_local_from_world(); 195 void make_world_from_local(); 196 197 friend class bone; 198 friend class model_builder; 199 }; 200 173 201 class bone : public ref_obj 174 202 { … … 181 209 animation_tolerances tight_tolerances; 182 210 211 bool static_bone_hint; 212 183 213 bone_ptr parent() const { return _parent; } 184 214 void parent( const bone_ptr &new_parent ); … … 195 225 uint _anim_group; 196 226 bone_ptr _parent; 197 227 198 228 float extent; //computed value 199 229 animation_tracks anim_tracks; … … 202 232 : owner( owner ), _anim_group( 0 ), extent( 0 ), 203 233 loose_tolerances( animation_tolerances::inherit_defaults() ), 204 tight_tolerances( animation_tolerances::inherit_defaults() ) 205 { 206 } 207 234 tight_tolerances( animation_tolerances::inherit_defaults() ), 235 static_bone_hint( false ) 236 { 237 anim_tracks.owner = this; 238 } 239 240 friend class animation_tracks; 208 241 friend class model_builder; 209 242 }; … … 426 459 std::vector< tag_ptr > tags; 427 460 461 std::vector< animation > animations; 462 std::vector< uint > pinned_frames; 463 428 464 animation_tolerances loose_tolerances; 429 465 animation_tolerances tight_tolerances; … … 432 468 : loose_tolerances( animation_tolerances::loose_defaults() ), 433 469 tight_tolerances( animation_tolerances::tight_defaults() ), 434 _bone_update_count( 0 ), _influence_update_count( 0 ), _tag_update_count( 0 ) 470 _bone_update_count( 0 ), _influence_update_count( 0 ), _tag_update_count( 0 ), 471 _base_frame( 0 ), _frame_count( 0 ) 435 472 { 436 473 } … … 444 481 445 482 void optimize_geometry( geometry::optimize_type opt_type = geometry::optimize_type::match_current ); 483 484 //all anim_track_elem frame values are relative to this value 485 int base_frame() const { return _base_frame; } 486 uint frame_count() const { return _frame_count; } 487 //sets the frame range and clears all animation data 488 void set_frame_range( uint frame_count, int base_frame = 0 ); 446 489 447 490 void begin_bone_update(); //suspends bone validation and sorting … … 477 520 478 521 private: 522 int _base_frame; 523 uint _frame_count; 524 479 525 int _bone_update_count; 480 526 int _influence_update_count; … … 499 545 void validate_tags(); 500 546 547 std::vector< uint > get_critical_frames() const; 548 501 549 friend class bone; 550 friend class animation_tracks; 502 551 friend class influence; 503 552 friend class tag; branches/morph-targets/libx42make/include/x42make.h
r509 r515 33 33 #include "x42make-modeldata.h" 34 34 #include "x42make-modelbuilder.h" 35 #include "x42make-helpers.h"36 35 37 36 #endif branches/morph-targets/libx42make/libx42make.vcproj
r512 r515 492 492 > 493 493 <File 494 RelativePath=".\include\x42make-helpers.h"495 >496 </File>497 <File498 494 RelativePath=".\include\x42make-modelbuilder.h" 499 495 > … … 585 581 </Filter> 586 582 <File 583 RelativePath=".\helpers.h" 584 > 585 </File> 586 <File 587 587 RelativePath=".\local.h" 588 588 > … … 655 655 /> 656 656 </FileConfiguration> 657 </File> 658 <File 659 RelativePath=".\modelbuilder-animation.cpp" 660 > 657 661 </File> 658 662 <File branches/morph-targets/libx42make/local.h
r511 r515 47 47 48 48 #include "batcher.h" 49 #include "helpers.h" 49 50 50 51 #define null NULL
