Panda3D
Public Member Functions | Static Public Member Functions | List of all members
BulletWheel Class Reference

One wheel of a BulletVehicle. More...

#include "bulletWheel.h"

Public Member Functions

 BulletWheel (btWheelInfo &info)
 
PN_stdfloat get_brake () const
 Returns the amount of braking force currently applied. More...
 
LPoint3 get_chassis_connection_point_cs () const
 Returns the point where the wheel is connected to the chassis. More...
 
PN_stdfloat get_clipped_inv_connection_point_cs () const
 
PN_stdfloat get_delta_rotation () const
 
PN_stdfloat get_engine_force () const
 Returns the amount of accelleration force currently applied. More...
 
PN_stdfloat get_friction_slip () const
 Returns how slippery the tyres are. More...
 
PN_stdfloat get_max_suspension_force () const
 Returns the maximum force (weight) the suspension can handle. More...
 
PN_stdfloat get_max_suspension_travel_cm () const
 
PandaNodeget_node () const
 Returns the PandaNode which representates the visual appearance of this wheel, if such a representation has been set previously. More...
 
BulletWheelRaycastInfo get_raycast_info () const
 
PN_stdfloat get_roll_influence () const
 Returns the factor by which roll forces are scaled. More...
 
PN_stdfloat get_rotation () const
 
PN_stdfloat get_skid_info () const
 
PN_stdfloat get_steering () const
 Returns the steering angle in degrees. More...
 
PN_stdfloat get_suspension_relative_velocity () const
 
PN_stdfloat get_suspension_rest_length () const
 Returns the length of the suspension when the vehicle is standing still. More...
 
PN_stdfloat get_suspension_stiffness () const
 Returns the stiffness of the suspension. More...
 
LVector3 get_wheel_axle_cs () const
 Returns the normal vector of the wheel axle. More...
 
LVector3 get_wheel_direction_cs () const
 Returns the wheel's forward vector relative to the chassis. More...
 
PN_stdfloat get_wheel_radius () const
 Returns the wheel radius. More...
 
PN_stdfloat get_wheels_damping_compression () const
 Returns the damping applied to the compressing suspension. More...
 
PN_stdfloat get_wheels_damping_relaxation () const
 Returns the damping applied to the relaxing suspension. More...
 
PN_stdfloat get_wheels_suspension_force () const
 
LMatrix4 get_world_transform () const
 
bool is_front_wheel () const
 Determines if a wheel is steerable. More...
 
void set_brake (PN_stdfloat value)
 
void set_chassis_connection_point_cs (const LPoint3 &pos)
 Sets the point where the wheel is connected to the chassis. More...
 
void set_clipped_inv_connection_point_cs (PN_stdfloat value)
 
void set_delta_rotation (PN_stdfloat value)
 
void set_engine_force (PN_stdfloat value)
 Defines how much force should be used to rotate the wheel. More...
 
void set_friction_slip (PN_stdfloat value)
 Sets the slipperyness of the tyre. More...
 
void set_front_wheel (bool value)
 Sets if the wheel is steerable. More...
 
void set_max_suspension_force (PN_stdfloat value)
 Sets the maximum suspension force the wheel can handle. More...
 
void set_max_suspension_travel_cm (PN_stdfloat value)
 Sets the maximum distance the suspension can travel out of the resting position in centimeters. More...
 
void set_node (PandaNode *node)
 Sets the PandaNode which representates the visual appearance of this wheel. More...
 
void set_roll_influence (PN_stdfloat value)
 Defines a scaling factor for roll forces that affect the chassis. More...
 
void set_rotation (PN_stdfloat value)
 
void set_skid_info (PN_stdfloat value)
 
void set_steering (PN_stdfloat value)
 Sets the steering angle. More...
 
void set_suspension_relative_velocity (PN_stdfloat value)
 
void set_suspension_stiffness (PN_stdfloat value)
 Sets how stiff the suspension shall be. More...
 
void set_wheel_axle_cs (const LVector3 &axle)
 Determines the wheel axle normal vector. More...
 
void set_wheel_direction_cs (const LVector3 &dir)
 Sets the wheel's forward vector. More...
 
void set_wheel_radius (PN_stdfloat value)
 Sets the wheel radius. More...
 
void set_wheels_damping_compression (PN_stdfloat value)
 Sets the damping forces applied when the suspension gets compressed. More...
 
void set_wheels_damping_relaxation (PN_stdfloat value)
 Sets the damping forces applied when the suspension relaxes. More...
 
void set_wheels_suspension_force (PN_stdfloat value)
 
void set_world_transform (const LMatrix4 &mat)
 

Static Public Member Functions

static BulletWheel empty ()
 Named constructor intended to be used for asserts with have to return a concrete value. More...
 

