00001 // Filename: bulletVehicle.I 00002 // Created by: enn0x (16Feb10) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: BulletVehicle::Destructor 00018 // Access: Published 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE BulletVehicle:: 00022 ~BulletVehicle() { 00023 00024 delete _vehicle; 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: BulletVehicle::get_vehicle 00029 // Access: Public 00030 // Description: 00031 //////////////////////////////////////////////////////////////////// 00032 btRaycastVehicle *BulletVehicle:: 00033 get_vehicle() const { 00034 00035 return _vehicle; 00036 } 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Function: BulletVehicle::get_tuning 00040 // Access: Published 00041 // Description: Returns a reference to the BulletVehicleTuning 00042 // object of this vehicle which offers various 00043 // vehicle-global tuning options. Make sure to 00044 // configure this before adding wheels! 00045 //////////////////////////////////////////////////////////////////// 00046 BulletVehicleTuning &BulletVehicle:: 00047 get_tuning() { 00048 00049 return _tuning; 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: BulletVehicle::get_num_wheels 00054 // Access: Published 00055 // Description: Returns the number of wheels this vehicle has. 00056 //////////////////////////////////////////////////////////////////// 00057 INLINE int BulletVehicle:: 00058 get_num_wheels() const { 00059 00060 return _vehicle->getNumWheels(); 00061 } 00062 00063 //////////////////////////////////////////////////////////////////// 00064 // Function: BulletVehicleTuning::set_suspension_stiffness 00065 // Access: Published 00066 // Description: 00067 //////////////////////////////////////////////////////////////////// 00068 void BulletVehicleTuning:: 00069 set_suspension_stiffness(PN_stdfloat value) { 00070 00071 _.m_suspensionStiffness = (btScalar)value; 00072 } 00073 00074 //////////////////////////////////////////////////////////////////// 00075 // Function: BulletVehicleTuning::set_suspension_compression 00076 // Access: Published 00077 // Description: 00078 //////////////////////////////////////////////////////////////////// 00079 void BulletVehicleTuning:: 00080 set_suspension_compression(PN_stdfloat value) { 00081 00082 _.m_suspensionCompression = (btScalar)value; 00083 } 00084 00085 //////////////////////////////////////////////////////////////////// 00086 // Function: BulletVehicleTuning::set_suspension_damping 00087 // Access: Published 00088 // Description: 00089 //////////////////////////////////////////////////////////////////// 00090 void BulletVehicleTuning:: 00091 set_suspension_damping(PN_stdfloat value) { 00092 00093 _.m_suspensionDamping = (btScalar)value; 00094 } 00095 00096 //////////////////////////////////////////////////////////////////// 00097 // Function: BulletVehicleTuning::set_max_suspension_travel_cm 00098 // Access: Published 00099 // Description: 00100 //////////////////////////////////////////////////////////////////// 00101 void BulletVehicleTuning:: 00102 set_max_suspension_travel_cm(PN_stdfloat value) { 00103 00104 _.m_maxSuspensionTravelCm = (btScalar)value; 00105 } 00106 00107 //////////////////////////////////////////////////////////////////// 00108 // Function: BulletVehicleTuning::set_friction_slip 00109 // Access: Published 00110 // Description: 00111 //////////////////////////////////////////////////////////////////// 00112 void BulletVehicleTuning:: 00113 set_friction_slip(PN_stdfloat value) { 00114 00115 _.m_frictionSlip = (btScalar)value; 00116 } 00117 00118 //////////////////////////////////////////////////////////////////// 00119 // Function: BulletVehicleTuning::set_max_suspension_force 00120 // Access: Published 00121 // Description: 00122 //////////////////////////////////////////////////////////////////// 00123 void BulletVehicleTuning:: 00124 set_max_suspension_force(PN_stdfloat value) { 00125 00126 _.m_maxSuspensionForce = (btScalar)value; 00127 } 00128 00129 //////////////////////////////////////////////////////////////////// 00130 // Function: BulletVehicleTuning::get_suspension_stiffness 00131 // Access: Published 00132 // Description: 00133 //////////////////////////////////////////////////////////////////// 00134 PN_stdfloat BulletVehicleTuning:: 00135 get_suspension_stiffness() const { 00136 00137 return (PN_stdfloat)_.m_suspensionStiffness; 00138 } 00139 00140 //////////////////////////////////////////////////////////////////// 00141 // Function: BulletVehicleTuning::get_suspension_compression 00142 // Access: Published 00143 // Description: 00144 //////////////////////////////////////////////////////////////////// 00145 PN_stdfloat BulletVehicleTuning:: 00146 get_suspension_compression() const { 00147 00148 return (PN_stdfloat)_.m_suspensionCompression; 00149 } 00150 00151 //////////////////////////////////////////////////////////////////// 00152 // Function: BulletVehicleTuning::get_suspension_damping 00153 // Access: Published 00154 // Description: 00155 //////////////////////////////////////////////////////////////////// 00156 PN_stdfloat BulletVehicleTuning:: 00157 get_suspension_damping() const { 00158 00159 return (PN_stdfloat)_.m_suspensionDamping; 00160 } 00161 00162 //////////////////////////////////////////////////////////////////// 00163 // Function: BulletVehicleTuning::get_max_suspension_travel_cm 00164 // Access: Published 00165 // Description: 00166 //////////////////////////////////////////////////////////////////// 00167 PN_stdfloat BulletVehicleTuning:: 00168 get_max_suspension_travel_cm() const { 00169 00170 return (PN_stdfloat)_.m_maxSuspensionTravelCm; 00171 } 00172 00173 //////////////////////////////////////////////////////////////////// 00174 // Function: BulletVehicleTuning::get_friction_slip 00175 // Access: Published 00176 // Description: 00177 //////////////////////////////////////////////////////////////////// 00178 PN_stdfloat BulletVehicleTuning:: 00179 get_friction_slip() const { 00180 00181 return (PN_stdfloat)_.m_frictionSlip; 00182 } 00183 00184 //////////////////////////////////////////////////////////////////// 00185 // Function: BulletVehicleTuning::get_max_suspension_force 00186 // Access: Published 00187 // Description: 00188 //////////////////////////////////////////////////////////////////// 00189 PN_stdfloat BulletVehicleTuning:: 00190 get_max_suspension_force() const { 00191 00192 return (PN_stdfloat)_.m_maxSuspensionForce; 00193 } 00194