Panda3D
 All Classes Functions Variables Enumerations
physxD6Joint.h
00001 // Filename: physxD6Joint.h
00002 // Created by:  enn0x (02Oct09)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PHYSXD6JOINT_H
00016 #define PHYSXD6JOINT_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "physxJoint.h"
00021 #include "physx_includes.h"
00022 
00023 class PhysxD6JointDesc;
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : PhysxD6Joint
00027 // Description : A D6 joint is a general constraint between two
00028 //               actors.  It allows the user to individually define
00029 //               the linear and rotational degrees of freedom.  It
00030 //               also allows the user to configure the joint with
00031 //               limits and driven degrees of freedom as they wish.
00032 ////////////////////////////////////////////////////////////////////
00033 class EXPCL_PANDAPHYSX PhysxD6Joint : public PhysxJoint {
00034 
00035 PUBLISHED:
00036   INLINE PhysxD6Joint();
00037   INLINE ~PhysxD6Joint();
00038 
00039   void save_to_desc(PhysxD6JointDesc &jointDesc) const;
00040   void load_from_desc(const PhysxD6JointDesc &jointDesc);
00041 
00042   void set_drive_angular_velocity(const LVector3f &v);
00043   void set_drive_linear_velocity(const LVector3f &v);
00044   void set_drive_orientation(const LQuaternionf &quat);
00045   void set_drive_position(const LPoint3f &pos);
00046 
00047 ////////////////////////////////////////////////////////////////////
00048 public:
00049   INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; };
00050 
00051   void link(NxJoint *jointPtr);
00052   void unlink();
00053 
00054 private:
00055   NxD6Joint *_ptr;
00056 
00057 ////////////////////////////////////////////////////////////////////
00058 public:
00059   static TypeHandle get_class_type() {
00060     return _type_handle;
00061   }
00062   static void init_type() {
00063     PhysxJoint::init_type();
00064     register_type(_type_handle, "PhysxD6Joint", 
00065                   PhysxJoint::get_class_type());
00066   }
00067   virtual TypeHandle get_type() const {
00068     return get_class_type();
00069   }
00070   virtual TypeHandle force_init_type() {
00071     init_type();
00072     return get_class_type();
00073   }
00074 
00075 private:
00076   static TypeHandle _type_handle;
00077 };
00078 
00079 #include "physxD6Joint.I"
00080 
00081 #endif // PHYSXD6JOINT_H
 All Classes Functions Variables Enumerations