00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 // Copyright (C) 2010 Daniele Giannetti 00012 // 00013 // This file is part of VR3Lib. 00014 // The VR3Lib is free software, but is distributed in the static precompiled 00015 // version as it is NOT open source. The VR3Lib may be used in any virtual 00016 // reality application free of charge, but it must be clearly stated that this 00017 // library is used in the application EULA and distribution license 00018 // (for both free and proprietary applications). 00020 00021 #ifndef __VR3PHYMESH_H__ 00022 #define __VR3PHYMESH_H__ 00023 00024 // windows only 00025 #if (defined(_WIN32) || defined(_WIN64)) && !defined(VR3CONF_NOPHYSICS) 00026 00027 // PhysX interface include (typedefs and constants) 00028 #include <PhysX/NxVR3Interface.h> 00029 00030 #include <string> 00031 00033 00068 class VR3PhyMesh { 00070 friend class VR3PhyMeshManager; 00072 friend class VR3PhysicsSimulator; 00073 00075 struct Shape { 00077 int ID; 00079 NxU32 vernum; 00081 NxReal* vertices; 00083 NxU32 trinum; 00085 NxU32* indices; 00086 00088 00090 Shape(); 00091 }; 00092 00094 00095 00097 int m_simtype; 00099 int m_shapenum; 00101 Shape* m_shapes; 00103 NxReal m_mass; 00105 NxReal m_sfri; 00107 NxReal m_dfri; 00109 NxReal m_bou; 00111 NxReal m_bbox_size[3]; 00112 00114 00116 00117 00119 std::string m_meshfile; 00121 std::string m_name; 00123 int m_ID; 00124 00126 00128 VR3PhyMesh(const VR3PhyMesh&); 00130 VR3PhyMesh& operator = (const VR3PhyMesh&); 00131 00132 //-------------------------------- Destructor --------------------------------// 00133 00135 00136 00138 00143 ~VR3PhyMesh(); 00144 00146 00147 public: 00148 00149 //------------------------------- Constructor --------------------------------// 00150 00152 00153 00155 00168 VR3PhyMesh(const char* file_name, const char* mesh_name = 0, int objID = -1); 00169 00171 00172 //--------------------------- Destroying Function ----------------------------// 00173 00175 00176 00178 00187 void Destroy(); 00188 00190 00191 }; 00192 00193 #endif // windows only 00194 00195 #endif