07-20-2005, 03:26 AM,
|
|
handbrake?
I coded one an can post the modification to do if someone is interested :wink:
|
|
07-21-2005, 12:00 PM,
|
|
handbrake?
ok.. so today the handbrake ! So first, to apply the handbrake to rear wheels, we got to know the position of each wheel. So open Wheel.h and in the private section, declare the "rear" variable like this :<pre>bool m_is_rear;</pre>if this variable is true, the wheel is a rear wheel. We got to set it when the car is loaded. To do this, we got to change the Constructor like this :<pre>Wheel (double mass, Vamos_Geometry::Three_Vector position, double tire_offset, double roll_height, double restitution, Suspension* suspension, const Tire& tire, const Brake& brake, bool steered, bool driven, Vamos_Geometry::Side side, bool is_rear);</pre> always in Wheel.hTo know if the wheel is a rear wheel, we add this little public function in Wheel.h :<pre>bool is_rear () const { return m_is_rear; }</pre>Now we change the constructor in Wheel.cc :<pre>Vamos_Body::Wheel::Wheel (double mass, Three_Vector position, double tire_offset, double roll_height, double restitution, Suspension* suspension, const Tire& tire, const Brake& brake, bool steered, bool driven, Side side, bool is_rear) :</pre>and in the constructor <pre> ... m_rotation (0.0), m_is_rear(is_rear){}</pre>We can now specifiy to the wheel its position so let's doing it !in Car.cc, in CarReader:
|
|
|