17 INLINE PortalClipper::Point::
24 INLINE PortalClipper::Point::
25 Point(
const LVecBase3 &point,
const LColor &color) :
26 _point(point[0], point[1], point[2]),
34 INLINE PortalClipper::Point::
35 Point(
const PortalClipper::Point ©) :
44 INLINE
void PortalClipper::Point::
45 operator = (
const PortalClipper::Point ©) {
56 move_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
66 draw_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
76 _color = LColor(1,1,1,1);
86 _reduced_frustum = frustum;
94 return _reduced_frustum;
104 _clip_state = clip_state;
121 _reduced_viewport_min = min;
122 _reduced_viewport_max = max;
131 min = _reduced_viewport_min;
132 max = _reduced_viewport_max;
143 portal_cat.debug() <<
"portal plane check value: " << portal_plane[3] <<
"\n";
144 return (portal_plane[3] > 0);
162 int result = _reduced_frustum->
contains(gbv);
164 portal_cat.spam() <<
"1st level test if portal: " << *_reduced_frustum <<
" is in view " << result << std::endl;
165 return (result != 0);
This defines a bounding convex hexahedron.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
int contains(const GeometricBoundingVolume *vol) const
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indi...
void move_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Moves the pen to the given point without drawing a line.
bool is_whole_portal_in_view(const LMatrix4 &cmat)
checks if portal_node is within the view frustum.
bool is_facing_view(const LPlane &portal_plane)
checks if the portal plane (in camera space) is facing the camera's near plane
const RenderState * get_clip_state() const
Returns the stored clip state.
void draw_hexahedron(BoundingHexahedron *frustum)
Given the BoundingHexahedron draw it using lines.
void get_reduced_viewport(LPoint2 &min, LPoint2 &max) const
Return the reduced viewport.
BoundingHexahedron * get_reduced_frustum() const
Return the reduced frustum.
void draw_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Draws a line segment from the pen's last position (the last call to move_to or draw_to) to the indica...
void set_reduced_viewport(const LPoint2 &min, const LPoint2 &max)
Set the current viewport that is being used by the portal clipper.
void set_reduced_frustum(BoundingHexahedron *bh)
Set the current view frustum that is being calculated by the portal clipper.
void set_clip_state(const RenderState *clip_state)
Set the clip state of the current portal node This is done to remember the state for the child portal...
void draw_camera_frustum()
Draw the current camera frustum in white color.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...