Panda3D

texGenAttrib.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 texGenAttrib.I
10 * @author masad
11 * @date 2004-06-21
12 */
13
14 /**
15 * Use TexGenAttrib::make() to construct a new TexGenAttrib object.
16 */
17 INLINE TexGenAttrib::
18 TexGenAttrib() :
19 _num_point_sprites(0),
20 _point_geom_rendering(0),
21 _geom_rendering(0)
22 {
23 }
24
25 /**
26 * Use TexGenAttrib::make() to construct a new TexGenAttrib object.
27 */
28 INLINE TexGenAttrib::
29 TexGenAttrib(const TexGenAttrib &copy) :
30 _stages(copy._stages),
31 _no_texcoords(copy._no_texcoords),
32 _num_point_sprites(copy._num_point_sprites),
33 _point_geom_rendering(copy._point_geom_rendering),
34 _geom_rendering(copy._geom_rendering)
35 {
36 }
37
38 /**
39 * Returns the union of the Geom::GeomRendering bits that will be required
40 * once this TexGenAttrib is applied to a geom which includes the indicated
41 * geom_rendering bits.
42 */
43 INLINE int TexGenAttrib::
44 get_geom_rendering(int geom_rendering) const {
45 if ((geom_rendering & Geom::GR_point) != 0) {
46 geom_rendering |= _point_geom_rendering;
47 }
48
49 return geom_rendering | _geom_rendering;
50 }
51
52 /**
53 *
54 */
55 INLINE TexGenAttrib::ModeDef::
56 ModeDef() :
57 _mode(M_off)
58 {
59 }
60
61 /**
62 *
63 */
64 INLINE int TexGenAttrib::ModeDef::
65 compare_to(const TexGenAttrib::ModeDef &other) const {
66 if (_mode != other._mode) {
67 return (int)_mode < (int)other._mode ? -1 : 1;
68 }
69 int compare = _light.compare_to(other._light);
70 if (compare != 0) {
71 return compare;
72 }
73 compare = strcmp(_source_name.c_str(), other._source_name.c_str());
74 if (compare != 0) {
75 return compare;
76 }
77 compare = _constant_value.compare_to(other._constant_value);
78 return compare;
79 }
TexGenAttrib
Computes texture coordinates for geometry automatically based on vertex position and/or normal.
Definition: texGenAttrib.h:32
TexGenAttrib::get_geom_rendering
int get_geom_rendering(int geom_rendering) const
Returns the union of the Geom::GeomRendering bits that will be required once this TexGenAttrib is app...
Definition: texGenAttrib.I:44