Panda3D
collisionParabola.I
1 // Filename: collisionParabola.I
2 // Created by: drose (11Oct07)
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: CollisionParabola::Default Constructor
18 // Access: Published
19 // Description: Creates an invalid parabola.
20 ////////////////////////////////////////////////////////////////////
23  _t1(0.0f), _t2(0.0f)
24 {
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: CollisionParabola::Constructor
29 // Access: Published
30 // Description: Creates a parabola with the endpoints between t1 and
31 // t2 in the parametric space of the parabola.
32 ////////////////////////////////////////////////////////////////////
34 CollisionParabola(const LParabola &parabola, PN_stdfloat t1, PN_stdfloat t2) :
35  _parabola(parabola),
36  _t1(t1), _t2(t2)
37 {
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: CollisionParabola::Copy Constructor
42 // Access: Public
43 // Description:
44 ////////////////////////////////////////////////////////////////////
47  _parabola(copy._parabola),
48  _t1(copy._t1), _t2(copy._t2)
49 {
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: CollisionParabola::set_parabola
54 // Access: Public
55 // Description: Replaces the parabola specified by this solid.
56 ////////////////////////////////////////////////////////////////////
57 INLINE void CollisionParabola::
58 set_parabola(const LParabola &parabola) {
59  _parabola = parabola;
60  mark_internal_bounds_stale();
61  mark_viz_stale();
62 }
63 
64 ////////////////////////////////////////////////////////////////////
65 // Function: CollisionParabola::get_parabola
66 // Access: Public
67 // Description: Returns the parabola specified by this solid.
68 ////////////////////////////////////////////////////////////////////
69 INLINE const LParabola &CollisionParabola::
70 get_parabola() const {
71  return _parabola;
72 }
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: CollisionParabola::set_t1
76 // Access: Public
77 // Description: Changes the starting point on the parabola.
78 ////////////////////////////////////////////////////////////////////
79 INLINE void CollisionParabola::
80 set_t1(PN_stdfloat t1) {
81  _t1 = t1;
82  mark_internal_bounds_stale();
83  mark_viz_stale();
84 }
85 
86 ////////////////////////////////////////////////////////////////////
87 // Function: CollisionParabola::get_t1
88 // Access: Public
89 // Description: Returns the starting point on the parabola.
90 ////////////////////////////////////////////////////////////////////
91 INLINE PN_stdfloat CollisionParabola::
92 get_t1() const {
93  return _t1;
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function: CollisionParabola::set_t2
98 // Access: Public
99 // Description: Changes the ending point on the parabola.
100 ////////////////////////////////////////////////////////////////////
101 INLINE void CollisionParabola::
102 set_t2(PN_stdfloat t2) {
103  _t2 = t2;
104  mark_internal_bounds_stale();
105  mark_viz_stale();
106 }
107 
108 ////////////////////////////////////////////////////////////////////
109 // Function: CollisionParabola::get_t2
110 // Access: Public
111 // Description: Returns the ending point on the parabola.
112 ////////////////////////////////////////////////////////////////////
113 INLINE PN_stdfloat CollisionParabola::
114 get_t2() const {
115  return _t2;
116 }
const LParabola & get_parabola() const
Returns the parabola specified by this solid.
PN_stdfloat get_t1() const
Returns the starting point on the parabola.
PN_stdfloat get_t2() const
Returns the ending point on the parabola.
void set_t2(PN_stdfloat t2)
Changes the ending point on the parabola.
CollisionParabola()
Creates an invalid parabola.
This defines a parabolic arc, or subset of an arc, similar to the path of a projectile or falling obj...
void set_parabola(const LParabola &parabola)
Replaces the parabola specified by this solid.
void set_t1(PN_stdfloat t1)
Changes the starting point on the parabola.