Panda3D
physxD6Joint.h
1 // Filename: physxD6Joint.h
2 // Created by: enn0x (02Oct09)
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 PHYSXD6JOINT_H
16 #define PHYSXD6JOINT_H
17 
18 #include "pandabase.h"
19 
20 #include "physxJoint.h"
21 #include "physx_includes.h"
22 
23 class PhysxD6JointDesc;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : PhysxD6Joint
27 // Description : A D6 joint is a general constraint between two
28 // actors. It allows the user to individually define
29 // the linear and rotational degrees of freedom. It
30 // also allows the user to configure the joint with
31 // limits and driven degrees of freedom as they wish.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDAPHYSX PhysxD6Joint : public PhysxJoint {
34 
35 PUBLISHED:
36  INLINE PhysxD6Joint();
37  INLINE ~PhysxD6Joint();
38 
39  void save_to_desc(PhysxD6JointDesc &jointDesc) const;
40  void load_from_desc(const PhysxD6JointDesc &jointDesc);
41 
42  void set_drive_angular_velocity(const LVector3f &v);
43  void set_drive_linear_velocity(const LVector3f &v);
44  void set_drive_orientation(const LQuaternionf &quat);
45  void set_drive_position(const LPoint3f &pos);
46 
47 ////////////////////////////////////////////////////////////////////
48 public:
49  INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; };
50 
51  void link(NxJoint *jointPtr);
52  void unlink();
53 
54 private:
55  NxD6Joint *_ptr;
56 
57 ////////////////////////////////////////////////////////////////////
58 public:
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62  static void init_type() {
63  PhysxJoint::init_type();
64  register_type(_type_handle, "PhysxD6Joint",
65  PhysxJoint::get_class_type());
66  }
67  virtual TypeHandle get_type() const {
68  return get_class_type();
69  }
70  virtual TypeHandle force_init_type() {
71  init_type();
72  return get_class_type();
73  }
74 
75 private:
76  static TypeHandle _type_handle;
77 };
78 
79 #include "physxD6Joint.I"
80 
81 #endif // PHYSXD6JOINT_H
Abstract base class for the different types of joints.
Definition: physxJoint.h:35
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
A D6 joint is a general constraint between two actors.
Definition: physxD6Joint.h:33
This is the base quaternion class.
Definition: lquaternion.h:96
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85