- Removed Boost_MultiArray-Remake
- Fixed rotation matrix to quaternion conversion, hopefully final this time. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@196 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
67be21715d
commit
a62b94079f
|
@ -106,16 +106,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
# include "../include/BoostWorkaround/boost/scoped_ptr.hpp"
|
# include "../include/BoostWorkaround/boost/scoped_ptr.hpp"
|
||||||
# include "../include/BoostWorkaround/boost/format.hpp"
|
# include "../include/BoostWorkaround/boost/format.hpp"
|
||||||
# include "../include/BoostWorkaround/boost/multi_array.hpp"
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// NOTE: boost::multi_array is nto yet supported by the workaround
|
|
||||||
#define AI_BUILD_NO_BVH_IMPORTER
|
|
||||||
|
|
||||||
# include <boost/scoped_ptr.hpp>
|
# include <boost/scoped_ptr.hpp>
|
||||||
# include <boost/format.hpp>
|
# include <boost/format.hpp>
|
||||||
# include <boost/multi_array.hpp>
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ inline aiQuaternion::aiQuaternion( const aiMatrix3x3 &pRotMatrix)
|
||||||
float t = 1 + pRotMatrix.a1 + pRotMatrix.b2 + pRotMatrix.c3;
|
float t = 1 + pRotMatrix.a1 + pRotMatrix.b2 + pRotMatrix.c3;
|
||||||
|
|
||||||
// large enough
|
// large enough
|
||||||
if( t > 0.00001f)
|
if( t > 0.001f)
|
||||||
{
|
{
|
||||||
float s = sqrt( t) * 2.0f;
|
float s = sqrt( t) * 2.0f;
|
||||||
x = (pRotMatrix.b3 - pRotMatrix.c2) / s;
|
x = (pRotMatrix.b3 - pRotMatrix.c2) / s;
|
||||||
|
@ -98,29 +98,29 @@ inline aiQuaternion::aiQuaternion( const aiMatrix3x3 &pRotMatrix)
|
||||||
} // else we have to check several cases
|
} // else we have to check several cases
|
||||||
else if( pRotMatrix.a1 > pRotMatrix.b2 && pRotMatrix.a1 > pRotMatrix.c3 )
|
else if( pRotMatrix.a1 > pRotMatrix.b2 && pRotMatrix.a1 > pRotMatrix.c3 )
|
||||||
{
|
{
|
||||||
// Column 0:
|
// Column 0:
|
||||||
float s = sqrt( 1.0f + pRotMatrix.a1 - pRotMatrix.b2 - pRotMatrix.c3) * 2.0f;
|
float s = sqrt( 1.0f + pRotMatrix.a1 - pRotMatrix.b2 - pRotMatrix.c3) * 2.0f;
|
||||||
x = -0.25f * s;
|
x = 0.25f * s;
|
||||||
y = (pRotMatrix.a2 + pRotMatrix.b1) / s;
|
y = (pRotMatrix.a2 + pRotMatrix.b1) / s;
|
||||||
z = (pRotMatrix.c1 + pRotMatrix.a3) / s;
|
z = (pRotMatrix.c1 + pRotMatrix.a3) / s;
|
||||||
w = (pRotMatrix.c2 - pRotMatrix.b3) / s;
|
w = (pRotMatrix.b3 - pRotMatrix.c2) / s;
|
||||||
}
|
}
|
||||||
else if( pRotMatrix.b2 > pRotMatrix.c3)
|
else if( pRotMatrix.b2 > pRotMatrix.c3)
|
||||||
{
|
{
|
||||||
// Column 1:
|
// Column 1:
|
||||||
float s = sqrt( 1.0f + pRotMatrix.b2 - pRotMatrix.a1 - pRotMatrix.c3) * 2.0f;
|
float s = sqrt( 1.0f + pRotMatrix.b2 - pRotMatrix.a1 - pRotMatrix.c3) * 2.0f;
|
||||||
x = (pRotMatrix.a2 + pRotMatrix.b1) / s;
|
x = (pRotMatrix.a2 + pRotMatrix.b1) / s;
|
||||||
y = -0.25f * s;
|
y = 0.25f * s;
|
||||||
z = (pRotMatrix.b3 + pRotMatrix.c2) / s;
|
z = (pRotMatrix.b3 + pRotMatrix.c2) / s;
|
||||||
w = (pRotMatrix.a3 - pRotMatrix.c1) / s;
|
w = (pRotMatrix.c1 - pRotMatrix.a3) / s;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// Column 2:
|
// Column 2:
|
||||||
float s = sqrt( 1.0f + pRotMatrix.c3 - pRotMatrix.a1 - pRotMatrix.b2) * 2.0f;
|
float s = sqrt( 1.0f + pRotMatrix.c3 - pRotMatrix.a1 - pRotMatrix.b2) * 2.0f;
|
||||||
x = (pRotMatrix.c1 + pRotMatrix.a3) / s;
|
x = (pRotMatrix.c1 + pRotMatrix.a3) / s;
|
||||||
y = (pRotMatrix.b3 + pRotMatrix.c2) / s;
|
y = (pRotMatrix.b3 + pRotMatrix.c2) / s;
|
||||||
z = -0.25f * s;
|
z = 0.25f * s;
|
||||||
w = (pRotMatrix.b1 - pRotMatrix.a2) / s;
|
w = (pRotMatrix.a2 - pRotMatrix.b1) / s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -726,10 +726,6 @@
|
||||||
RelativePath="..\..\include\BoostWorkaround\boost\format.hpp"
|
RelativePath="..\..\include\BoostWorkaround\boost\format.hpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\include\BoostWorkaround\boost\multi_array.hpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\include\BoostWorkaround\boost\scoped_ptr.hpp"
|
RelativePath="..\..\include\BoostWorkaround\boost\scoped_ptr.hpp"
|
||||||
>
|
>
|
||||||
|
@ -1724,6 +1720,14 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\code\SkeletonMeshBuilder.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\code\SkeletonMeshBuilder.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
|
|
Loading…
Reference in New Issue