Panda3D
Loading...
Searching...
No Matches
cullResult.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file cullResult.I
10 * @author drose
11 * @date 2002-02-28
12 */
13
14/**
15 *
16 */
17INLINE CullResult::
18~CullResult() {
19}
20
21/**
22 * Returns the CullBin associated with the indicated bin_index, or NULL if the
23 * bin_index is invalid. If there is the first time this bin_index has been
24 * requested for this CullResult, creates a new CullBin object on the fly.
25 */
27get_bin(int bin_index) {
28 if (bin_index >= 0 && bin_index < (int)_bins.size() &&
29 _bins[bin_index] != nullptr) {
30 return _bins[bin_index];
31 }
32 return make_new_bin(bin_index);
33}
34
35/**
36 * If the user configured flash-bin-binname, then update the object's state to
37 * flash all the geometry in the bin.
38 */
39INLINE void CullResult::
40check_flash_bin(CPT(RenderState) &state, CullBinManager *bin_manager, int bin_index) {
41#ifndef NDEBUG
42 if (bin_manager->get_bin_flash_active(bin_index)) {
43 apply_flash_color(state, bin_manager->get_bin_flash_color(bin_index));
44 }
45#endif
46}
47
48/**
49 * If the user configured show-transparency, then update the object's state to
50 * flash the current geometry with the specified color.
51 */
52INLINE void CullResult::
53check_flash_transparency(CPT(RenderState) &state, const LColor &color) {
54#ifndef NDEBUG
55 if (_show_transparency) {
56 apply_flash_color(state, color);
57 }
58#endif
59}
This is a global object that maintains the collection of named CullBins in the world.
const LColor & get_bin_flash_color(int bin_index) const
Returns the color that this bin has been configured to flash to, if configured.
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...
A collection of Geoms and their associated state, for a particular scene.
Definition cullBin.h:40
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:27
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition renderState.h:47