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