ASSIPのデータ構造

4561 ワード


データ構造は文書に対する説明であり、また私達が獲得したい最終製品でもあります.普通はこの結果を使って自分達のモデルにマッピングします.
1.aiScene:ルートノード
struct aiScene
{
	unsigned int mFlags;  //      
	C_STRUCT aiNode* mRootNode;  //    
        //   
	unsigned int mNumMeshes;
	C_STRUCT aiMesh** mMeshes;
        //  
	unsigned int mNumMaterials;
	C_STRUCT aiMaterial** mMaterials;
        //  
	unsigned int mNumAnimations; 
	C_STRUCT aiAnimation** mAnimations;
        //  
	unsigned int mNumTextures;
	C_STRUCT aiTexture** mTextures;
        //  
	unsigned int mNumLights;
	C_STRUCT aiLight** mLights;
        //   
	unsigned int mNumCameras;
	C_STRUCT aiCamera** mCameras;
};
この構造はとても簡潔です.
2.aiNode:
struct aiNode
{
	C_STRUCT aiString mName; //   
	C_STRUCT aiMatrix4x4 mTransformation; //       
	C_STRUCT aiNode* mParent; //    
        //     
	unsigned int mNumChildren;
	C_STRUCT aiNode** mChildren;
        //   
	unsigned int mNumMeshes;
	unsigned int* mMeshes;
};
3.aiMesh:グリッド
struct aiMesh
{
	unsigned int mPrimitiveTypes;
	unsigned int mNumVertices; //    
	unsigned int mNumFaces;   //   
	C_STRUCT aiVector3D* mVertices;  //     
	C_STRUCT aiVector3D* mNormals;  //      
	C_STRUCT aiVector3D* mTangents; //     
	C_STRUCT aiVector3D* mBitangents; //      
	C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS]; //       
	C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS]; //        (u,v)
	unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];//??
	C_STRUCT aiFace* mFaces; //    
	unsigned int mMaterialIndex; //     
	C_STRUCT aiString mName; //  
        //   
	unsigned int mNumBones; 
	C_STRUCT aiBone** mBones; 
        //  (          )
	unsigned int mNumAnimMeshes;
	C_STRUCT aiAnimMesh** mAnimMeshes;
};
4.aiMaterial:材質はテンプレートデータ構造で、材質自体はN多属性です.
5.aiTexture:
struct aiTexture
{
	unsigned int mWidth;
	unsigned int mHeight;
	char achFormatHint[4]; //          ['dds\\0', 'pcx\\0', 'jpg\\0']
	C_STRUCT aiTexel* pcData; //     
};

struct aiTexel
{
	unsigned char b,g,r,a;  //                 
} 
6.aiAnimation:アニメーション
struct aiAnimation
{
	C_STRUCT aiString mName;
	double mDuration;
	double mTicksPerSecond;
        //      ,          
	unsigned int mNumChannels;
	C_STRUCT aiNodeAnim** mChannels;
        //      
	unsigned int mNumMeshChannels;
	C_STRUCT aiMeshAnim** mMeshChannels;
};
 6.1 アイノードアニメーション
struct aiNodeAnim
{
	C_STRUCT aiString mNodeName;
        //     
	unsigned int mNumPositionKeys;
	C_STRUCT aiVectorKey* mPositionKeys;  
        //     
	unsigned int mNumRotationKeys;
	C_STRUCT aiQuatKey* mRotationKeys;
        //     
	unsigned int mNumScalingKeys;
	C_STRUCT aiVectorKey* mScalingKeys;

	C_ENUM aiAnimBehaviour mPreState;
	C_ENUM aiAnimBehaviour mPostState;
};

struct aiVectorKey //   
{
	double mTime;  //   
	C_STRUCT aiVector3D mValue;  //  
};

struct aiQuatKey  //     
{
	double mTime;  //   
	C_STRUCT aiQuaternion mValue;  // 
};
6.2 aiMesh Anim:グリッド動画
struct aiMeshAnim 
{
	C_STRUCT aiString mName;
        //              
	unsigned int mNumKeys;
	C_STRUCT aiMeshKey* mKeys;
};

struct aiMeshKey //    
{
	double mTime;  //   
	unsigned int mValue; //   (        )
};
7.aiLight:光源
struct aiLight
{
	C_STRUCT aiString mName;
	C_ENUM aiLightSourceType mType; //      4 
	C_STRUCT aiVector3D mPosition; //   
	C_STRUCT aiVector3D mDirection; //   
        //     ,  =1/(att0+ ATT1* D+ ATT2* D* D),D   
	float mAttenuationConstant; // att0
	float mAttenuationLinear;      // ATT1
	float mAttenuationQuadratic; // ATT2
	C_STRUCT aiColor3D mColorDiffuse; //        
	C_STRUCT aiColor3D mColorSpecular; //       
	C_STRUCT aiColor3D mColorAmbient; //       
        //       aiLightSource_SPOT(   )     
	float mAngleInnerCone; //     
	float mAngleOuterCone; //     
};

enum aiLightSourceType //      
{
	aiLightSource_UNDEFINED     = 0x0,   //    
	aiLightSource_DIRECTIONAL   = 0x1,  //     ,        
	aiLightSource_POINT         = 0x2,        //    
	aiLightSource_SPOT          = 0x3,        //        
};
 8.aiCamera:カメラ
struct aiCamera
{
	C_STRUCT aiString mName; //   
	C_STRUCT aiVector3D mPosition; //      ,   0|0|0
	C_STRUCT aiVector3D mUp;         //      ,   0| 1 | 0
	C_STRUCT aiVector3D mLookAt;  //     ,   0|0|1
	float mHorizontalFOV; //             1/4PI
	float mClipPlaneNear; //       ,    0.1f.
	float mClipPlaneFar;   //        ,    1000.f..
	float mAspect; //       ,      
};