MF_back etc

This commit is contained in:
David Rose 2011-11-07 20:06:42 +00:00
parent 2a3ad0d4e5
commit ead8b03712
2 changed files with 14 additions and 5 deletions

View File

@ -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);
}

View File

@ -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;