aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/shared/general/RenderDebug/include/Hull2MeshEdges.h
diff options
context:
space:
mode:
authorgit perforce import user <a@b>2016-10-25 12:29:14 -0600
committerSheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees>2016-10-25 18:56:37 -0500
commit3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch)
treefa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/shared/general/RenderDebug/include/Hull2MeshEdges.h
downloadphysx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz
physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip
Initial commit:
PhysX 3.4.0 Update @ 21294896 APEX 1.4.0 Update @ 21275617 [CL 21300167]
Diffstat (limited to 'APEX_1.4/shared/general/RenderDebug/include/Hull2MeshEdges.h')
-rw-r--r--APEX_1.4/shared/general/RenderDebug/include/Hull2MeshEdges.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/APEX_1.4/shared/general/RenderDebug/include/Hull2MeshEdges.h b/APEX_1.4/shared/general/RenderDebug/include/Hull2MeshEdges.h
new file mode 100644
index 00000000..90b1954e
--- /dev/null
+++ b/APEX_1.4/shared/general/RenderDebug/include/Hull2MeshEdges.h
@@ -0,0 +1,46 @@
+#ifndef Hull2MESHEDGES_H
+
+#define Hull2MESHEDGES_H
+
+// This is a small code snippet which will take a convex hull described as an array of plane equations and, from that,
+// produce either an edge list (for wireframe debug visualization) or a triangle mesh.
+
+#include "PxVec3.h"
+#include "PxPlane.h"
+
+struct HullEdge
+{
+ physx::PxVec3 e0,e1;
+};
+
+struct HullMesh
+{
+ uint32_t mVertexCount;
+ uint32_t mTriCount;
+ const physx::PxVec3 *mVertices;
+ const uint16_t *mIndices;
+};
+
+class Hull2MeshEdges
+{
+public:
+ // Convert convex hull into a list of edges.
+ virtual const HullEdge *getHullEdges(uint32_t planeCount, // Number of source planes
+ const physx::PxPlane *planes, // The array of plane equations
+ uint32_t &edgeCount) = 0; // Contains the number of edges built
+
+ virtual bool getHullMesh(uint32_t planeCount, // Number of source planes
+ const physx::PxPlane *planes, // The array of plane equations
+ HullMesh &m) = 0; // The triangle mesh produced
+
+ virtual void release(void) = 0;
+protected:
+ virtual ~Hull2MeshEdges(void)
+ {
+
+ }
+};
+
+Hull2MeshEdges *createHull2MeshEdges(void);
+
+#endif