Panda3D
 All Classes Functions Variables Enumerations
texProjectorEffect.I
1 // Filename: texProjectorEffect.I
2 // Created by: drose (25Jul04)
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: TexProjectorEffect::Constructor
18 // Access: Protected
19 // Description: Use TexProjectorEffect::make() to construct a new
20 // TexProjectorEffect object.
21 ////////////////////////////////////////////////////////////////////
22 INLINE TexProjectorEffect::
23 TexProjectorEffect() {
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: TexProjectorEffect::Copy Constructor
28 // Access: Protected
29 // Description: Use TexProjectorEffect::make() to construct a new
30 // TexProjectorEffect object.
31 ////////////////////////////////////////////////////////////////////
32 INLINE TexProjectorEffect::
33 TexProjectorEffect(const TexProjectorEffect &copy) :
34  _stages(copy._stages)
35 {
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: TexProjectorEffect::StageDef::Constructor
40 // Access: Public
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 INLINE TexProjectorEffect::StageDef::
44 StageDef() :
45  _to_lens_node(NULL)
46 {
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: TexProjectorEffect::StageDef::set_from
51 // Access: Public
52 // Description:
53 ////////////////////////////////////////////////////////////////////
54 INLINE void TexProjectorEffect::StageDef::
55 set_from(const NodePath &from) {
56  _from = from;
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function: TexProjectorEffect::StageDef::set_lens_index
61 // Access: Public
62 // Description:
63 ////////////////////////////////////////////////////////////////////
64 INLINE void TexProjectorEffect::StageDef::
65 set_lens_index(int lens_index) {
66  _lens_index = lens_index;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: TexProjectorEffect::StageDef::compare_to
71 // Access: Public
72 // Description:
73 ////////////////////////////////////////////////////////////////////
74 INLINE int TexProjectorEffect::StageDef::
75 compare_to(const TexProjectorEffect::StageDef &other) const {
76  int compare = _to.compare_to(other._to);
77  if (compare != 0) {
78  return compare;
79  }
80 
81  if (_lens_index != other._lens_index) {
82  return _lens_index - other._lens_index;
83  }
84 
85  return _from.compare_to(other._from);
86 }
This effect automatically applies a computed texture matrix to the specified texture stage...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165