From ead8b03712c20a95cfa629faf98ac091ec54b41a Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 7 Nov 2011 20:06:42 +0000 Subject: [PATCH] MF_back etc --- panda/src/grutil/pfmFile.cxx | 11 +++++++---- panda/src/grutil/pfmFile.h | 8 +++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/panda/src/grutil/pfmFile.cxx b/panda/src/grutil/pfmFile.cxx index 5965064981..9f4c950273 100755 --- a/panda/src/grutil/pfmFile.cxx +++ b/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); } diff --git a/panda/src/grutil/pfmFile.h b/panda/src/grutil/pfmFile.h index 2f438b31eb..4d66fcc8c3 100755 --- a/panda/src/grutil/pfmFile.h +++ b/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;