LWOAnimation.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /*
  2. Open Asset Import Library (assimp)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2012, assimp team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the assimp team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the assimp team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ----------------------------------------------------------------------
  32. */
  33. /** @file LWOAnimation.cpp
  34. * @brief LWOAnimationResolver utility class
  35. *
  36. * It's a very generic implementation of LightWave's system of
  37. * componentwise-animated stuff. The one and only fully free
  38. * implementation of LightWave envelopes of which I know.
  39. */
  40. #include "AssimpPCH.h"
  41. #if (!defined ASSIMP_BUILD_NO_LWO_IMPORTER) && (!defined ASSIMP_BUILD_NO_LWS_IMPORTER)
  42. // internal headers
  43. #include "LWOFileData.h"
  44. using namespace Assimp;
  45. using namespace Assimp::LWO;
  46. // ------------------------------------------------------------------------------------------------
  47. // Construct an animation resolver from a given list of envelopes
  48. AnimResolver::AnimResolver(std::list<Envelope>& _envelopes,double tick)
  49. : envelopes (_envelopes)
  50. , sample_rate (0.)
  51. {
  52. trans_x = trans_y = trans_z = NULL;
  53. rotat_x = rotat_y = rotat_z = NULL;
  54. scale_x = scale_y = scale_z = NULL;
  55. first = last = 150392.;
  56. // find transformation envelopes
  57. for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
  58. (*it).old_first = 0;
  59. (*it).old_last = (*it).keys.size()-1;
  60. if ((*it).keys.empty()) continue;
  61. switch ((*it).type) {
  62. // translation
  63. case LWO::EnvelopeType_Position_X:
  64. trans_x = &*it;break;
  65. case LWO::EnvelopeType_Position_Y:
  66. trans_y = &*it;break;
  67. case LWO::EnvelopeType_Position_Z:
  68. trans_z = &*it;break;
  69. // rotation
  70. case LWO::EnvelopeType_Rotation_Heading:
  71. rotat_x = &*it;break;
  72. case LWO::EnvelopeType_Rotation_Pitch:
  73. rotat_y = &*it;break;
  74. case LWO::EnvelopeType_Rotation_Bank:
  75. rotat_z = &*it;break;
  76. // scaling
  77. case LWO::EnvelopeType_Scaling_X:
  78. scale_x = &*it;break;
  79. case LWO::EnvelopeType_Scaling_Y:
  80. scale_y = &*it;break;
  81. case LWO::EnvelopeType_Scaling_Z:
  82. scale_z = &*it;break;
  83. default:
  84. continue;
  85. };
  86. // convert from seconds to ticks
  87. for (std::vector<LWO::Key>::iterator d = (*it).keys.begin(); d != (*it).keys.end(); ++d)
  88. (*d).time *= tick;
  89. // set default animation range (minimum and maximum time value for which we have a keyframe)
  90. first = std::min(first, (*it).keys.front().time );
  91. last = std::max(last, (*it).keys.back().time );
  92. }
  93. // deferred setup of animation range to increase performance.
  94. // typically the application will want to specify its own.
  95. need_to_setup = true;
  96. }
  97. // ------------------------------------------------------------------------------------------------
  98. // Reset all envelopes to their original contents
  99. void AnimResolver::ClearAnimRangeSetup()
  100. {
  101. for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
  102. (*it).keys.erase((*it).keys.begin(),(*it).keys.begin()+(*it).old_first);
  103. (*it).keys.erase((*it).keys.begin()+(*it).old_last+1,(*it).keys.end());
  104. }
  105. }
  106. // ------------------------------------------------------------------------------------------------
  107. // Insert additional keys to match LWO's pre& post behaviours.
  108. void AnimResolver::UpdateAnimRangeSetup()
  109. {
  110. // XXX doesn't work yet (hangs if more than one envelope channels needs to be interpolated)
  111. for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
  112. if ((*it).keys.empty()) continue;
  113. const double my_first = (*it).keys.front().time;
  114. const double my_last = (*it).keys.back().time;
  115. const double delta = my_last-my_first;
  116. const size_t old_size = (*it).keys.size();
  117. const float value_delta = (*it).keys.back().value - (*it).keys.front().value;
  118. // NOTE: We won't handle reset, linear and constant here.
  119. // See DoInterpolation() for their implementation.
  120. // process pre behaviour
  121. switch ((*it).pre) {
  122. case LWO::PrePostBehaviour_OffsetRepeat:
  123. case LWO::PrePostBehaviour_Repeat:
  124. case LWO::PrePostBehaviour_Oscillate:
  125. {
  126. const double start_time = delta - fmod(my_first-first,delta);
  127. std::vector<LWO::Key>::iterator n = std::find_if((*it).keys.begin(),(*it).keys.end(),
  128. std::bind1st(std::greater<double>(),start_time)),m;
  129. size_t ofs = 0;
  130. if (n != (*it).keys.end()) {
  131. // copy from here - don't use iterators, insert() would invalidate them
  132. ofs = (*it).keys.end()-n;
  133. (*it).keys.insert((*it).keys.begin(),ofs,LWO::Key());
  134. std::copy((*it).keys.end()-ofs,(*it).keys.end(),(*it).keys.begin());
  135. }
  136. // do full copies. again, no iterators
  137. const unsigned int num = (unsigned int)((my_first-first) / delta);
  138. (*it).keys.resize((*it).keys.size() + num*old_size);
  139. n = (*it).keys.begin()+ofs;
  140. bool reverse = false;
  141. for (unsigned int i = 0; i < num; ++i) {
  142. m = n+old_size*(i+1);
  143. std::copy(n,n+old_size,m);
  144. if ((*it).pre == LWO::PrePostBehaviour_Oscillate && (reverse = !reverse))
  145. std::reverse(m,m+old_size-1);
  146. }
  147. // update time values
  148. n = (*it).keys.end() - (old_size+1);
  149. double cur_minus = delta;
  150. unsigned int tt = 1;
  151. for (const double tmp = delta*(num+1);cur_minus <= tmp;cur_minus += delta,++tt) {
  152. m = (delta == tmp ? (*it).keys.begin() : n - (old_size+1));
  153. for (;m != n; --n) {
  154. (*n).time -= cur_minus;
  155. // offset repeat? add delta offset to key value
  156. if ((*it).pre == LWO::PrePostBehaviour_OffsetRepeat) {
  157. (*n).value += tt * value_delta;
  158. }
  159. }
  160. }
  161. break;
  162. }
  163. default:
  164. // silence compiler warning
  165. break;
  166. }
  167. // process post behaviour
  168. switch ((*it).post) {
  169. case LWO::PrePostBehaviour_OffsetRepeat:
  170. case LWO::PrePostBehaviour_Repeat:
  171. case LWO::PrePostBehaviour_Oscillate:
  172. break;
  173. default:
  174. // silence compiler warning
  175. break;
  176. }
  177. }
  178. }
  179. // ------------------------------------------------------------------------------------------------
  180. // Extract bind pose matrix
  181. void AnimResolver::ExtractBindPose(aiMatrix4x4& out)
  182. {
  183. // If we have no envelopes, return identity
  184. if (envelopes.empty()) {
  185. out = aiMatrix4x4();
  186. return;
  187. }
  188. aiVector3D angles, scaling(1.f,1.f,1.f), translation;
  189. if (trans_x) translation.x = trans_x->keys[0].value;
  190. if (trans_y) translation.y = trans_y->keys[0].value;
  191. if (trans_z) translation.z = trans_z->keys[0].value;
  192. if (rotat_x) angles.x = rotat_x->keys[0].value;
  193. if (rotat_y) angles.y = rotat_y->keys[0].value;
  194. if (rotat_z) angles.z = rotat_z->keys[0].value;
  195. if (scale_x) scaling.x = scale_x->keys[0].value;
  196. if (scale_y) scaling.y = scale_y->keys[0].value;
  197. if (scale_z) scaling.z = scale_z->keys[0].value;
  198. // build the final matrix
  199. aiMatrix4x4 s,rx,ry,rz,t;
  200. aiMatrix4x4::RotationZ(angles.z, rz);
  201. aiMatrix4x4::RotationX(angles.y, rx);
  202. aiMatrix4x4::RotationY(angles.x, ry);
  203. aiMatrix4x4::Translation(translation,t);
  204. aiMatrix4x4::Scaling(scaling,s);
  205. out = t*ry*rx*rz*s;
  206. }
  207. // ------------------------------------------------------------------------------------------------
  208. // Do a single interpolation on a channel
  209. void AnimResolver::DoInterpolation(std::vector<LWO::Key>::const_iterator cur,
  210. LWO::Envelope* envl,double time, float& fill)
  211. {
  212. if (envl->keys.size() == 1) {
  213. fill = envl->keys[0].value;
  214. return;
  215. }
  216. // check whether we're at the beginning of the animation track
  217. if (cur == envl->keys.begin()) {
  218. // ok ... this depends on pre behaviour now
  219. // we don't need to handle repeat&offset repeat&oszillate here, see UpdateAnimRangeSetup()
  220. switch (envl->pre)
  221. {
  222. case LWO::PrePostBehaviour_Linear:
  223. DoInterpolation2(cur,cur+1,time,fill);
  224. return;
  225. case LWO::PrePostBehaviour_Reset:
  226. fill = 0.f;
  227. return;
  228. default : //case LWO::PrePostBehaviour_Constant:
  229. fill = (*cur).value;
  230. return;
  231. }
  232. }
  233. // check whether we're at the end of the animation track
  234. else if (cur == envl->keys.end()-1 && time > envl->keys.rbegin()->time) {
  235. // ok ... this depends on post behaviour now
  236. switch (envl->post)
  237. {
  238. case LWO::PrePostBehaviour_Linear:
  239. DoInterpolation2(cur,cur-1,time,fill);
  240. return;
  241. case LWO::PrePostBehaviour_Reset:
  242. fill = 0.f;
  243. return;
  244. default : //case LWO::PrePostBehaviour_Constant:
  245. fill = (*cur).value;
  246. return;
  247. }
  248. }
  249. // Otherwise do a simple interpolation
  250. DoInterpolation2(cur-1,cur,time,fill);
  251. }
  252. // ------------------------------------------------------------------------------------------------
  253. // Almost the same, except we won't handle pre/post conditions here
  254. void AnimResolver::DoInterpolation2(std::vector<LWO::Key>::const_iterator beg,
  255. std::vector<LWO::Key>::const_iterator end,double time, float& fill)
  256. {
  257. switch ((*end).inter) {
  258. case LWO::IT_STEP:
  259. // no interpolation at all - take the value of the last key
  260. fill = (*beg).value;
  261. return;
  262. default:
  263. // silence compiler warning
  264. break;
  265. }
  266. // linear interpolation - default
  267. fill = (*beg).value + ((*end).value - (*beg).value)*(float)(((time - (*beg).time) / ((*end).time - (*beg).time)));
  268. }
  269. // ------------------------------------------------------------------------------------------------
  270. // Subsample animation track by given key values
  271. void AnimResolver::SubsampleAnimTrack(std::vector<aiVectorKey>& /*out*/,
  272. double /*time*/ ,double /*sample_delta*/ )
  273. {
  274. //ai_assert(out.empty() && sample_delta);
  275. //const double time_start = out.back().mTime;
  276. // for ()
  277. }
  278. // ------------------------------------------------------------------------------------------------
  279. // Track interpolation
  280. void AnimResolver::InterpolateTrack(std::vector<aiVectorKey>& out,aiVectorKey& fill,double time)
  281. {
  282. // subsample animation track?
  283. if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
  284. SubsampleAnimTrack(out,time, sample_delta);
  285. }
  286. fill.mTime = time;
  287. // get x
  288. if ((*cur_x).time == time) {
  289. fill.mValue.x = (*cur_x).value;
  290. if (cur_x != envl_x->keys.end()-1) /* increment x */
  291. ++cur_x;
  292. else end_x = true;
  293. }
  294. else DoInterpolation(cur_x,envl_x,time,(float&)fill.mValue.x);
  295. // get y
  296. if ((*cur_y).time == time) {
  297. fill.mValue.y = (*cur_y).value;
  298. if (cur_y != envl_y->keys.end()-1) /* increment y */
  299. ++cur_y;
  300. else end_y = true;
  301. }
  302. else DoInterpolation(cur_y,envl_y,time,(float&)fill.mValue.y);
  303. // get z
  304. if ((*cur_z).time == time) {
  305. fill.mValue.z = (*cur_z).value;
  306. if (cur_z != envl_z->keys.end()-1) /* increment z */
  307. ++cur_z;
  308. else end_x = true;
  309. }
  310. else DoInterpolation(cur_z,envl_z,time,(float&)fill.mValue.z);
  311. }
  312. // ------------------------------------------------------------------------------------------------
  313. // Build linearly subsampled keys from three single envelopes, one for each component (x,y,z)
  314. void AnimResolver::GetKeys(std::vector<aiVectorKey>& out,
  315. LWO::Envelope* _envl_x,
  316. LWO::Envelope* _envl_y,
  317. LWO::Envelope* _envl_z,
  318. unsigned int _flags)
  319. {
  320. envl_x = _envl_x;
  321. envl_y = _envl_y;
  322. envl_z = _envl_z;
  323. flags = _flags;
  324. // generate default channels if none are given
  325. LWO::Envelope def_x, def_y, def_z;
  326. LWO::Key key_dummy;
  327. key_dummy.time = 0.f;
  328. if ((envl_x && envl_x->type == LWO::EnvelopeType_Scaling_X) ||
  329. (envl_y && envl_y->type == LWO::EnvelopeType_Scaling_Y) ||
  330. (envl_z && envl_z->type == LWO::EnvelopeType_Scaling_Z)) {
  331. key_dummy.value = 1.f;
  332. }
  333. else key_dummy.value = 0.f;
  334. if (!envl_x) {
  335. envl_x = &def_x;
  336. envl_x->keys.push_back(key_dummy);
  337. }
  338. if (!envl_y) {
  339. envl_y = &def_y;
  340. envl_y->keys.push_back(key_dummy);
  341. }
  342. if (!envl_z) {
  343. envl_z = &def_z;
  344. envl_z->keys.push_back(key_dummy);
  345. }
  346. // guess how many keys we'll get
  347. size_t reserve;
  348. double sr = 1.;
  349. if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
  350. if (!sample_rate)
  351. sr = 100.f;
  352. else sr = sample_rate;
  353. sample_delta = 1.f / sr;
  354. reserve = (size_t)(
  355. std::max( envl_x->keys.rbegin()->time,
  356. std::max( envl_y->keys.rbegin()->time, envl_z->keys.rbegin()->time )) * sr);
  357. }
  358. else reserve = std::max(envl_x->keys.size(),std::max(envl_x->keys.size(),envl_z->keys.size()));
  359. out.reserve(reserve+(reserve>>1));
  360. // Iterate through all three arrays at once - it's tricky, but
  361. // rather interesting to implement.
  362. double lasttime = std::min(envl_x->keys[0].time,std::min(envl_y->keys[0].time,envl_z->keys[0].time));
  363. cur_x = envl_x->keys.begin();
  364. cur_y = envl_y->keys.begin();
  365. cur_z = envl_z->keys.begin();
  366. end_x = end_y = end_z = false;
  367. while (1) {
  368. aiVectorKey fill;
  369. if ((*cur_x).time == (*cur_y).time && (*cur_x).time == (*cur_z).time ) {
  370. // we have a keyframe for all of them defined .. great,
  371. // we don't need to fucking interpolate here ...
  372. fill.mTime = (*cur_x).time;
  373. fill.mValue.x = (*cur_x).value;
  374. fill.mValue.y = (*cur_y).value;
  375. fill.mValue.z = (*cur_z).value;
  376. // subsample animation track
  377. if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
  378. //SubsampleAnimTrack(out,cur_x, cur_y, cur_z, d, sample_delta);
  379. }
  380. }
  381. // Find key with lowest time value
  382. else if ((*cur_x).time <= (*cur_y).time && !end_x) {
  383. if ((*cur_z).time <= (*cur_x).time && !end_z) {
  384. InterpolateTrack(out,fill,(*cur_z).time);
  385. }
  386. else {
  387. InterpolateTrack(out,fill,(*cur_x).time);
  388. }
  389. }
  390. else if ((*cur_z).time <= (*cur_y).time && !end_y) {
  391. InterpolateTrack(out,fill,(*cur_y).time);
  392. }
  393. else if (!end_y) {
  394. // welcome on the server, y
  395. InterpolateTrack(out,fill,(*cur_y).time);
  396. }
  397. else {
  398. // we have reached the end of at least 2 channels,
  399. // only one is remaining. Extrapolate the 2.
  400. if (end_y) {
  401. InterpolateTrack(out,fill,(end_x ? (*cur_z) : (*cur_x)).time);
  402. }
  403. else if (end_x) {
  404. InterpolateTrack(out,fill,(end_z ? (*cur_y) : (*cur_z)).time);
  405. }
  406. else { // if (end_z)
  407. InterpolateTrack(out,fill,(end_y ? (*cur_x) : (*cur_y)).time);
  408. }
  409. }
  410. lasttime = fill.mTime;
  411. out.push_back(fill);
  412. if (lasttime >= (*cur_x).time) {
  413. if (cur_x != envl_x->keys.end()-1)
  414. ++cur_x;
  415. else end_x = true;
  416. }
  417. if (lasttime >= (*cur_y).time) {
  418. if (cur_y != envl_y->keys.end()-1)
  419. ++cur_y;
  420. else end_y = true;
  421. }
  422. if (lasttime >= (*cur_z).time) {
  423. if (cur_z != envl_z->keys.end()-1)
  424. ++cur_z;
  425. else end_z = true;
  426. }
  427. if( end_x && end_y && end_z ) /* finished? */
  428. break;
  429. }
  430. if (flags & AI_LWO_ANIM_FLAG_START_AT_ZERO) {
  431. for (std::vector<aiVectorKey>::iterator it = out.begin(); it != out.end(); ++it)
  432. (*it).mTime -= first;
  433. }
  434. }
  435. // ------------------------------------------------------------------------------------------------
  436. // Extract animation channel
  437. void AnimResolver::ExtractAnimChannel(aiNodeAnim** out, unsigned int flags /*= 0*/)
  438. {
  439. *out = NULL;
  440. //FIXME: crashes if more than one component is animated at different timings, to be resolved.
  441. // If we have no envelopes, return NULL
  442. if (envelopes.empty()) {
  443. return;
  444. }
  445. // We won't spawn an animation channel if we don't have at least one envelope with more than one keyframe defined.
  446. const bool trans = ((trans_x && trans_x->keys.size() > 1) || (trans_y && trans_y->keys.size() > 1) || (trans_z && trans_z->keys.size() > 1));
  447. const bool rotat = ((rotat_x && rotat_x->keys.size() > 1) || (rotat_y && rotat_y->keys.size() > 1) || (rotat_z && rotat_z->keys.size() > 1));
  448. const bool scale = ((scale_x && scale_x->keys.size() > 1) || (scale_y && scale_y->keys.size() > 1) || (scale_z && scale_z->keys.size() > 1));
  449. if (!trans && !rotat && !scale)
  450. return;
  451. // Allocate the output animation
  452. aiNodeAnim* anim = *out = new aiNodeAnim();
  453. // Setup default animation setup if necessary
  454. if (need_to_setup) {
  455. UpdateAnimRangeSetup();
  456. need_to_setup = false;
  457. }
  458. // copy translation keys
  459. if (trans) {
  460. std::vector<aiVectorKey> keys;
  461. GetKeys(keys,trans_x,trans_y,trans_z,flags);
  462. anim->mPositionKeys = new aiVectorKey[ anim->mNumPositionKeys = keys.size() ];
  463. std::copy(keys.begin(),keys.end(),anim->mPositionKeys);
  464. }
  465. // copy rotation keys
  466. if (rotat) {
  467. std::vector<aiVectorKey> keys;
  468. GetKeys(keys,rotat_x,rotat_y,rotat_z,flags);
  469. anim->mRotationKeys = new aiQuatKey[ anim->mNumRotationKeys = keys.size() ];
  470. // convert heading, pitch, bank to quaternion
  471. // mValue.x=Heading=Rot(Y), mValue.y=Pitch=Rot(X), mValue.z=Bank=Rot(Z)
  472. // Lightwave's rotation order is ZXY
  473. aiVector3D X(1.0,0.0,0.0);
  474. aiVector3D Y(0.0,1.0,0.0);
  475. aiVector3D Z(0.0,0.0,1.0);
  476. for (unsigned int i = 0; i < anim->mNumRotationKeys; ++i) {
  477. aiQuatKey& qk = anim->mRotationKeys[i];
  478. qk.mTime = keys[i].mTime;
  479. qk.mValue = aiQuaternion(Y,keys[i].mValue.x)*aiQuaternion(X,keys[i].mValue.y)*aiQuaternion(Z,keys[i].mValue.z);
  480. }
  481. }
  482. // copy scaling keys
  483. if (scale) {
  484. std::vector<aiVectorKey> keys;
  485. GetKeys(keys,scale_x,scale_y,scale_z,flags);
  486. anim->mScalingKeys = new aiVectorKey[ anim->mNumScalingKeys = keys.size() ];
  487. std::copy(keys.begin(),keys.end(),anim->mScalingKeys);
  488. }
  489. }
  490. #endif // no lwo or no lws