Panda3D
 All Classes Functions Variables Enumerations
boundingHexahedron.I
1 // Filename: boundingHexahedron.I
2 // Created by: drose (03Oct99)
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: BoundingHexahedron::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE_MATHUTIL BoundingHexahedron::
22 BoundingHexahedron() {
23 }
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: BoundingHexahedron::get_num_points
27 // Access: Published
28 // Description: Returns 8: the number of vertices of a hexahedron.
29 ////////////////////////////////////////////////////////////////////
30 INLINE_MATHUTIL int BoundingHexahedron::
31 get_num_points() const {
32  return num_points;
33 }
34 
35 ////////////////////////////////////////////////////////////////////
36 // Function: BoundingHexahedron::get_point
37 // Access: Published
38 // Description: Returns the nth vertex of the hexahedron.
39 ////////////////////////////////////////////////////////////////////
40 INLINE_MATHUTIL LPoint3 BoundingHexahedron::
41 get_point(int n) const {
42  nassertr(n >= 0 && n < num_points, LPoint3::zero());
43  return _points[n];
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: BoundingHexahedron::get_num_planes
48 // Access: Published
49 // Description: Returns 6: the number of faces of a hexahedron.
50 ////////////////////////////////////////////////////////////////////
51 INLINE_MATHUTIL int BoundingHexahedron::
52 get_num_planes() const {
53  return num_planes;
54 }
55 
56 ////////////////////////////////////////////////////////////////////
57 // Function: BoundingHexahedron::get_plane
58 // Access: Published
59 // Description: Returns the nth face of the hexahedron.
60 ////////////////////////////////////////////////////////////////////
61 INLINE_MATHUTIL LPlane BoundingHexahedron::
62 get_plane(int n) const {
63  nassertr(n >= 0 && n < num_planes, LPlane());
64  return _planes[n];
65 }
static const LPoint3f & zero()
Returns a zero-length point.
Definition: lpoint3.h:258
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
LPlane get_plane(int n) const
Returns the nth face of the hexahedron.
LPoint3 get_point(int n) const
Returns the nth vertex of the hexahedron.
int get_num_points() const
Returns 8: the number of vertices of a hexahedron.
int get_num_planes() const
Returns 6: the number of faces of a hexahedron.