diff --git a/panda/src/bullet/bulletHingeConstraint.cxx b/panda/src/bullet/bulletHingeConstraint.cxx index fd01acded3..755d11ed19 100644 --- a/panda/src/bullet/bulletHingeConstraint.cxx +++ b/panda/src/bullet/bulletHingeConstraint.cxx @@ -22,7 +22,10 @@ TypeHandle BulletHingeConstraint::_type_handle; //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::Constructor // Access: Published -// Description: +// Description: Creates a hinge constraint in the same way as the +// other constructor, but uses the world as second +// body so that node_a is fixed to some point in +// mid-air for example. //////////////////////////////////////////////////////////////////// BulletHingeConstraint:: BulletHingeConstraint(const BulletRigidBodyNode *node_a, @@ -40,7 +43,13 @@ BulletHingeConstraint(const BulletRigidBodyNode *node_a, //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::Constructor // Access: Published -// Description: +// Description: Creates a hinge connecting node_a to node_b. The +// pivot point is the point at which the body is fixed +// to the constraint. In other words: It specifies +// where on each body the rotation axis should be. This +// axis is specified using axis_a and axis_b. +// Remember, everything is specified in the bodies own +// coordinate system! //////////////////////////////////////////////////////////////////// BulletHingeConstraint:: BulletHingeConstraint(const BulletRigidBodyNode *node_a, @@ -98,7 +107,8 @@ get_angular_only() const { //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::set_limit // Access: Published -// Description: +// Description: Sets the lower and upper rotational limits in +// degrees. //////////////////////////////////////////////////////////////////// void BulletHingeConstraint:: set_limit(float low, float high, float softness, float bias, float relaxation) { @@ -112,7 +122,8 @@ set_limit(float low, float high, float softness, float bias, float relaxation) { //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::set_axis // Access: Published -// Description: +// Description: Sets the hinge's rotation axis in world +// coordinates. //////////////////////////////////////////////////////////////////// void BulletHingeConstraint:: set_axis(const LVector3f &axis) { @@ -126,7 +137,7 @@ set_axis(const LVector3f &axis) { //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::get_lower_limit // Access: Published -// Description: +// Description: Returns the lower angular limit in degrees. //////////////////////////////////////////////////////////////////// float BulletHingeConstraint:: get_lower_limit() const { @@ -137,7 +148,7 @@ get_lower_limit() const { //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::get_upper_limit // Access: Published -// Description: +// Description: Returns the upper angular limit in degrees. //////////////////////////////////////////////////////////////////// float BulletHingeConstraint:: get_upper_limit() const { @@ -148,7 +159,8 @@ get_upper_limit() const { //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::get_hinge_angle // Access: Published -// Description: +// Description: Returns the angle between node_a and node_b in +// degrees. //////////////////////////////////////////////////////////////////// float BulletHingeConstraint:: get_hinge_angle() { @@ -159,7 +171,11 @@ get_hinge_angle() { //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::enable_angular_motor // Access: Published -// Description: +// Description: Applies an impulse to the constraint so that the +// angle changes at target_velocity (probably +// degrees/second) where max_impulse is the maximum +// impulse that is used for achieving the specified +// velocity. //////////////////////////////////////////////////////////////////// void BulletHingeConstraint:: enable_angular_motor(bool enable, float target_velocity, float max_impulse) { @@ -181,7 +197,8 @@ enable_motor(bool enable) { //////////////////////////////////////////////////////////////////// // Function: BulletHingeConstraint::set_max_motor_impulse // Access: Published -// Description: +// Description: Sets the maximum impulse used to achieve the +// velocity set in enable_angular_motor. //////////////////////////////////////////////////////////////////// void BulletHingeConstraint:: set_max_motor_impulse(float max_impulse) { diff --git a/panda/src/bullet/bulletHingeConstraint.h b/panda/src/bullet/bulletHingeConstraint.h index f36528f3e1..8217bbbb81 100644 --- a/panda/src/bullet/bulletHingeConstraint.h +++ b/panda/src/bullet/bulletHingeConstraint.h @@ -29,7 +29,9 @@ class BulletRigidBodyNode; //////////////////////////////////////////////////////////////////// // Class : BulletHingeConstraint -// Description : +// Description : The hinge constraint lets two bodies rotate around +// a given axis while adhering to specified limits. +// It's motor can apply angular force to them. //////////////////////////////////////////////////////////////////// class EXPCL_PANDABULLET BulletHingeConstraint : public BulletConstraint { diff --git a/panda/src/bullet/bulletVehicle.I b/panda/src/bullet/bulletVehicle.I index a6cf237aef..330130d525 100644 --- a/panda/src/bullet/bulletVehicle.I +++ b/panda/src/bullet/bulletVehicle.I @@ -38,7 +38,10 @@ get_vehicle() const { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::get_tuning // Access: Published -// Description: +// Description: Returns a reference to the BulletVehicleTuning +// object of this vehicle which offers various +// vehicle-global tuning options. Make sure to +// configure this before adding wheels! //////////////////////////////////////////////////////////////////// BulletVehicleTuning &BulletVehicle:: get_tuning() { @@ -49,7 +52,7 @@ get_tuning() { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::get_num_wheels // Access: Published -// Description: +// Description: Returns the number of wheels this vehicle has. //////////////////////////////////////////////////////////////////// INLINE int BulletVehicle:: get_num_wheels() const { diff --git a/panda/src/bullet/bulletVehicle.cxx b/panda/src/bullet/bulletVehicle.cxx index a78d58f3e0..d317d5f595 100644 --- a/panda/src/bullet/bulletVehicle.cxx +++ b/panda/src/bullet/bulletVehicle.cxx @@ -22,7 +22,8 @@ TypeHandle BulletVehicle::_type_handle; //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::Constructor // Access: Published -// Description: +// Description: Creates a new BulletVehicle instance in the given +// world and with a chassis node. //////////////////////////////////////////////////////////////////// BulletVehicle:: BulletVehicle(BulletWorld *world, BulletRigidBodyNode *chassis) { @@ -38,7 +39,8 @@ BulletVehicle(BulletWorld *world, BulletRigidBodyNode *chassis) { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::set_coordinate_system // Access: Published -// Description: +// Description: Specifies which axis is "up". Nessecary for the +// vehicle's suspension to work properly! //////////////////////////////////////////////////////////////////// void BulletVehicle:: set_coordinate_system(BulletUpAxis up) { @@ -62,7 +64,9 @@ set_coordinate_system(BulletUpAxis up) { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::get_forward_vector // Access: Published -// Description: +// Description: Returns the forward vector representing the car's +// actual direction of movement. The forward vetcor +// is given in global coordinates. //////////////////////////////////////////////////////////////////// LVector3f BulletVehicle:: get_forward_vector() const { @@ -73,7 +77,8 @@ get_forward_vector() const { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::get_chassis // Access: Published -// Description: +// Description: Returns the chassis of this vehicle. The chassis +// is a rigid body node. //////////////////////////////////////////////////////////////////// BulletRigidBodyNode *BulletVehicle:: get_chassis() { @@ -85,7 +90,8 @@ get_chassis() { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::get_current_speed_km_hour // Access: Published -// Description: +// Description: Returns the current speed in kilometers per hour. +// Convert to miles using: km/h * 0.62 = mph //////////////////////////////////////////////////////////////////// float BulletVehicle:: get_current_speed_km_hour() const { @@ -96,7 +102,7 @@ get_current_speed_km_hour() const { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::reset_suspension // Access: Published -// Description: +// Description: Resets the vehicle's suspension. //////////////////////////////////////////////////////////////////// void BulletVehicle:: reset_suspension() { @@ -107,7 +113,8 @@ reset_suspension() { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::get_steering_value // Access: Published -// Description: +// Description: Returns the steering angle of the wheel with index +// idx in degrees. //////////////////////////////////////////////////////////////////// float BulletVehicle:: get_steering_value(int idx) const { @@ -119,7 +126,8 @@ get_steering_value(int idx) const { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::set_steering_value // Access: Published -// Description: +// Description: Sets the steering value (in degrees) of the wheel +// with index idx. //////////////////////////////////////////////////////////////////// void BulletVehicle:: set_steering_value(float steering, int idx) { @@ -131,7 +139,8 @@ set_steering_value(float steering, int idx) { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::apply_engine_force // Access: Published -// Description: +// Description: Applies force at the wheel with index idx for +// acceleration. //////////////////////////////////////////////////////////////////// void BulletVehicle:: apply_engine_force(float force, int idx) { @@ -143,7 +152,7 @@ apply_engine_force(float force, int idx) { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::set_brake // Access: Published -// Description: +// Description: Applies braking force to the wheel with index idx. //////////////////////////////////////////////////////////////////// void BulletVehicle:: set_brake(float brake, int idx) { @@ -166,7 +175,8 @@ set_pitch_control(float pitch) { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::create_wheel // Access: Published -// Description: +// Description: Factory method for creating wheels for this +// vehicle instance. //////////////////////////////////////////////////////////////////// BulletWheel BulletVehicle:: create_wheel() { @@ -208,7 +218,9 @@ get_axis(int idx) { //////////////////////////////////////////////////////////////////// // Function: BulletVehicle::get_wheel // Access: Published -// Description: +// Description: Returns the BulletWheel with index idx. Causes an +// AssertionError if idx is equal or larger than the +// number of wheels. //////////////////////////////////////////////////////////////////// BulletWheel BulletVehicle:: get_wheel(int idx) const { diff --git a/panda/src/bullet/bulletVehicle.h b/panda/src/bullet/bulletVehicle.h index f35d02ab61..cf43fd7919 100644 --- a/panda/src/bullet/bulletVehicle.h +++ b/panda/src/bullet/bulletVehicle.h @@ -30,7 +30,11 @@ class BulletWheel; //////////////////////////////////////////////////////////////////// // Class : BulletVehicleTuning -// Description : +// Description : Simulates a raycast vehicle which casts a ray per +// wheel at the ground as a cheap replacement for +// complex suspension simulation. The suspension can +// be tuned in various ways. It is possible to add a +// (probably) arbitrary number of wheels. //////////////////////////////////////////////////////////////////// class BulletVehicleTuning {