Panda3D
collisionParabola.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 collisionParabola.I
10  * @author drose
11  * @date 2007-10-11
12  */
13 
14 /**
15  * Creates an invalid parabola.
16  */
19  _t1(0.0f), _t2(0.0f)
20 {
21 }
22 
23 /**
24  * Creates a parabola with the endpoints between t1 and t2 in the parametric
25  * space of the parabola.
26  */
28 CollisionParabola(const LParabola &parabola, PN_stdfloat t1, PN_stdfloat t2) :
29  _parabola(parabola),
30  _t1(t1), _t2(t2)
31 {
32 }
33 
34 /**
35  *
36  */
39  _parabola(copy._parabola),
40  _t1(copy._t1), _t2(copy._t2)
41 {
42 }
43 
44 /**
45  * Replaces the parabola specified by this solid.
46  */
47 INLINE void CollisionParabola::
48 set_parabola(const LParabola &parabola) {
49  _parabola = parabola;
50  mark_internal_bounds_stale();
51  mark_viz_stale();
52 }
53 
54 /**
55  * Returns the parabola specified by this solid.
56  */
57 INLINE const LParabola &CollisionParabola::
58 get_parabola() const {
59  return _parabola;
60 }
61 
62 /**
63  * Changes the starting point on the parabola.
64  */
65 INLINE void CollisionParabola::
66 set_t1(PN_stdfloat t1) {
67  _t1 = t1;
68  mark_internal_bounds_stale();
69  mark_viz_stale();
70 }
71 
72 /**
73  * Returns the starting point on the parabola.
74  */
75 INLINE PN_stdfloat CollisionParabola::
76 get_t1() const {
77  return _t1;
78 }
79 
80 /**
81  * Changes the ending point on the parabola.
82  */
83 INLINE void CollisionParabola::
84 set_t2(PN_stdfloat t2) {
85  _t2 = t2;
86  mark_internal_bounds_stale();
87  mark_viz_stale();
88 }
89 
90 /**
91  * Returns the ending point on the parabola.
92  */
93 INLINE PN_stdfloat CollisionParabola::
94 get_t2() const {
95  return _t2;
96 }
set_t1
Changes the starting point on the parabola.
set_parabola
Replaces the parabola specified by this solid.
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...
set_t2
Changes the ending point on the parabola.