14#ifndef PROJECTIONSCREEN_H
15#define PROJECTIONSCREEN_H
48class EXPCL_PANDAFX ProjectionScreen :
public PandaNode {
50 explicit ProjectionScreen(
const std::string &name =
"");
51 virtual ~ProjectionScreen();
54 ProjectionScreen(
const ProjectionScreen ©);
69 PT(
GeomNode) generate_screen(
const NodePath &projector,
70 const std::string &screen_name,
71 int num_x_verts,
int num_y_verts,
72 PN_stdfloat distance, PN_stdfloat fill_ratio);
74 int num_x_verts,
int num_y_verts, PN_stdfloat distance,
75 PN_stdfloat fill_ratio);
76 PT(PandaNode) make_flat_mesh(
const NodePath &this_np,
const NodePath &camera);
104 void do_recompute(
const NodePath &this_np);
105 void recompute_node(
const WorkingNodePath &np, LMatrix4 &rel_mat,
bool &computed_rel_mat);
106 void recompute_child(
const WorkingNodePath &np, LMatrix4 &rel_mat,
bool &computed_rel_mat);
107 void recompute_geom_node(
const WorkingNodePath &np, LMatrix4 &rel_mat,
bool &computed_rel_mat);
108 void recompute_geom(
Geom *geom,
const LMatrix4 &rel_mat);
111 make_mesh_node(PandaNode *result_parent,
const WorkingNodePath &np,
112 const NodePath &camera,
113 LMatrix4 &rel_mat,
bool &computed_rel_mat);
114 void make_mesh_children(PandaNode *new_node,
const WorkingNodePath &np,
115 const NodePath &camera,
116 LMatrix4 &rel_mat,
bool &computed_rel_mat);
117 PT(
GeomNode) make_mesh_geom_node(
const WorkingNodePath &np,
118 const NodePath &camera,
120 bool &computed_rel_mat);
121 PT(
Geom) make_mesh_geom(
const Geom *geom,
Lens *lens, LMatrix4 &rel_mat);
126 bool _has_undist_lut;
132 LColor _vignette_color;
135 LMatrix4 _rel_top_mat;
136 bool _computed_rel_top_mat;
140 bool _auto_recompute;
146 static void init_type() {
147 PandaNode::init_type();
149 PandaNode::get_class_type());
152 return get_class_type();
154 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A node that holds Geom objects, renderable pieces of geometry.
A container for geometry primitives.
Encodes a string name in a hash table, mapping it to a pointer.
A node that contains a Lens.
A base class for any number of different kinds of lenses, linear and otherwise.
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component,...
bool get_auto_recompute() const
Returns the auto_recompute flag.
bool get_vignette_on() const
Returns true if vertex-based vignetting is on, false otherwise.
void set_vignette_color(const LColor &vignette_color)
Specifies the color the screen will be painted at the portions outside of the lens' frustum; i....
void clear_undist_lut()
Removes the distortion lookup table from the projector, if specified.
void set_vignette_on(bool vignette_on)
Specifies whether vertex-based vignetting should be on.
const UpdateSeq & get_last_screen() const
Returns an UpdateSeq corresponding to the last time a screen mesh was generated for the ProjectionScr...
bool get_invert_uvs() const
Returns whether this screen is compensating for a graphics driver inverting the framebuffer image.
bool has_undist_lut() const
Returns true if a valid distortion lookup table was provided via set_undist_lut(),...
std::string get_texcoord_name() const
Returns the name of the texture coordinates that will be generated by this particular ProjectionScree...
void recompute()
Recomputes all the UV's for geometry below the ProjectionScreen node, as if the texture were projecte...
bool recompute_if_stale()
Calls recompute() only if the relative transform between the ProjectionScreen and the projector has c...
const LColor & get_vignette_color() const
Returns the color the screen will be painted at the portions outside of the lens' frustum.
void set_projector(const NodePath &projector)
Specifies the LensNode that is to serve as the projector for this screen.
void set_texcoord_3d(bool texcoord_3d)
Set this true to force 3-D texture coordinates to be created for the geometry.
bool get_texcoord_3d() const
See set_texcoord_3d().
void set_auto_recompute(bool auto_recompute)
Sets the auto_recompute flag.
void regenerate_screen(const NodePath &projector, const std::string &screen_name, int num_x_verts, int num_y_verts, PN_stdfloat distance, PN_stdfloat fill_ratio)
Removes all the children from the ProjectionScreen node, and adds the newly generated child returned ...
void set_undist_lut(const PfmFile &undist_lut)
Applies a distortion lookup table to the projector.
const LColor & get_frame_color() const
Returns the color the screen will be painted at the portions outside of the lens' frustum.
void set_texcoord_name(const std::string &texcoord_name)
Specifies the name of the texture coordinates that are generated by this particular ProjectionScreen.
const NodePath & get_projector() const
Returns the NodePath to the LensNode that is to serve as the projector for this screen,...
void set_invert_uvs(bool invert_uvs)
Some OpenGL graphics drivers are known to invert the framebuffer image when they copy it to texture.
void set_frame_color(const LColor &frame_color)
Specifies the color the screen will be painted at the portions outside of the lens' frustum; i....
const PfmFile & get_undist_lut() const
Returns the distortion lookup table provided via set_undist_lut(), if any.
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
This is a class designed to support low-overhead traversals of the complete scene graph,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...