Detailed Description

One wheel of a BulletVehicle.

Instances should not be created directly but using the factory method BulletVehicle::create_wheel().

Definition at line 57 of file bulletWheel.h.

Member Function Documentation

◆ empty()

BulletWheel BulletWheel::empty ( )
inlinestatic

Named constructor intended to be used for asserts with have to return a concrete value.

Definition at line 42 of file bulletWheel.I.

Referenced by BulletVehicle::get_wheel().

◆ get_brake()

PN_stdfloat BulletWheel::get_brake ( ) const

Returns the amount of braking force currently applied.

Definition at line 356 of file bulletWheel.cxx.

References set_chassis_connection_point_cs().

Referenced by get_engine_force().

◆ get_chassis_connection_point_cs()

LPoint3 BulletWheel::get_chassis_connection_point_cs ( ) const

Returns the point where the wheel is connected to the chassis.

Definition at line 469 of file bulletWheel.cxx.

References set_wheel_direction_cs().

Referenced by set_chassis_connection_point_cs().

◆ get_engine_force()

PN_stdfloat BulletWheel::get_engine_force ( ) const

Returns the amount of accelleration force currently applied.

Definition at line 333 of file bulletWheel.cxx.

References get_brake().

Referenced by set_engine_force().

◆ get_friction_slip()

PN_stdfloat BulletWheel::get_friction_slip ( ) const

Returns how slippery the tyres are.

Definition at line 122 of file bulletWheel.cxx.

References set_max_suspension_force().

Referenced by set_friction_slip().

◆ get_max_suspension_force()

PN_stdfloat BulletWheel::get_max_suspension_force ( ) const

Returns the maximum force (weight) the suspension can handle.

Definition at line 146 of file bulletWheel.cxx.

References set_wheels_damping_compression().

Referenced by set_max_suspension_force().

◆ get_node()

PandaNode * BulletWheel::get_node ( ) const

Returns the PandaNode which representates the visual appearance of this wheel, if such a representation has been set previously.

Definition at line 587 of file bulletWheel.cxx.

Referenced by set_node().

◆ get_roll_influence()

PN_stdfloat BulletWheel::get_roll_influence ( ) const

Returns the factor by which roll forces are scaled.

See set_roll_influence.

Definition at line 221 of file bulletWheel.cxx.

References set_wheel_radius().

Referenced by set_roll_influence().

◆ get_steering()

PN_stdfloat BulletWheel::get_steering ( ) const

Returns the steering angle in degrees.

Definition at line 265 of file bulletWheel.cxx.

References set_engine_force().

Referenced by set_steering().

◆ get_suspension_rest_length()

PN_stdfloat BulletWheel::get_suspension_rest_length ( ) const

Returns the length of the suspension when the vehicle is standing still.

Definition at line 55 of file bulletWheel.cxx.

References set_suspension_stiffness().

◆ get_suspension_stiffness()

PN_stdfloat BulletWheel::get_suspension_stiffness ( ) const

Returns the stiffness of the suspension.

Definition at line 77 of file bulletWheel.cxx.

References set_max_suspension_travel_cm().

Referenced by set_suspension_stiffness().

◆ get_wheel_axle_cs()

LVector3 BulletWheel::get_wheel_axle_cs ( ) const

Returns the normal vector of the wheel axle.

Definition at line 517 of file bulletWheel.cxx.

References LMatrix4f::is_nan(), and set_front_wheel().

Referenced by set_wheel_axle_cs().

◆ get_wheel_direction_cs()

LVector3 BulletWheel::get_wheel_direction_cs ( ) const

Returns the wheel's forward vector relative to the chassis.

Definition at line 494 of file bulletWheel.cxx.

References set_wheel_axle_cs().

Referenced by set_wheel_direction_cs().

◆ get_wheel_radius()

PN_stdfloat BulletWheel::get_wheel_radius ( ) const

Returns the wheel radius.

Definition at line 243 of file bulletWheel.cxx.

References set_steering().

Referenced by set_wheel_radius().

◆ get_wheels_damping_compression()

PN_stdfloat BulletWheel::get_wheels_damping_compression ( ) const

Returns the damping applied to the compressing suspension.

Definition at line 170 of file bulletWheel.cxx.

References set_wheels_damping_relaxation().

Referenced by set_wheels_damping_compression().

◆ get_wheels_damping_relaxation()

PN_stdfloat BulletWheel::get_wheels_damping_relaxation ( ) const

Returns the damping applied to the relaxing suspension.

Definition at line 194 of file bulletWheel.cxx.

References set_roll_influence().

Referenced by set_wheels_damping_relaxation().

◆ is_front_wheel()

bool BulletWheel::is_front_wheel ( ) const

