Panda3D
|
00001 // Filename: scissorEffect.I 00002 // Created by: drose (30Jul08) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: ScissorEffect::is_screen 00018 // Access: Published 00019 // Description: Returns true if the ScissorEffect is a screen-based 00020 // effect, meaning get_frame() has a meaningful value, 00021 // but get_a() and get_b() do not. 00022 //////////////////////////////////////////////////////////////////// 00023 INLINE bool ScissorEffect:: 00024 is_screen() const { 00025 return _screen; 00026 } 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: ScissorEffect::get_frame 00030 // Access: Published 00031 // Description: If is_screen() returns true, this method may be 00032 // called to query the screen-based scissor frame. This 00033 // is a series of left, right, bottom, top, representing 00034 // the scissor frame relative to the current 00035 // DisplayRegion. See ScissorAttrib. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE const LVecBase4 &ScissorEffect:: 00038 get_frame() const { 00039 return _frame; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: ScissorEffect::get_num_points 00044 // Access: Published 00045 // Description: Returns the number of node-based scissor points. See 00046 // get_point(). 00047 //////////////////////////////////////////////////////////////////// 00048 INLINE int ScissorEffect:: 00049 get_num_points() const { 00050 return (int)_points.size(); 00051 } 00052 00053 //////////////////////////////////////////////////////////////////// 00054 // Function: ScissorEffect::get_point 00055 // Access: Published 00056 // Description: If is_screen() returns false, then get_num_points() and 00057 // get_point() may be called to query the node-based scissor 00058 // frame. These return n points (at least two), which 00059 // are understood to be in the space of this node, and 00060 // which define any opposite corners of the scissor 00061 // frame. 00062 //////////////////////////////////////////////////////////////////// 00063 INLINE const LPoint3 &ScissorEffect:: 00064 get_point(int n) const { 00065 nassertr(n >= 0 && n < (int)_points.size(), LPoint3::zero()); 00066 return _points[n]._p; 00067 } 00068 00069 //////////////////////////////////////////////////////////////////// 00070 // Function: ScissorEffect::get_node 00071 // Access: Published 00072 // Description: Returns the node to which the nth point is relative, 00073 // or empty NodePath to indicate the current node. 00074 //////////////////////////////////////////////////////////////////// 00075 INLINE NodePath ScissorEffect:: 00076 get_node(int n) const { 00077 nassertr(n >= 0 && n < (int)_points.size(), NodePath()); 00078 return _points[n]._node; 00079 } 00080 00081 //////////////////////////////////////////////////////////////////// 00082 // Function: ScissorEffect::get_clip 00083 // Access: Published 00084 // Description: Returns true if this ScissorEffect actually enables 00085 // scissoring, or false if it culls only. 00086 //////////////////////////////////////////////////////////////////// 00087 INLINE bool ScissorEffect:: 00088 get_clip() const { 00089 return _clip; 00090 }