Panda3D
eggGroupNode.I
1 // Filename: eggGroupNode.I
2 // Created by: drose (16Jan99)
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: EggGroupNode::is_right
18 // Access: Private, Static
19 // Description: Returns true if the 2-d v1 is to the right of v2.
20 ////////////////////////////////////////////////////////////////////
21 INLINE bool EggGroupNode::
22 is_right(const LVector2d &v1, const LVector2d &v2) {
23  return (v1[0] * v2[1] - v1[1] * v2[0]) > 0;
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: EggGroupNode::TBNVertexValue::operator <
28 // Access: Public
29 // Description:
30 ////////////////////////////////////////////////////////////////////
31 bool EggGroupNode::TBNVertexValue::
32 operator < (const TBNVertexValue &other) const {
33  if (_facing != other._facing) {
34  return (int)_facing < (int)other._facing;
35  }
36  int compare = _pos.compare_to(other._pos);
37  if (compare != 0) {
38  return compare < 0;
39  }
40  compare = _normal.compare_to(other._normal);
41  if (compare != 0) {
42  return compare < 0;
43  }
44  compare = _uv.compare_to(other._uv);
45  if (compare != 0) {
46  return compare < 0;
47  }
48  return _uv_name < other._uv_name;
49 }
This is a two-component vector offset.
Definition: lvector2.h:429
static bool is_right(const LVector2d &v1, const LVector2d &v2)
Returns true if the 2-d v1 is to the right of v2.
Definition: eggGroupNode.I:22