Determines if a wheel is steerable.

Definition at line 562 of file bulletWheel.cxx.

References set_node().

Referenced by set_front_wheel().

◆ set_chassis_connection_point_cs()

void BulletWheel::set_chassis_connection_point_cs ( const LPoint3 pos)

Sets the point where the wheel is connected to the chassis.

Definition at line 456 of file bulletWheel.cxx.

References get_chassis_connection_point_cs(), and LVecBase3f::is_nan().

Referenced by get_brake().

◆ set_engine_force()

void BulletWheel::set_engine_force ( PN_stdfloat  value)

Defines how much force should be used to rotate the wheel.

Definition at line 321 of file bulletWheel.cxx.

References get_engine_force().

Referenced by get_steering().

◆ set_friction_slip()

void BulletWheel::set_friction_slip ( PN_stdfloat  value)

Sets the slipperyness of the tyre.

Definition at line 111 of file bulletWheel.cxx.

References get_friction_slip().

Referenced by set_max_suspension_travel_cm().

◆ set_front_wheel()

void BulletWheel::set_front_wheel ( bool  value)

Sets if the wheel is steerable.

Definition at line 551 of file bulletWheel.cxx.

References is_front_wheel().

Referenced by get_wheel_axle_cs().

◆ set_max_suspension_force()

void BulletWheel::set_max_suspension_force ( PN_stdfloat  value)

Sets the maximum suspension force the wheel can handle.

Definition at line 134 of file bulletWheel.cxx.

References get_max_suspension_force().

Referenced by get_friction_slip().

◆ set_max_suspension_travel_cm()

void BulletWheel::set_max_suspension_travel_cm ( PN_stdfloat  value)

Sets the maximum distance the suspension can travel out of the resting position in centimeters.

Definition at line 89 of file bulletWheel.cxx.

References set_friction_slip().

Referenced by get_suspension_stiffness().

◆ set_node()

void BulletWheel::set_node ( PandaNode node)

Sets the PandaNode which representates the visual appearance of this wheel.

Definition at line 574 of file bulletWheel.cxx.

References get_node().

Referenced by is_front_wheel().

◆ set_roll_influence()

void BulletWheel::set_roll_influence ( PN_stdfloat  value)

Defines a scaling factor for roll forces that affect the chassis.

0.0 means no roll - the chassis won't ever flip over - while 1.0 means original physical behaviour. Basically, this allows moving the center of mass up and down.

Definition at line 209 of file bulletWheel.cxx.

References get_roll_influence().

Referenced by get_wheels_damping_relaxation().

◆ set_steering()

void BulletWheel::set_steering ( PN_stdfloat  value)

Sets the steering angle.

Definition at line 254 of file bulletWheel.cxx.

References get_steering().

Referenced by get_wheel_radius().

◆ set_suspension_stiffness()

void BulletWheel::set_suspension_stiffness ( PN_stdfloat  value)

Sets how stiff the suspension shall be.

Definition at line 66 of file bulletWheel.cxx.

References get_suspension_stiffness().

Referenced by get_suspension_rest_length().

◆ set_wheel_axle_cs()

void BulletWheel::set_wheel_axle_cs ( const LVector3 axle)

Determines the wheel axle normal vector.

Definition at line 505 of file bulletWheel.cxx.

References get_wheel_axle_cs(), and LVecBase3f::is_nan().

Referenced by get_wheel_direction_cs().

◆ set_wheel_direction_cs()

void BulletWheel::set_wheel_direction_cs ( const LVector3 dir)

Sets the wheel's forward vector.

(Most likely orthogonal to the axle vector.)

Definition at line 481 of file bulletWheel.cxx.

References get_wheel_direction_cs(), and LVecBase3f::is_nan().

Referenced by get_chassis_connection_point_cs().

◆ set_wheel_radius()

void BulletWheel::set_wheel_radius ( PN_stdfloat  value)

Sets the wheel radius.

Definition at line 232 of file bulletWheel.cxx.

References get_wheel_radius().

Referenced by get_roll_influence().

◆ set_wheels_damping_compression()

void BulletWheel::set_wheels_damping_compression ( PN_stdfloat  value)

Sets the damping forces applied when the suspension gets compressed.

Definition at line 158 of file bulletWheel.cxx.

References get_wheels_damping_compression().

Referenced by get_max_suspension_force().

◆ set_wheels_damping_relaxation()

void BulletWheel::set_wheels_damping_relaxation ( PN_stdfloat  value)

Sets the damping forces applied when the suspension relaxes.

Definition at line 182 of file bulletWheel.cxx.

References get_wheels_damping_relaxation().

Referenced by get_wheels_damping_compression().


The documentation for this class was generated from the following files: