00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_SUBMESH_H
00012 #define CAL_SUBMESH_H
00013
00014
00015 #include "cal3d/global.h"
00016 #include "cal3d/vector.h"
00017
00018
00019 class CalCoreSubmesh;
00020
00021
00022 class CAL3D_API CalSubmesh
00023 {
00024 public:
00025 struct PhysicalProperty
00026 {
00027 CalVector position;
00028 CalVector positionOld;
00029 CalVector force;
00030 };
00031
00032 struct TangentSpace
00033 {
00034 CalVector tangent;
00035 float crossFactor;
00036 };
00037
00038 struct Face
00039 {
00040 CalIndex vertexId[3];
00041 };
00042
00043 public:
00044 CalSubmesh(CalCoreSubmesh* coreSubmesh);
00045 ~CalSubmesh() { }
00046
00047 CalCoreSubmesh *getCoreSubmesh();
00048 int getCoreMaterialId();
00049 int getFaceCount();
00050 int getFaces(CalIndex *pFaceBuffer);
00051 std::vector<CalVector>& getVectorNormal();
00052 std::vector<std::vector<TangentSpace> >& getVectorVectorTangentSpace();
00053 std::vector<PhysicalProperty>& getVectorPhysicalProperty();
00054 std::vector<CalVector>& getVectorVertex();
00055 int getVertexCount();
00056 bool hasInternalData();
00057 void disableInternalData();
00058 void setCoreMaterialId(int coreMaterialId);
00059 void setLodLevel(float lodLevel);
00060 bool isTangentsEnabled(int mapId);
00061 bool enableTangents(int mapId, bool enabled);
00062 std::vector<float>& getVectorWeight();
00063 void setMorphTargetWeight(int blendId,float weight);
00064 float getMorphTargetWeight(int blendId);
00065 float getBaseWeight();
00066 int getMorphTargetWeightCount();
00067 std::vector<float>& getVectorMorphTargetWeight();
00068
00069 private:
00070 CalCoreSubmesh *m_pCoreSubmesh;
00071 std::vector<float> m_vectorMorphTargetWeight;
00072 std::vector<CalVector> m_vectorVertex;
00073 std::vector<CalVector> m_vectorNormal;
00074 std::vector<std::vector<TangentSpace> > m_vectorvectorTangentSpace;
00075 std::vector<Face> m_vectorFace;
00076 std::vector<PhysicalProperty> m_vectorPhysicalProperty;
00077 int m_vertexCount;
00078 int m_faceCount;
00079 int m_coreMaterialId;
00080 bool m_bInternalData;
00081 };
00082
00083 #endif