forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheggData.I
More file actions
179 lines (163 loc) · 5.12 KB
/
eggData.I
File metadata and controls
179 lines (163 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file eggData.I
* @author drose
* @date 1999-02-11
*/
/**
*
*/
INLINE EggData::
EggData() {
_auto_resolve_externals = false;
_had_absolute_pathnames = false;
_coordsys = CS_default;
_egg_timestamp = 0;
}
/**
*
*/
INLINE EggData::
EggData(const EggData ©) :
EggGroupNode(copy),
_auto_resolve_externals(copy._auto_resolve_externals),
_had_absolute_pathnames(copy._had_absolute_pathnames),
_coordsys(copy._coordsys),
_egg_filename(copy._egg_filename),
_egg_timestamp(copy._egg_timestamp)
{
}
/**
*
*/
INLINE EggData &EggData::
operator = (const EggData ©) {
EggGroupNode::operator = (copy);
_auto_resolve_externals = copy._auto_resolve_externals;
_had_absolute_pathnames = copy._had_absolute_pathnames;
_coordsys = copy._coordsys;
_egg_filename = copy._egg_filename;
_egg_timestamp = copy._egg_timestamp;
return *this;
}
/**
* Indicates whether the EggData object will automatically resolve any
* external references when read() is called. The default is false.
*/
INLINE void EggData::
set_auto_resolve_externals(bool resolve) {
_auto_resolve_externals = resolve;
}
/**
* Indicates whether the EggData object will automatically resolve any
* external references when read() is called. The default is false.
*/
INLINE bool EggData::
get_auto_resolve_externals() const {
return _auto_resolve_externals;
}
/**
* Returns true if the data processed in the last call to read() contained
* absolute pathnames, or false if those pathnames were all relative.
*
* This method is necessary because if auto_resolve_externals() is in effect,
* it may modify the pathnames to be absolute whether or not they were as
* loaded from disk. This method can be used to query the state of the
* original egg file from disk.
*/
INLINE bool EggData::
original_had_absolute_pathnames() const {
return _had_absolute_pathnames;
}
/**
* Returns the coordinate system in which the egg file is defined.
*/
INLINE CoordinateSystem EggData::
get_coordinate_system() const {
return _coordsys;
}
/**
* Sets the filename--especially the directory part--in which the egg file is
* considered to reside. This is also implicitly set by read().
*/
INLINE void EggData::
set_egg_filename(const Filename &egg_filename) {
_egg_filename = egg_filename;
}
/**
* Returns the directory in which the egg file is considered to reside.
*/
INLINE const Filename &EggData::
get_egg_filename() const {
return _egg_filename;
}
/**
* Sets the timestamp of the egg file on disk, at the time it was opened for
* reading. This is also implicitly set by read().
*/
INLINE void EggData::
set_egg_timestamp(time_t egg_timestamp) {
_egg_timestamp = egg_timestamp;
}
/**
* Returns the timestamp of the egg file on disk, at the time it was opened
* for reading, or 0 if this information is not available.
*/
INLINE time_t EggData::
get_egg_timestamp() const {
return _egg_timestamp;
}
/**
* Recomputes all the vertex normals for polygon geometry at this group node
* and below so that they accurately reflect the vertex positions. A shared
* edge between two polygons (even in different groups) is considered smooth
* if the angle between the two edges is less than threshold degrees.
*
* This function also removes degenerate polygons that do not have enough
* vertices to define a normal. It does not affect normals for other kinds of
* primitives like Nurbs or Points.
*
* This function does not remove or adjust vertices in the vertex pool; it
* only adds new vertices with the correct normals. Thus, it is a good idea
* to call remove_unused_vertices() after calling this.
*/
INLINE void EggData::
recompute_vertex_normals(double threshold) {
EggGroupNode::recompute_vertex_normals(threshold, _coordsys);
}
/**
* Recomputes all the polygon normals for polygon geometry at this group node
* and below so that they accurately reflect the vertex positions. Normals
* are removed from the vertices and defined only on polygons, giving the
* geometry a faceted appearance.
*
* This function also removes degenerate polygons that do not have enough
* vertices to define a normal. It does not affect normals for other kinds of
* primitives like Nurbs or Points.
*
* This function does not remove or adjust vertices in the vertex pool; it
* only adds new vertices with the normals removed. Thus, it is a good idea
* to call remove_unused_vertices() after calling this.
*/
INLINE void EggData::
recompute_polygon_normals() {
EggGroupNode::recompute_polygon_normals(_coordsys);
}
/**
* Removes all normals from primitives, and the vertices they reference, at
* this node and below.
*
* This function does not remove or adjust vertices in the vertex pool; it
* only adds new vertices with the normal removed. Thus, it is a good idea to
* call remove_unused_vertices() after calling this.
*/
INLINE void EggData::
strip_normals() {
EggGroupNode::strip_normals();
}