Panda3D
 All Classes Functions Variables Enumerations
bulletVehicle.I
1 // Filename: bulletVehicle.I
2 // Created by: enn0x (16Feb10)
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: BulletVehicle::Destructor
18 // Access: Published
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE BulletVehicle::
22 ~BulletVehicle() {
23 
24  delete _vehicle;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: BulletVehicle::get_vehicle
29 // Access: Public
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 btRaycastVehicle *BulletVehicle::
33 get_vehicle() const {
34 
35  return _vehicle;
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: BulletVehicle::get_tuning
40 // Access: Published
41 // Description: Returns a reference to the BulletVehicleTuning
42 // object of this vehicle which offers various
43 // vehicle-global tuning options. Make sure to
44 // configure this before adding wheels!
45 ////////////////////////////////////////////////////////////////////
48 
49  return _tuning;
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: BulletVehicle::get_num_wheels
54 // Access: Published
55 // Description: Returns the number of wheels this vehicle has.
56 ////////////////////////////////////////////////////////////////////
57 INLINE int BulletVehicle::
58 get_num_wheels() const {
59 
60  return _vehicle->getNumWheels();
61 }
62 
63 ////////////////////////////////////////////////////////////////////
64 // Function: BulletVehicleTuning::set_suspension_stiffness
65 // Access: Published
66 // Description:
67 ////////////////////////////////////////////////////////////////////
68 void BulletVehicleTuning::
69 set_suspension_stiffness(PN_stdfloat value) {
70 
71  _.m_suspensionStiffness = (btScalar)value;
72 }
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: BulletVehicleTuning::set_suspension_compression
76 // Access: Published
77 // Description:
78 ////////////////////////////////////////////////////////////////////
79 void BulletVehicleTuning::
80 set_suspension_compression(PN_stdfloat value) {
81 
82  _.m_suspensionCompression = (btScalar)value;
83 }
84 
85 ////////////////////////////////////////////////////////////////////
86 // Function: BulletVehicleTuning::set_suspension_damping
87 // Access: Published
88 // Description:
89 ////////////////////////////////////////////////////////////////////
90 void BulletVehicleTuning::
91 set_suspension_damping(PN_stdfloat value) {
92 
93  _.m_suspensionDamping = (btScalar)value;
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function: BulletVehicleTuning::set_max_suspension_travel_cm
98 // Access: Published
99 // Description:
100 ////////////////////////////////////////////////////////////////////
101 void BulletVehicleTuning::
102 set_max_suspension_travel_cm(PN_stdfloat value) {
103 
104  _.m_maxSuspensionTravelCm = (btScalar)value;
105 }
106 
107 ////////////////////////////////////////////////////////////////////
108 // Function: BulletVehicleTuning::set_friction_slip
109 // Access: Published
110 // Description:
111 ////////////////////////////////////////////////////////////////////
112 void BulletVehicleTuning::
113 set_friction_slip(PN_stdfloat value) {
114 
115  _.m_frictionSlip = (btScalar)value;
116 }
117 
118 ////////////////////////////////////////////////////////////////////
119 // Function: BulletVehicleTuning::set_max_suspension_force
120 // Access: Published
121 // Description:
122 ////////////////////////////////////////////////////////////////////
123 void BulletVehicleTuning::
124 set_max_suspension_force(PN_stdfloat value) {
125 
126  _.m_maxSuspensionForce = (btScalar)value;
127 }
128 
129 ////////////////////////////////////////////////////////////////////
130 // Function: BulletVehicleTuning::get_suspension_stiffness
131 // Access: Published
132 // Description:
133 ////////////////////////////////////////////////////////////////////
134 PN_stdfloat BulletVehicleTuning::
135 get_suspension_stiffness() const {
136 
137  return (PN_stdfloat)_.m_suspensionStiffness;
138 }
139 
140 ////////////////////////////////////////////////////////////////////
141 // Function: BulletVehicleTuning::get_suspension_compression
142 // Access: Published
143 // Description:
144 ////////////////////////////////////////////////////////////////////
145 PN_stdfloat BulletVehicleTuning::
146 get_suspension_compression() const {
147 
148  return (PN_stdfloat)_.m_suspensionCompression;
149 }
150 
151 ////////////////////////////////////////////////////////////////////
152 // Function: BulletVehicleTuning::get_suspension_damping
153 // Access: Published
154 // Description:
155 ////////////////////////////////////////////////////////////////////
156 PN_stdfloat BulletVehicleTuning::
157 get_suspension_damping() const {
158 
159  return (PN_stdfloat)_.m_suspensionDamping;
160 }
161 
162 ////////////////////////////////////////////////////////////////////
163 // Function: BulletVehicleTuning::get_max_suspension_travel_cm
164 // Access: Published
165 // Description:
166 ////////////////////////////////////////////////////////////////////
167 PN_stdfloat BulletVehicleTuning::
168 get_max_suspension_travel_cm() const {
169 
170  return (PN_stdfloat)_.m_maxSuspensionTravelCm;
171 }
172 
173 ////////////////////////////////////////////////////////////////////
174 // Function: BulletVehicleTuning::get_friction_slip
175 // Access: Published
176 // Description:
177 ////////////////////////////////////////////////////////////////////
178 PN_stdfloat BulletVehicleTuning::
179 get_friction_slip() const {
180 
181  return (PN_stdfloat)_.m_frictionSlip;
182 }
183 
184 ////////////////////////////////////////////////////////////////////
185 // Function: BulletVehicleTuning::get_max_suspension_force
186 // Access: Published
187 // Description:
188 ////////////////////////////////////////////////////////////////////
189 PN_stdfloat BulletVehicleTuning::
190 get_max_suspension_force() const {
191 
192  return (PN_stdfloat)_.m_maxSuspensionForce;
193 }
194 
BulletVehicleTuning & get_tuning()
Returns a reference to the BulletVehicleTuning object of this vehicle which offers various vehicle-gl...
Definition: bulletVehicle.I:47
int get_num_wheels() const
Returns the number of wheels this vehicle has.
Definition: bulletVehicle.I:58