Panda3D
panda
src
mathutil
boundingLine.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 boundingLine.I
10
* @author drose
11
* @date 2000-07-04
12
*/
13
14
/**
15
*
16
*/
17
INLINE_MATHUTIL BoundingLine::
18
BoundingLine() {
19
}
20
21
/**
22
*
23
*/
24
INLINE_MATHUTIL BoundingLine::
25
BoundingLine(
const
LPoint3 &a,
const
LPoint3 &b) :
26
_origin(a), _vector(b - a)
27
{
28
_vector.normalize();
29
_flags = 0;
30
nassertd(!_origin.is_nan() && !_vector.is_nan()) {
31
_flags = F_empty;
32
}
33
}
34
35
/**
36
* Returns the first point that defines the line.
37
*/
38
INLINE_MATHUTIL
const
LPoint3 &
BoundingLine::
39
get_point_a
()
const
{
40
nassertr(!
is_empty
(), _origin);
41
nassertr(!
is_infinite
(), _origin);
42
return
_origin;
43
}
44
45
/**
46
* Returns the second point that defines the line.
47
*/
48
INLINE_MATHUTIL LPoint3
BoundingLine::
49
get_point_b
()
const
{
50
nassertr(!
is_empty
(), _origin);
51
nassertr(!
is_infinite
(), _origin);
52
return
_origin + _vector;
53
}
BoundingLine::get_point_a
const LPoint3 & get_point_a() const
Returns the first point that defines the line.
Definition:
boundingLine.I:39
BoundingLine::get_point_b
LPoint3 get_point_b() const
Returns the second point that defines the line.
Definition:
boundingLine.I:49
BoundingVolume::is_infinite
bool is_infinite() const
The other side of the empty coin is an infinite volume.
Definition:
boundingVolume.I:44
BoundingVolume::is_empty
bool is_empty() const
Any kind of volume might be empty.
Definition:
boundingVolume.I:29
Generated on Mon Sep 14 2020 15:06:57 for Panda3D by
1.8.20