Go to the documentation of this file.00001
00019
00020 class NxActor;
00021
00022 namespace Ovgl
00023 {
00024 enum Clean { CLEAN_ALL, STRAY_VERTICES, CLOSE_VERTICES, BROKEN_FACES };
00025
00026 class Vertex;
00027 class Face;
00028 class Bone;
00029 class Joint;
00030 class Animation;
00031 class Frame;
00032 class Key;
00033 class CMesh;
00034 class Mesh;
00035 class Instance;
00036 class Scene;
00037 class Matrix44;
00038
00039 extern "C"
00040 {
00045 class __declspec(dllexport) Vertex
00046 {
00047 public:
00048 Ovgl::Vector3 position;
00049 Ovgl::Vector3 normal;
00050 Ovgl::Vector2 texture;
00051 Ovgl::Vector4 weight;
00052 Ovgl::Vector4 indices;
00053 bool operator == (const Vertex&) const;
00054 bool operator != (const Vertex&) const;
00055 };
00060 class __declspec(dllexport) Face
00061 {
00062 public:
00063 DWORD indices[3];
00064 Face Flip();
00065 };
00066
00067 class __declspec(dllexport) Key
00068 {
00069 public:
00070 DWORD index;
00071 Vector4 rotation;
00072 };
00073
00074 class __declspec(dllexport) Frame
00075 {
00076 public:
00077 DWORD time;
00078 std::vector<Key> keys;
00079 };
00080
00081 class __declspec(dllexport) Animation
00082 {
00083 public:
00084 std::vector<Joint*> joints;
00085 DWORD animationState;
00086 float currentTime;
00087 float startTime;
00088 float endTime;
00089 float stepTime;
00090 void play( float speed, bool repeat );
00091 void stop();
00092 void pause();
00093 void set( float time );
00094 };
00095
00096 class __declspec(dllexport) Bone
00097 {
00098 public:
00099 NxConvexMesh* convex;
00100 Mesh* mesh;
00101 Matrix44 matrix;
00102 float length;
00103 Ovgl::Vector3 min;
00104 Ovgl::Vector3 max;
00105 DWORD parent;
00106 std::vector<DWORD> childen;
00107 };
00108
00109 class __declspec(dllexport) CMesh
00110 {
00111 public:
00112 Scene* scene;
00113 NxActor* actor;
00114 void setPose( Matrix44* matrix );
00115 Matrix44 getPose();
00116 void Release();
00117 };
00118
00119 class __declspec(dllexport) Mesh
00120 {
00121 public:
00122 Instance* Inst;
00123 std::vector<Vertex> vertices;
00124 std::vector<Face> faces;
00125 std::vector<DWORD> attributes;
00126 std::vector<Bone*> bones;
00127 std::vector<Frame*> keyframes;
00128 DWORD subset_count;
00129 DWORD root_bone;
00130 ID3D10Buffer* VertexBuffer;
00131 ID3D10Buffer** IndexBuffers;
00132 void Save( const std::string& file );
00133 void GenerateBoneMeshes();
00134 void GenerateVertexNormals();
00135 void CubeCloud( float sx, float sy, float sz, int count );
00136 void QuickHull();
00137 void Simplify( DWORD max_faces, DWORD max_vertices );
00138 void Clean( float min, DWORD flags );
00139 void ConnectVertex( std::vector<DWORD>& faceList, DWORD vertex );
00140 void MergeVerices( std::vector<DWORD>& vertexList, DWORD flag );
00141 Ovgl::Vector3 ComputeFaceNormal( DWORD face );
00142 void Update();
00143 void Release();
00144 };
00145 }
00146 }