Panda3D
physxD6Joint.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxD6Joint.h
10  * @author enn0x
11  * @date 2009-10-02
12  */
13 
14 #ifndef PHYSXD6JOINT_H
15 #define PHYSXD6JOINT_H
16 
17 #include "pandabase.h"
18 
19 #include "physxJoint.h"
20 #include "physx_includes.h"
21 
22 class PhysxD6JointDesc;
23 
24 /**
25  * A D6 joint is a general constraint between two actors. It allows the user
26  * to individually define the linear and rotational degrees of freedom. It
27  * also allows the user to configure the joint with limits and driven degrees
28  * of freedom as they wish.
29  */
30 class EXPCL_PANDAPHYSX PhysxD6Joint : public PhysxJoint {
31 
32 PUBLISHED:
33  INLINE PhysxD6Joint();
34  INLINE ~PhysxD6Joint();
35 
36  void save_to_desc(PhysxD6JointDesc &jointDesc) const;
37  void load_from_desc(const PhysxD6JointDesc &jointDesc);
38 
39  void set_drive_angular_velocity(const LVector3f &v);
40  void set_drive_linear_velocity(const LVector3f &v);
41  void set_drive_orientation(const LQuaternionf &quat);
42  void set_drive_position(const LPoint3f &pos);
43 
44 public:
45  INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; };
46 
47  void link(NxJoint *jointPtr);
48  void unlink();
49 
50 private:
51  NxD6Joint *_ptr;
52 
53 public:
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  PhysxJoint::init_type();
59  register_type(_type_handle, "PhysxD6Joint",
60  PhysxJoint::get_class_type());
61  }
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {
66  init_type();
67  return get_class_type();
68  }
69 
70 private:
71  static TypeHandle _type_handle;
72 };
73 
74 #include "physxD6Joint.I"
75 
76 #endif // PHYSXD6JOINT_H
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
Abstract base class for the different types of joints.
Definition: physxJoint.h:32
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A D6 joint is a general constraint between two actors.
Definition: physxD6Joint.h:30
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81