Panda3D
 All Classes Functions Variables Enumerations
bulletSoftBodyControl.h
1 // Filename: bulletSoftBodyControl.h
2 // Created by: enn0x (04Mar10)
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_SOFT_BODY_CONTROL_H__
16 #define __BULLET_SOFT_BODY_CONTROL_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 #include "bullet_utils.h"
22 
23 #include "luse.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : BulletSoftBodyControl
27 // Description :
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDABULLET BulletSoftBodyControl : public btSoftBody::AJoint::IControl {
30 
31 PUBLISHED:
33  virtual ~BulletSoftBodyControl();
34 
35  // Motor
36  INLINE void set_goal(PN_stdfloat goal);
37  INLINE void set_max_torque(PN_stdfloat maxtorque);
38 
39  //INLINE PN_stdfloat get_goal() const;
40  //INLINE PN_stdfloat get_max_torque() const;
41 
42  // Steer
43  INLINE void set_angle(PN_stdfloat angle);
44  INLINE void set_sign(PN_stdfloat sign);
45 
46  //INLINE PN_stdfloat get_angle() const;
47  //INLINE PN_stdfloat get_sign() const;
48 
49 public:
50  void Prepare(btSoftBody::AJoint* joint);
51  btScalar Speed(btSoftBody::AJoint *joint, btScalar current);
52 
53 private:
54  // Motor
55  btScalar _goal;
56  btScalar _maxtorque;
57 
58  // Steer
59  btScalar _angle;
60  btScalar _sign;
61 };
62 
63 #include "bulletSoftBodyControl.I"
64 
65 #endif // __BULLET_SOFT_BODY_CONTROL_H__