Panda3D
physxSphericalJoint.h
1 // Filename: physxSphericalJoint.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 PHYSXSPHERICALJOINT_H
16 #define PHYSXSPHERICALJOINT_H
17 
18 #include "pandabase.h"
19 
20 #include "physxJoint.h"
21 #include "physx_includes.h"
22 
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : PhysxSphericalJoint
27 // Description : A sphere joint constrains two points on two bodies
28 // to coincide. This point, specified in world space
29 // (this guarantees that the points coincide to start
30 // with) is the only parameter that has to be
31 // specified.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDAPHYSX PhysxSphericalJoint : public PhysxJoint {
34 
35 PUBLISHED:
36  INLINE PhysxSphericalJoint();
37  INLINE ~PhysxSphericalJoint();
38 
39  void save_to_desc(PhysxSphericalJointDesc &jointDesc) const;
40  void load_from_desc(const PhysxSphericalJointDesc &jointDesc);
41 
42  void set_flag(PhysxSphericalJointFlag flag, bool value);
43  void set_projection_mode(PhysxProjectionMode mode);
44 
45  bool get_flag(PhysxSphericalJointFlag flag) const;
46  PhysxProjectionMode get_projection_mode() const;
47 
48 ////////////////////////////////////////////////////////////////////
49 public:
50  INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; };
51 
52  void link(NxJoint *jointPtr);
53  void unlink();
54 
55 private:
56  NxSphericalJoint *_ptr;
57 
58 ////////////////////////////////////////////////////////////////////
59 public:
60  static TypeHandle get_class_type() {
61  return _type_handle;
62  }
63  static void init_type() {
64  PhysxJoint::init_type();
65  register_type(_type_handle, "PhysxSphericalJoint",
66  PhysxJoint::get_class_type());
67  }
68  virtual TypeHandle get_type() const {
69  return get_class_type();
70  }
71  virtual TypeHandle force_init_type() {
72  init_type();
73  return get_class_type();
74  }
75 
76 private:
77  static TypeHandle _type_handle;
78 };
79 
80 #include "physxSphericalJoint.I"
81 
82 #endif // PHYSXSPHERICALJOINT_H
Abstract base class for the different types of joints.
Definition: physxJoint.h:35
Descriptor class for distance joint.
A sphere joint constrains two points on two bodies to coincide.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85