Panda3D
 All Classes Functions Variables Enumerations
collisionPlane.I
1 // Filename: collisionPlane.I
2 // Created by: drose (25Apr00)
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: CollisionPlane::Default Constructor
18 // Access: Protected
19 // Description: This is only for the convenience of CollisionPolygon.
20 // Normally, you should not attempt to create an
21 // uninitialized CollisionPlane.
22 ////////////////////////////////////////////////////////////////////
23 INLINE CollisionPlane::
24 CollisionPlane() {
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: CollisionPlane::Constructor
29 // Access: Public
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 INLINE CollisionPlane::
33 CollisionPlane(const LPlane &plane) :
34  _plane(plane)
35 {
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: CollisionPlane::Copy Constructor
40 // Access: Public
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 INLINE CollisionPlane::
44 CollisionPlane(const CollisionPlane &copy) :
45  CollisionSolid(copy),
46  _plane(copy._plane)
47 {
48 }
49 
50 ////////////////////////////////////////////////////////////////////
51 // Function: CollisionPlane::flush_level
52 // Access: Public, Static
53 // Description: Flushes the PStatCollectors used during traversal.
54 ////////////////////////////////////////////////////////////////////
55 INLINE void CollisionPlane::
57  _volume_pcollector.flush_level();
58  _test_pcollector.flush_level();
59 }
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: CollisionPlane::get_normal
63 // Access: Published
64 // Description:
65 ////////////////////////////////////////////////////////////////////
66 INLINE LVector3 CollisionPlane::
67 get_normal() const {
68  return _plane.get_normal();
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: CollisionPlane::dist_to_plane
73 // Access: Published
74 // Description:
75 ////////////////////////////////////////////////////////////////////
76 INLINE PN_stdfloat CollisionPlane::
77 dist_to_plane(const LPoint3 &point) const {
78  return _plane.dist_to_plane(point);
79 }
80 
81 ////////////////////////////////////////////////////////////////////
82 // Function: CollisionPlane::set_plane
83 // Access: Published
84 // Description:
85 ////////////////////////////////////////////////////////////////////
86 INLINE void CollisionPlane::
87 set_plane(const LPlane &plane) {
88  _plane = plane;
89  mark_internal_bounds_stale();
90  mark_viz_stale();
91 }
92 
93 ////////////////////////////////////////////////////////////////////
94 // Function: CollisionPlane::get_plane
95 // Access: Published
96 // Description:
97 ////////////////////////////////////////////////////////////////////
98 INLINE const LPlane &CollisionPlane::
99 get_plane() const {
100  return _plane;
101 }
102 
103 ////////////////////////////////////////////////////////////////////
104 // Function: CollisionPlane::flip
105 // Access: Published
106 // Description: Convenience method to flip the plane in-place.
107 ////////////////////////////////////////////////////////////////////
108 INLINE void CollisionPlane::
109 flip() {
110  _plane.flip();
111 }
void flip()
Convenience method to flip the plane in-place.
The abstract base class for all things that can collide with other things in the world, and all the things they can collide with (except geometry).
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
static void flush_level()
Flushes the PStatCollectors used during traversal.