ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining) Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now. Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed. Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore. Further work on the MDR loader, still WIP. Moved DeterminePType-Step to ScenePreprocessor. aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1. Fixes in the SMD loader. Still crashes on some files. Updated animation documentation. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -98,10 +98,41 @@ void ScenePreprocessor::ProcessMesh (aiMesh* mesh)
|
||||
// ---------------------------------------------------------------------------
|
||||
void ScenePreprocessor::ProcessAnimation (aiAnimation* anim)
|
||||
{
|
||||
double first = 10e10, last = -10e10;
|
||||
for (unsigned int i = 0; i < anim->mNumChannels;++i)
|
||||
{
|
||||
aiNodeAnim* channel = anim->mChannels[i];
|
||||
|
||||
/* If the exact duration of the animation is not given
|
||||
* compute it now.
|
||||
*/
|
||||
if (anim->mDuration == -1.)
|
||||
{
|
||||
// Position keys
|
||||
for (unsigned int i = 0; i < channel->mNumPositionKeys;++i)
|
||||
{
|
||||
aiVectorKey& key = channel->mPositionKeys[i];
|
||||
first = std::min (first, key.mTime);
|
||||
last = std::max (last, key.mTime);
|
||||
}
|
||||
|
||||
// Scaling keys
|
||||
for (unsigned int i = 0; i < channel->mNumScalingKeys;++i)
|
||||
{
|
||||
aiVectorKey& key = channel->mScalingKeys[i];
|
||||
first = std::min (first, key.mTime);
|
||||
last = std::max (last, key.mTime);
|
||||
}
|
||||
|
||||
// Rotation keys
|
||||
for (unsigned int i = 0; i < channel->mNumRotationKeys;++i)
|
||||
{
|
||||
aiQuatKey& key = channel->mRotationKeys[i];
|
||||
first = std::min (first, key.mTime);
|
||||
last = std::max (last, key.mTime);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check whether the animation channel has no rotation
|
||||
* or position tracks. In this case we generate a dummy
|
||||
* track from the information we have in the transformation
|
||||
@@ -160,4 +191,9 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (anim->mDuration == -1.)
|
||||
{
|
||||
DefaultLogger::get()->debug("Setting animation duration");
|
||||
anim->mDuration = last - first;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user