Browse Source

MF_back etc

David Rose 14 years ago
parent
commit
ead8b03712
2 changed files with 14 additions and 5 deletions
  1. 7 4
      panda/src/grutil/pfmFile.cxx
  2. 7 1
      panda/src/grutil/pfmFile.h

+ 7 - 4
panda/src/grutil/pfmFile.cxx

@@ -532,7 +532,7 @@ xform(const LMatrix4 &transform) {
 //               projecting it through the indicated lens, converting
 //               each point to a (u, v, 0) texture coordinate.  The
 //               resulting file can be generated to a mesh (with
-//               set_vis_inverse(true) and generate_vis_mesh(true))
+//               set_vis_inverse(true) and generate_vis_mesh())
 //               that will apply the lens distortion to an arbitrary
 //               texture image.
 ////////////////////////////////////////////////////////////////////
@@ -719,14 +719,17 @@ generate_vis_points() const {
 //               pfm grid.
 ////////////////////////////////////////////////////////////////////
 NodePath PfmFile::
-generate_vis_mesh(bool double_sided) const {
+generate_vis_mesh(MeshFace face) const {
   nassertr(is_valid(), NodePath());
+  nassertr(face != 0, NodePath());
   
   PT(GeomNode) gnode = new GeomNode("");
 
-  make_vis_mesh_geom(gnode, false);
+  if (face & MF_front) {
+    make_vis_mesh_geom(gnode, false);
+  }
 
-  if (double_sided) {
+  if (face & MF_back) {
     make_vis_mesh_geom(gnode, true);
   }
 

+ 7 - 1
panda/src/grutil/pfmFile.h

@@ -73,7 +73,13 @@ PUBLISHED:
   INLINE bool get_vis_2d() const;
 
   NodePath generate_vis_points() const;
-  NodePath generate_vis_mesh(bool double_sided) const;
+
+  enum MeshFace {
+    MF_front = 0x01,
+    MF_back  = 0x02,
+    MF_both  = 0x03,
+  };
+  NodePath generate_vis_mesh(MeshFace face = MF_front) const;
 
 private:
   void make_vis_mesh_geom(GeomNode *gnode, bool inverted) const;