Panda3D
physxDistanceJoint.h
1 // Filename: physxDistanceJoint.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 PHYSXDISTANCEJOINT_H
16 #define PHYSXDISTANCEJOINT_H
17 
18 #include "pandabase.h"
19 
20 #include "physxJoint.h"
21 #include "physx_includes.h"
22 
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : PhysxDistanceJoint
27 // Description : A distance joint maintains a certain distance
28 // between two points on two actors.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAPHYSX PhysxDistanceJoint : public PhysxJoint {
31 
32 PUBLISHED:
33  INLINE PhysxDistanceJoint();
34  INLINE ~PhysxDistanceJoint();
35 
36  void save_to_desc(PhysxDistanceJointDesc &jointDesc) const;
37  void load_from_desc(const PhysxDistanceJointDesc &jointDesc);
38 
39 ////////////////////////////////////////////////////////////////////
40 public:
41  INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; };
42 
43  void link(NxJoint *jointPtr);
44  void unlink();
45 
46 private:
47  NxDistanceJoint *_ptr;
48 
49 ////////////////////////////////////////////////////////////////////
50 public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  PhysxJoint::init_type();
56  register_type(_type_handle, "PhysxDistanceJoint",
57  PhysxJoint::get_class_type());
58  }
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {
63  init_type();
64  return get_class_type();
65  }
66 
67 private:
68  static TypeHandle _type_handle;
69 };
70 
71 #include "physxDistanceJoint.I"
72 
73 #endif // PHYSXDISTANCEJOINT_H
Abstract base class for the different types of joints.
Definition: physxJoint.h:35
A distance joint maintains a certain distance between two points on two actors.
Descriptor class for distance joint.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85