TDME2  1.9.200
GenerateConvexMeshes.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #define ENABLE_VHACD_IMPLEMENTATION 1
7 #define VHACD_DISABLE_THREADING 0
8 #include <VHACD.h>
9 
10 #include <tdme/tdme.h>
15 
16 using std::string;
17 using std::vector;
18 
23 
24 /**
25  * Convex mesh generation class
26  */
28 {
29 public:
31 
32  /**
33  * Remove convex meshes
34  * @param prototype prototype
35  */
36  static void removeConvexMeshes(Prototype* prototype);
37 
38  /**
39  * Generateconvex meshes
40  * @param prototype prototype
41  * @param mode mode
42  * @param popUps pop ups which is optional
43  * @param pathName path name
44  * @param fileName file name
45  * @param convexMeshTMsData convex mesh TM data vectors
46  * @param parameters parameters
47  * @return success
48  */
49  static bool generateConvexMeshes(
50  Prototype* prototype,
51  Mode mode,
52  PopUps* popUps,
53  const string& pathName,
54  const string& fileName,
55  vector<vector<uint8_t>>& convexMeshTMsData,
56  VHACD::IVHACD::Parameters parameters = VHACD::IVHACD::Parameters()
57  );
58 
59 private:
60 
61  /**
62  * Create model
63  * @param id id
64  * @param points points
65  * @param triangles triangles
66  */
67  static Model* createModel(const string& id, const vector<VHACD::Vertex>& points, const vector<VHACD::Triangle>& triangles);
68 
69  /**
70  * Create model
71  * @param id id
72  * @param triangles triangles
73  */
74  static Model* createModel(const string& id, vector<Triangle>& triangles);
75 
76 };
Representation of a 3D model.
Definition: Model.h:35
Triangle entity, this is not directly connectable with physics engine.
Definition: Triangle.h:18
Prototype definition.
Definition: Prototype.h:55
static Model * createModel(const string &id, const vector< VHACD::Vertex > &points, const vector< VHACD::Triangle > &triangles)
Create model.
static bool generateConvexMeshes(Prototype *prototype, Mode mode, PopUps *popUps, const string &pathName, const string &fileName, vector< vector< uint8_t >> &convexMeshTMsData, VHACD::IVHACD::Parameters parameters=VHACD::IVHACD::Parameters())
Generateconvex meshes.
static void removeConvexMeshes(Prototype *prototype)
Remove convex meshes.
Pop ups controller accessor class.
Definition: PopUps.h:29