forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplane_src.h
More file actions
69 lines (57 loc) · 2.81 KB
/
plane_src.h
File metadata and controls
69 lines (57 loc) · 2.81 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
/**
* 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 plane_src.h
* @author mike
* @date 1997-01-09
*/
/**
* An abstract mathematical description of a plane. A plane is defined by the
* equation Ax + By + Cz + D = 0.
*/
class EXPCL_PANDA_MATHUTIL FLOATNAME(LPlane) : public FLOATNAME(LVecBase4) {
PUBLISHED:
INLINE_MATHUTIL FLOATNAME(LPlane)();
INLINE_MATHUTIL FLOATNAME(LPlane)(const FLOATNAME(LVecBase4) ©);
INLINE_MATHUTIL FLOATNAME(LPlane)(const FLOATNAME(LPoint3) &a,
const FLOATNAME(LPoint3) &b,
const FLOATNAME(LPoint3) &c);
INLINE_MATHUTIL FLOATNAME(LPlane)(const FLOATNAME(LVector3) &normal,
const FLOATNAME(LPoint3) &point);
INLINE_MATHUTIL FLOATNAME(LPlane)(FLOATTYPE a, FLOATTYPE b,
FLOATTYPE c, FLOATTYPE d);
INLINE_MATHUTIL FLOATNAME(LPlane) operator * (const FLOATNAME(LMatrix3) &mat) const;
INLINE_MATHUTIL FLOATNAME(LPlane) operator * (const FLOATNAME(LMatrix4) &mat) const;
INLINE_MATHUTIL void operator *= (const FLOATNAME(LMatrix4) &mat);
INLINE_MATHUTIL void xform(const FLOATNAME(LMatrix4) &mat);
INLINE_MATHUTIL FLOATNAME(LPlane) operator - () const;
FLOATNAME(LMatrix4) get_reflection_mat() const;
INLINE_MATHUTIL FLOATNAME(LVector3) get_normal() const;
FLOATNAME(LPoint3) get_point() const;
INLINE_MATHUTIL FLOATTYPE dist_to_plane(const FLOATNAME(LPoint3) &point) const;
INLINE_MATHUTIL bool normalize();
INLINE_MATHUTIL FLOATNAME(LPlane) normalized() const;
INLINE_MATHUTIL FLOATNAME(LPoint3) project(const FLOATNAME(LPoint3) &point) const;
INLINE_MATHUTIL void flip();
INLINE_MATHUTIL bool intersects_line(FLOATNAME(LPoint3) &intersection_point,
const FLOATNAME(LPoint3) &p1,
const FLOATNAME(LPoint3) &p2) const;
INLINE_MATHUTIL bool intersects_line(FLOATTYPE &t,
const FLOATNAME(LPoint3) &from,
const FLOATNAME(LVector3) &delta) const;
bool intersects_plane(FLOATNAME(LPoint3) &from,
FLOATNAME(LVector3) &delta,
const FLOATNAME(LPlane) &other) const;
bool intersects_parabola(FLOATTYPE &t1, FLOATTYPE &t2,
const FLOATNAME(LParabola) ¶bola) const;
void output(std::ostream &out) const;
void write(std::ostream &out, int indent_level = 0) const;
};
INLINE_MATHUTIL std::ostream &
operator << (std::ostream &out, const FLOATNAME(LPlane) &p);
#include "plane_src.I"