Fixed camera FOV computation in the ColladaLoader.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@675 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
5bcde55c18
commit
35c97d169e
|
@ -358,12 +358,14 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col
|
||||||
if (srcCamera->mHorFov != 10e10f) {
|
if (srcCamera->mHorFov != 10e10f) {
|
||||||
out->mHorizontalFOV = srcCamera->mHorFov;
|
out->mHorizontalFOV = srcCamera->mHorFov;
|
||||||
|
|
||||||
if (srcCamera->mVerFov != 10e10f && srcCamera->mAspect != 10e10f) {
|
if (srcCamera->mVerFov != 10e10f && srcCamera->mAspect == 10e10f) {
|
||||||
out->mAspect = srcCamera->mHorFov/srcCamera->mVerFov;
|
out->mAspect = tan(AI_DEG_TO_RAD(srcCamera->mHorFov)) /
|
||||||
|
tan(AI_DEG_TO_RAD(srcCamera->mVerFov));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (srcCamera->mAspect != 10e10f && srcCamera->mVerFov != 10e10f) {
|
else if (srcCamera->mAspect != 10e10f && srcCamera->mVerFov != 10e10f) {
|
||||||
out->mHorizontalFOV = srcCamera->mAspect*srcCamera->mVerFov;
|
out->mHorizontalFOV = 2.0f * AI_RAD_TO_DEG(atan(srcCamera->mAspect *
|
||||||
|
tan(AI_DEG_TO_RAD(srcCamera->mVerFov) * 0.5f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collada uses degrees, we use radians
|
// Collada uses degrees, we use radians
|
||||||
|
|
Loading…
Reference in New Issue