Panda3D
physxPointInPlaneJoint.h
1 // Filename: physxPointInPlaneJoint.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 PHYSXPOINTINPLANEJOINT_H
16 #define PHYSXPOINTINPLANEJOINT_H
17 
18 #include "pandabase.h"
19 
20 #include "physxJoint.h"
21 #include "physx_includes.h"
22 
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : PhysxPointInPlaneJoint
27 // Description : A point in plane joint constrains a point on one
28 // body to only move inside a plane attached to another
29 // body.
30 // The starting point of the point is defined as the
31 // anchor point. The plane through this point is
32 // specified by its normal which is the joint axis
33 // vector.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_PANDAPHYSX PhysxPointInPlaneJoint : public PhysxJoint {
36 
37 PUBLISHED:
38  INLINE PhysxPointInPlaneJoint();
39  INLINE ~PhysxPointInPlaneJoint();
40 
41  void save_to_desc(PhysxPointInPlaneJointDesc &jointDesc) const;
42  void load_from_desc(const PhysxPointInPlaneJointDesc &jointDesc);
43 
44 ////////////////////////////////////////////////////////////////////
45 public:
46  INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; };
47 
48  void link(NxJoint *jointPtr);
49  void unlink();
50 
51 private:
52  NxPointInPlaneJoint *_ptr;
53 
54 ////////////////////////////////////////////////////////////////////
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  PhysxJoint::init_type();
61  register_type(_type_handle, "PhysxPointInPlaneJoint",
62  PhysxJoint::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {
68  init_type();
69  return get_class_type();
70  }
71 
72 private:
73  static TypeHandle _type_handle;
74 };
75 
76 #include "physxPointInPlaneJoint.I"
77 
78 #endif // PHYSXPOINTINPLANEJOINT_H
Abstract base class for the different types of joints.
Definition: physxJoint.h:35
Descriptor class for point-in-plane joint.
A point in plane joint constrains a point on one body to only move inside a plane attached to another...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85