From Alessandro Terenzi: modifications for supporting opacity, reflective and emissive maps beyond the already supported diffuse map in the FBX plugin.

A problem with transparency has also been fixed: objects were transparent wrt themselves but were opaque wrt to other objects.
Finally I added the support for "mixing factors" of diffuse, reflective and opacity textures/values.

From Michael Platings: added "LightmapTextures" plugin option that changes the way textures are interpreted so Alessandro's models appear correctly. Also refactored to put many functions in one class to avoid passing around too many arguments to functions.
This commit is contained in:
Michael PLATINGS
2010-06-04 19:50:32 +00:00
parent af3bc7903e
commit 359b6b480d
16 changed files with 547 additions and 199 deletions

View File

@@ -11,6 +11,8 @@
#include <fbxsdk.h>
#include <fbxfilesdk/fbxfilesdk_nsuse.h>
#include "fbxReader.h"
osg::Quat makeQuat(const fbxDouble3&, ERotationOrder);
osg::Quat makeQuat(const osg::Vec3& radians, ERotationOrder fbxRotOrder)
@@ -219,10 +221,7 @@ osgAnimation::Animation* readFbxAnimation(KFbxNode* pNode,
return addChannels(pTranslationChannel, pRotationChannel, pScaleChannel, pAnimManager, pTakeName);
}
std::string readFbxAnimation(KFbxNode* pNode,
KFbxScene& fbxScene,
osg::ref_ptr<osgAnimation::AnimationManagerBase>& pAnimManager,
const char* targetName)
std::string OsgFbxReader::readFbxAnimation(KFbxNode* pNode, const char* targetName)
{
std::string result;
for (int i = 0; i < fbxScene.GetSrcObjectCount(FBX_TYPE(KFbxAnimStack)); ++i)
@@ -240,8 +239,8 @@ std::string readFbxAnimation(KFbxNode* pNode,
{
KFbxAnimLayer* pAnimLayer = pAnimStack->GetMember(FBX_TYPE(KFbxAnimLayer), j);
if (osgAnimation::Animation* pAnimation = readFbxAnimation(
pNode, pAnimLayer, pTakeName, targetName, pAnimManager))
if (osgAnimation::Animation* pAnimation = ::readFbxAnimation(
pNode, pAnimLayer, pTakeName, targetName, pAnimationManager))
{
result = targetName;
}