Panda3D
eggPoint.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 eggPoint.I
10  * @author drose
11  * @date 1999-12-15
12  */
13 
14 /**
15  *
16  */
17 INLINE EggPoint::
18 EggPoint(const std::string &name) :
19  EggPrimitive(name),
20  _flags(0),
21  _thick(1.0)
22 {
23 }
24 
25 /**
26  *
27  */
28 INLINE EggPoint::
29 EggPoint(const EggPoint &copy) :
30  EggPrimitive(copy),
31  _flags(copy._flags),
32  _thick(copy._thick)
33 {
34 }
35 
36 /**
37  *
38  */
39 INLINE EggPoint &EggPoint::
40 operator = (const EggPoint &copy) {
41  EggPrimitive::operator = (copy);
42  _flags = copy._flags;
43  _thick = copy._thick;
44  return *this;
45 }
46 
47 /**
48  *
49  */
50 INLINE bool EggPoint::
51 has_thick() const {
52  return (_flags & F_has_thick) != 0;
53 }
54 
55 /**
56  * Returns the thickness set on this particular point. If there is no
57  * thickness set, returns 1.0.
58  */
59 INLINE double EggPoint::
60 get_thick() const {
61  return _thick;
62 }
63 
64 /**
65  *
66  */
67 INLINE void EggPoint::
68 set_thick(double thick) {
69  _thick = thick;
70  _flags |= F_has_thick;
71 }
72 
73 /**
74  *
75  */
76 INLINE void EggPoint::
77 clear_thick() {
78  _thick = 1.0;
79  _flags &= ~F_has_thick;
80 }
81 
82 /**
83  *
84  */
85 INLINE bool EggPoint::
86 has_perspective() const {
87  return (_flags & F_has_perspective) != 0;
88 }
89 
90 /**
91  * Returns the perspective flag set on this particular point. If there is no
92  * perspective flag set, returns false.
93  */
94 INLINE bool EggPoint::
95 get_perspective() const {
96  return (_flags & F_perspective) != 0;
97 }
98 
99 /**
100  *
101  */
102 INLINE void EggPoint::
103 set_perspective(bool perspective) {
104  if (perspective) {
105  _flags |= F_perspective;
106  } else {
107  _flags &= ~F_perspective;
108  }
109  _flags |= F_has_perspective;
110 }
111 
112 /**
113  *
114  */
115 INLINE void EggPoint::
116 clear_perspective() {
117  _flags &= ~(F_has_perspective | F_perspective);
118 }
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
Definition: eggPrimitive.h:47
double get_thick() const
Returns the thickness set on this particular point.
Definition: eggPoint.I:60
A single point, or a collection of points as defined by a single <PointLight> entry.
Definition: eggPoint.h:25
bool get_perspective() const
Returns the perspective flag set on this particular point.
Definition: eggPoint.I:95