root/OpenSceneGraph/trunk/src/osgPlugins/fbx/fbxReader.h @ 12337

Revision 12337, 2.4 kB (checked in by mplatings, 3 years ago)

Updated to use FBX SDK 2012.1

  • Property svn:eol-style set to native
Line 
1#ifndef FBXRANIMATION_H
2#define FBXRANIMATION_H
3
4#include <fbxfilesdk/fbxfilesdk_def.h>
5#include <osgDB/ReaderWriter>
6#include <osgAnimation/BasicAnimationManager>
7#include "fbxMaterialToOsgStateSet.h"
8
9namespace osgAnimation
10{
11    class AnimationManagerBase;
12    class RigGeometry;
13    class Skeleton;
14}
15
16typedef std::map<std::pair<KFbxNode*, osgAnimation::RigGeometry*>, osg::Matrix> BindMatrixMap;
17
18class OsgFbxReader
19{
20public:
21    KFbxSdkManager& pSdkManager;
22    KFbxScene& fbxScene;
23    osg::ref_ptr<osgAnimation::AnimationManagerBase> pAnimationManager;
24    FbxMaterialToOsgStateSet& fbxMaterialToOsgStateSet;
25    std::map<KFbxNode*, osg::Node*> nodeMap;
26    BindMatrixMap boneBindMatrices;
27    const std::set<const KFbxNode*>& fbxSkeletons;
28    std::map<KFbxNode*, osgAnimation::Skeleton*> skeletonMap;
29    const osgDB::Options& options;
30    bool lightmapTextures, tessellatePolygons;
31
32    enum AuthoringTool
33    {
34        UNKNOWN,
35        OPENSCENEGRAPH,
36        AUTODESK_3DSTUDIO_MAX
37    } authoringTool;
38
39    OsgFbxReader(
40        KFbxSdkManager& pSdkManager1,
41        KFbxScene& fbxScene1,
42        FbxMaterialToOsgStateSet& fbxMaterialToOsgStateSet1,
43        const std::set<const KFbxNode*>& fbxSkeletons1,
44        const osgDB::Options& options1,
45        AuthoringTool authoringTool1,
46        bool lightmapTextures1,
47        bool tessellatePolygons1)
48        : pSdkManager(pSdkManager1),
49        fbxScene(fbxScene1),
50        fbxMaterialToOsgStateSet(fbxMaterialToOsgStateSet1),
51        fbxSkeletons(fbxSkeletons1),
52        options(options1),
53        lightmapTextures(lightmapTextures1),
54        tessellatePolygons(tessellatePolygons1),
55        authoringTool(authoringTool1)
56    {}
57
58    osgDB::ReaderWriter::ReadResult readFbxNode(
59        KFbxNode*, bool& bIsBone, int& nLightCount);
60
61    std::string readFbxAnimation(
62        KFbxNode*, const char* targetName);
63
64    osgDB::ReaderWriter::ReadResult readFbxCamera(
65        KFbxNode* pNode);
66
67    osgDB::ReaderWriter::ReadResult readFbxLight(
68        KFbxNode* pNode, int& nLightCount);
69
70    osgDB::ReaderWriter::ReadResult readMesh(
71        KFbxNode* pNode, KFbxMesh* fbxMesh,
72        std::vector<StateSetContent>& stateSetList,
73        const char* szName);
74
75    osgDB::ReaderWriter::ReadResult readFbxMesh(
76        KFbxNode* pNode,
77        std::vector<StateSetContent>&);
78};
79
80osgAnimation::Skeleton* getSkeleton(KFbxNode*,
81    const std::set<const KFbxNode*>& fbxSkeletons,
82    std::map<KFbxNode*, osgAnimation::Skeleton*>&);
83
84#endif
Note: See TracBrowser for help on using the browser.