Panda3D
objToEggConverter.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 objToEggConverter.I
10  * @author drose
11  * @date 2013-01-03
12  */
13 
14 /**
15  * Provides a unique but arbitrary ordering for VertexEntry objects in a map.
16  */
17 INLINE bool ObjToEggConverter::VertexEntry::
18 operator < (const VertexEntry &other) const {
19  if (_vi != other._vi) {
20  return _vi < other._vi;
21  }
22  if (_vti != other._vti) {
23  return _vti < other._vti;
24  }
25 
26  // It's important that these two tests are made last, so we can find the
27  // first vertex that has any normal but also matches the above properties.
28  if (_vni != other._vni) {
29  return _vni < other._vni;
30  }
31  if (_synth_vni != other._synth_vni) {
32  return _synth_vni < other._synth_vni;
33  }
34  return false;
35 }
36 
37 /**
38  *
39  */
40 INLINE bool ObjToEggConverter::VertexEntry::
41 operator == (const VertexEntry &other) const {
42  return (_vi == other._vi && _vti == other._vti &&
43  _vni == other._vni && _synth_vni == other._synth_vni);
44 }
45 
46 /**
47  * Returns true if all the properties except _vni and _synth_vni are
48  * equivalent.
49  */
50 INLINE bool ObjToEggConverter::VertexEntry::
51 matches_except_normal(const VertexEntry &other) const {
52  return (_vi == other._vi && _vti == other._vti);
53 }