Panda3D
cullResult.I
1 // Filename: cullResult.I
2 // Created by: drose (28Feb02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: CullResult::Destructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE CullResult::
22 ~CullResult() {
23 }
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: CullResult::get_bin
27 // Access: Public
28 // Description: Returns the CullBin associated with the indicated
29 // bin_index, or NULL if the bin_index is invalid. If
30 // there is the first time this bin_index has been
31 // requested for this CullResult, creates a new CullBin
32 // object on the fly.
33 ////////////////////////////////////////////////////////////////////
34 INLINE CullBin *CullResult::
35 get_bin(int bin_index) {
36  if (bin_index >= 0 && bin_index < (int)_bins.size() &&
37  _bins[bin_index] != (CullBin *)NULL) {
38  return _bins[bin_index];
39  }
40  return make_new_bin(bin_index);
41 }
42 
43 ////////////////////////////////////////////////////////////////////
44 // Function: CullResult::check_flash_bin
45 // Access: Private
46 // Description: If the user configured flash-bin-binname, then update
47 // the object's state to flash all the geometry in the
48 // bin.
49 ////////////////////////////////////////////////////////////////////
50 INLINE void CullResult::
51 check_flash_bin(CPT(RenderState) &state, CullBinManager *bin_manager, int bin_index) {
52 #ifndef NDEBUG
53  if (bin_manager->get_bin_flash_active(bin_index)) {
54  apply_flash_color(state, bin_manager->get_bin_flash_color(bin_index));
55  }
56 #endif
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function: CullResult::check_flash_transparency
61 // Access: Private
62 // Description: If the user configured show-transparency, then
63 // update the object's state to flash the current
64 // geometry with the specified color.
65 ////////////////////////////////////////////////////////////////////
66 INLINE void CullResult::
67 check_flash_transparency(CPT(RenderState) &state, const LColor &color) {
68 #ifndef NDEBUG
69  if (_show_transparency) {
70  apply_flash_color(state, color);
71  }
72 #endif
73 }
const LColor & get_bin_flash_color(int bin_index) const
Returns the color that this bin has been configured to flash to, if configured.
A collection of Geoms and their associated state, for a particular scene.
Definition: cullBin.h:44
bool get_bin_flash_active(int bin_index) const
Returns true if the bin with the given bin_index is configured to flash at a predetermined color (whe...
CullBin * get_bin(int bin_index)
Returns the CullBin associated with the indicated bin_index, or NULL if the bin_index is invalid...
Definition: cullResult.I:35
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:53
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
This is a global object that maintains the collection of named CullBins in the world.