Panda3D
bulletWheel.h
1 // Filename: bulletWheel.h
2 // Created by: enn0x (17Feb10)
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 #ifndef __BULLET_WHEEL_H__
16 #define __BULLET_WHEEL_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 #include "bullet_utils.h"
22 
23 #include "luse.h"
24 #include "pandaNode.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : BulletWheelRaycastInfo
28 // Description :
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDABULLET BulletWheelRaycastInfo {
31 
32 PUBLISHED:
33  INLINE ~BulletWheelRaycastInfo();
34 
35  INLINE bool is_in_contact() const;
36  INLINE PN_stdfloat get_suspension_length() const;
37  INLINE LVector3 get_contact_normal_ws() const;
38  INLINE LVector3 get_wheel_direction_ws() const;
39  INLINE LVector3 get_wheel_axle_ws() const;
40  INLINE LPoint3 get_contact_point_ws() const;
41  INLINE LPoint3 get_hard_point_ws() const;
42  INLINE PandaNode *get_ground_object() const;
43 
44 public:
45  BulletWheelRaycastInfo(btWheelInfo::RaycastInfo &info);
46 
47 private:
48  btWheelInfo::RaycastInfo &_info;
49 };
50 
51 ////////////////////////////////////////////////////////////////////
52 // Class : BulletWheel
53 // Description : One wheel of a BulletVehicle. Instances should not
54 // be created directly but using the factory method
55 // BulletVehicle::create_wheel().
56 ////////////////////////////////////////////////////////////////////
57 class EXPCL_PANDABULLET BulletWheel {
58 
59 PUBLISHED:
60  INLINE ~BulletWheel();
61 
62  void set_suspension_stiffness(PN_stdfloat value);
63  void set_max_suspension_travel_cm(PN_stdfloat value);
64  void set_friction_slip(PN_stdfloat value);
65  void set_max_suspension_force(PN_stdfloat value);
66  void set_wheels_damping_compression(PN_stdfloat value);
67  void set_wheels_damping_relaxation(PN_stdfloat value);
68  void set_roll_influence(PN_stdfloat value);
69  void set_wheel_radius(PN_stdfloat value);
70  void set_steering(PN_stdfloat value);
71  void set_rotation(PN_stdfloat value);
72  void set_delta_rotation(PN_stdfloat value);
73  void set_engine_force(PN_stdfloat value);
74  void set_brake(PN_stdfloat value);
75  void set_skid_info(PN_stdfloat value);
76  void set_wheels_suspension_force(PN_stdfloat value);
77  void set_suspension_relative_velocity(PN_stdfloat value);
78  void set_clipped_inv_connection_point_cs(PN_stdfloat value);
79  void set_chassis_connection_point_cs(const LPoint3 &pos);
80  void set_wheel_direction_cs(const LVector3 &dir);
81  void set_wheel_axle_cs(const LVector3 &axle);
82  void set_world_transform(const LMatrix4 &mat);
83  void set_front_wheel(bool value);
84  void set_node(PandaNode *node);
85 
86  PN_stdfloat get_suspension_rest_length() const;
87  PN_stdfloat get_suspension_stiffness() const;
88  PN_stdfloat get_max_suspension_travel_cm() const;
89  PN_stdfloat get_friction_slip() const;
90  PN_stdfloat get_max_suspension_force() const;
91  PN_stdfloat get_wheels_damping_compression() const;
92  PN_stdfloat get_wheels_damping_relaxation() const;
93  PN_stdfloat get_roll_influence() const;
94  PN_stdfloat get_wheel_radius() const;
95  PN_stdfloat get_steering() const;
96  PN_stdfloat get_rotation() const;
97  PN_stdfloat get_delta_rotation() const;
98  PN_stdfloat get_engine_force() const;
99  PN_stdfloat get_brake() const;
100  PN_stdfloat get_skid_info() const;
101  PN_stdfloat get_wheels_suspension_force() const;
102  PN_stdfloat get_suspension_relative_velocity() const;
103  PN_stdfloat get_clipped_inv_connection_point_cs() const;
104  LPoint3 get_chassis_connection_point_cs() const;
105  LVector3 get_wheel_direction_cs() const;
106  LVector3 get_wheel_axle_cs() const;
107  LMatrix4 get_world_transform() const;
108  bool is_front_wheel() const;
109  PandaNode *get_node() const;
110  BulletWheelRaycastInfo get_raycast_info() const;
111 
112 public:
113  BulletWheel(btWheelInfo &info);
114 
115  INLINE static BulletWheel empty();
116 
117 private:
118  btWheelInfo &_info;
119 };
120 
121 #include "bulletWheel.I"
122 
123 #endif // __BULLET_WHEEL_H__
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
One wheel of a BulletVehicle.
Definition: bulletWheel.h:57