Panda3D
bulletWheel.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file bulletWheel.h
10  * @author enn0x
11  * @date 2010-02-17
12  */
13 
14 #ifndef __BULLET_WHEEL_H__
15 #define __BULLET_WHEEL_H__
16 
17 #include "pandabase.h"
18 
19 #include "bullet_includes.h"
20 #include "bullet_utils.h"
21 
22 #include "luse.h"
23 #include "pandaNode.h"
24 
25 /**
26  *
27  */
28 class EXPCL_PANDABULLET BulletWheelRaycastInfo {
29 
30 PUBLISHED:
31  INLINE ~BulletWheelRaycastInfo();
32 
33  bool is_in_contact() const;
34  PN_stdfloat get_suspension_length() const;
35  LVector3 get_contact_normal_ws() const;
36  LVector3 get_wheel_direction_ws() const;
37  LVector3 get_wheel_axle_ws() const;
38  LPoint3 get_contact_point_ws() const;
39  LPoint3 get_hard_point_ws() const;
40  PandaNode *get_ground_object() const;
41 
42  MAKE_PROPERTY(in_contact, is_in_contact);
43  MAKE_PROPERTY(suspension_length, get_suspension_length);
44  MAKE_PROPERTY(contact_normal_ws, get_contact_normal_ws);
45  MAKE_PROPERTY(wheel_direction_ws, get_wheel_direction_ws);
46  MAKE_PROPERTY(wheel_axle_ws, get_wheel_axle_ws);
47  MAKE_PROPERTY(contact_point_ws, get_contact_point_ws);
48  MAKE_PROPERTY(hard_point_ws, get_hard_point_ws);
49  MAKE_PROPERTY(ground_object, get_ground_object);
50 
51 public:
52  BulletWheelRaycastInfo(btWheelInfo::RaycastInfo &info);
53 
54 private:
55  btWheelInfo::RaycastInfo &_info;
56 };
57 
58 /**
59  * One wheel of a BulletVehicle. Instances should not be created directly but
60  * using the factory method BulletVehicle::create_wheel().
61  */
62 class EXPCL_PANDABULLET BulletWheel {
63 
64 PUBLISHED:
65  INLINE ~BulletWheel();
66 
67  void set_suspension_stiffness(PN_stdfloat value);
68  void set_max_suspension_travel_cm(PN_stdfloat value);
69  void set_friction_slip(PN_stdfloat value);
70  void set_max_suspension_force(PN_stdfloat value);
71  void set_wheels_damping_compression(PN_stdfloat value);
72  void set_wheels_damping_relaxation(PN_stdfloat value);
73  void set_roll_influence(PN_stdfloat value);
74  void set_wheel_radius(PN_stdfloat value);
75  void set_steering(PN_stdfloat value);
76  void set_rotation(PN_stdfloat value);
77  void set_delta_rotation(PN_stdfloat value);
78  void set_engine_force(PN_stdfloat value);
79  void set_brake(PN_stdfloat value);
80  void set_skid_info(PN_stdfloat value);
81  void set_wheels_suspension_force(PN_stdfloat value);
82  void set_suspension_relative_velocity(PN_stdfloat value);
83  void set_clipped_inv_connection_point_cs(PN_stdfloat value);
84  void set_chassis_connection_point_cs(const LPoint3 &pos);
85  void set_wheel_direction_cs(const LVector3 &dir);
86  void set_wheel_axle_cs(const LVector3 &axle);
87  void set_world_transform(const LMatrix4 &mat);
88  void set_front_wheel(bool value);
89  void set_node(PandaNode *node);
90 
91  PN_stdfloat get_suspension_rest_length() const;
92  PN_stdfloat get_suspension_stiffness() const;
93  PN_stdfloat get_max_suspension_travel_cm() const;
94  PN_stdfloat get_friction_slip() const;
95  PN_stdfloat get_max_suspension_force() const;
96  PN_stdfloat get_wheels_damping_compression() const;
97  PN_stdfloat get_wheels_damping_relaxation() const;
98  PN_stdfloat get_roll_influence() const;
99  PN_stdfloat get_wheel_radius() const;
100  PN_stdfloat get_steering() const;
101  PN_stdfloat get_rotation() const;
102  PN_stdfloat get_delta_rotation() const;
103  PN_stdfloat get_engine_force() const;
104  PN_stdfloat get_brake() const;
105  PN_stdfloat get_skid_info() const;
106  PN_stdfloat get_wheels_suspension_force() const;
107  PN_stdfloat get_suspension_relative_velocity() const;
108  PN_stdfloat get_clipped_inv_connection_point_cs() const;
109  LPoint3 get_chassis_connection_point_cs() const;
110  LVector3 get_wheel_direction_cs() const;
111  LVector3 get_wheel_axle_cs() const;
112  LMatrix4 get_world_transform() const;
113  bool is_front_wheel() const;
114  PandaNode *get_node() const;
115  BulletWheelRaycastInfo get_raycast_info() const;
116 
117  MAKE_PROPERTY(raycast_info, get_raycast_info);
118  MAKE_PROPERTY(suspension_rest_length, get_suspension_rest_length);
119  MAKE_PROPERTY(suspension_stiffness, get_suspension_stiffness, set_suspension_stiffness);
120  MAKE_PROPERTY(max_suspension_travel_cm, get_max_suspension_travel_cm, set_max_suspension_travel_cm);
121  MAKE_PROPERTY(friction_slip, get_friction_slip, set_friction_slip);
122  MAKE_PROPERTY(max_suspension_force, get_max_suspension_force, set_max_suspension_force);
123  MAKE_PROPERTY(wheels_damping_compression, get_wheels_damping_compression, set_wheels_damping_compression);
124  MAKE_PROPERTY(wheels_damping_relaxation, get_wheels_damping_relaxation, set_wheels_damping_relaxation);
125  MAKE_PROPERTY(roll_influence, get_roll_influence, set_roll_influence);
126  MAKE_PROPERTY(wheel_radius, get_wheel_radius, set_wheel_radius);
127  MAKE_PROPERTY(steering, get_steering, set_steering);
128  MAKE_PROPERTY(rotation, get_rotation, set_rotation);
129  MAKE_PROPERTY(delta_rotation, get_delta_rotation, set_delta_rotation);
130  MAKE_PROPERTY(engine_force, get_engine_force, set_engine_force);
131  MAKE_PROPERTY(brake, get_brake, set_brake);
132  MAKE_PROPERTY(skid_info, get_skid_info, set_skid_info);
133  MAKE_PROPERTY(wheels_suspension_force, get_wheels_suspension_force, set_wheels_suspension_force);
134  MAKE_PROPERTY(suspension_relative_velocity, get_suspension_relative_velocity, set_suspension_relative_velocity);
135  MAKE_PROPERTY(clipped_inv_connection_point_cs, get_clipped_inv_connection_point_cs, set_clipped_inv_connection_point_cs);
136  MAKE_PROPERTY(chassis_connection_point_cs, get_chassis_connection_point_cs, set_chassis_connection_point_cs);
137  MAKE_PROPERTY(wheel_direction_cs, get_wheel_direction_cs, set_wheel_direction_cs);
138  MAKE_PROPERTY(wheel_axle_cs, get_wheel_axle_cs, set_wheel_axle_cs);
139  MAKE_PROPERTY(world_transform, get_world_transform, set_world_transform);
140  MAKE_PROPERTY(front_wheel, is_front_wheel, set_front_wheel);
141  MAKE_PROPERTY(node, get_node, set_node);
142 
143 public:
144  BulletWheel(btWheelInfo &info);
145 
146  INLINE static BulletWheel empty();
147 
148 private:
149  btWheelInfo &_info;
150 };
151 
152 #include "bulletWheel.I"
153 
154 #endif // __BULLET_WHEEL_H__
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
One wheel of a BulletVehicle.
Definition: bulletWheel.h:62