Panda3D
 All Classes Functions Variables Enumerations
eggPoint.I
1 // Filename: eggPoint.I
2 // Created by: drose (15Dec99)
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: EggPoint::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggPoint::
22 EggPoint(const string &name) :
23  EggPrimitive(name),
24  _flags(0),
25  _thick(1.0)
26 {
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function: EggPoint::Copy constructor
31 // Access: Public
32 // Description:
33 ////////////////////////////////////////////////////////////////////
34 INLINE EggPoint::
35 EggPoint(const EggPoint &copy) :
36  EggPrimitive(copy),
37  _flags(copy._flags),
38  _thick(copy._thick)
39 {
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: EggPoint::Copy assignment operator
44 // Access: Public
45 // Description:
46 ////////////////////////////////////////////////////////////////////
47 INLINE EggPoint &EggPoint::
48 operator = (const EggPoint &copy) {
49  EggPrimitive::operator = (copy);
50  _flags = copy._flags;
51  _thick = copy._thick;
52  return *this;
53 }
54 
55 ////////////////////////////////////////////////////////////////////
56 // Function: EggPoint::has_thick
57 // Access: Published
58 // Description:
59 ////////////////////////////////////////////////////////////////////
60 INLINE bool EggPoint::
61 has_thick() const {
62  return (_flags & F_has_thick) != 0;
63 }
64 
65 ////////////////////////////////////////////////////////////////////
66 // Function: EggPoint::get_thick
67 // Access: Published
68 // Description: Returns the thickness set on this particular point.
69 // If there is no thickness set, returns 1.0.
70 ////////////////////////////////////////////////////////////////////
71 INLINE double EggPoint::
72 get_thick() const {
73  return _thick;
74 }
75 
76 ////////////////////////////////////////////////////////////////////
77 // Function: EggPoint::set_thick
78 // Access: Published
79 // Description:
80 ////////////////////////////////////////////////////////////////////
81 INLINE void EggPoint::
82 set_thick(double thick) {
83  _thick = thick;
84  _flags |= F_has_thick;
85 }
86 
87 ////////////////////////////////////////////////////////////////////
88 // Function: EggPoint::clear_thick
89 // Access: Published
90 // Description:
91 ////////////////////////////////////////////////////////////////////
92 INLINE void EggPoint::
93 clear_thick() {
94  _thick = 1.0;
95  _flags &= ~F_has_thick;
96 }
97 
98 ////////////////////////////////////////////////////////////////////
99 // Function: EggPoint::has_perspective
100 // Access: Published
101 // Description:
102 ////////////////////////////////////////////////////////////////////
103 INLINE bool EggPoint::
104 has_perspective() const {
105  return (_flags & F_has_perspective) != 0;
106 }
107 
108 ////////////////////////////////////////////////////////////////////
109 // Function: EggPoint::get_perspective
110 // Access: Published
111 // Description: Returns the perspective flag set on this particular
112 // point. If there is no perspective flag set, returns
113 // false.
114 ////////////////////////////////////////////////////////////////////
115 INLINE bool EggPoint::
117  return (_flags & F_perspective) != 0;
118 }
119 
120 ////////////////////////////////////////////////////////////////////
121 // Function: EggPoint::set_perspective
122 // Access: Published
123 // Description:
124 ////////////////////////////////////////////////////////////////////
125 INLINE void EggPoint::
126 set_perspective(bool perspective) {
127  if (perspective) {
128  _flags |= F_perspective;
129  } else {
130  _flags &= ~F_perspective;
131  }
132  _flags |= F_has_perspective;
133 }
134 
135 ////////////////////////////////////////////////////////////////////
136 // Function: EggPoint::clear_perspective
137 // Access: Published
138 // Description:
139 ////////////////////////////////////////////////////////////////////
140 INLINE void EggPoint::
141 clear_perspective() {
142  _flags &= ~(F_has_perspective | F_perspective);
143 }
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
Definition: eggPrimitive.h:51
A single point, or a collection of points as defined by a single <PointLight> entry.
Definition: eggPoint.h:27
bool get_perspective() const
Returns the perspective flag set on this particular point.
Definition: eggPoint.I:116
double get_thick() const
Returns the thickness set on this particular point.
Definition: eggPoint.I:72