Panda3D

bulletGenericConstraint.h

00001 // Filename: bulletGenericConstraint.h
00002 // Created by:  enn0x (02Mar10)
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 __BULLET_GENERIC_CONSTRAINT_H__
00016 #define __BULLET_GENERIC_CONSTRAINT_H__
00017 
00018 #include "pandabase.h"
00019 
00020 #include "bullet_includes.h"
00021 #include "bullet_utils.h"
00022 #include "bulletConstraint.h"
00023 
00024 #include "transformState.h"
00025 #include "luse.h"
00026 
00027 class BulletRigidBodyNode;
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //       Class : BulletGenericConstraint
00031 // Description : 
00032 ////////////////////////////////////////////////////////////////////
00033 class EXPCL_PANDABULLET BulletGenericConstraint : public BulletConstraint {
00034 
00035 PUBLISHED:
00036   BulletGenericConstraint(const BulletRigidBodyNode *node_a, 
00037                           CPT(TransformState) frame_a,
00038                           bool use_frame_a);
00039   BulletGenericConstraint(const BulletRigidBodyNode *node_a,
00040                           const BulletRigidBodyNode *node_b,
00041                           CPT(TransformState) frame_a,
00042                           CPT(TransformState) frame_b,
00043                           bool use_frame_a);
00044   INLINE ~BulletGenericConstraint();
00045 
00046   void set_linear_limit(int axis, PN_stdfloat low, PN_stdfloat high);
00047   void set_angular_limit(int axis, PN_stdfloat low, PN_stdfloat high);
00048 
00049   LVector3 get_axis(int axis) const;
00050   PN_stdfloat get_pivot(int axis) const;
00051   PN_stdfloat get_angle(int axis) const;
00052 
00053 public:
00054   virtual btTypedConstraint *ptr() const;
00055 
00056 private:
00057   btGeneric6DofConstraint *_constraint;
00058 
00059 ////////////////////////////////////////////////////////////////////
00060 public:
00061   static TypeHandle get_class_type() {
00062     return _type_handle;
00063   }
00064   static void init_type() {
00065     BulletConstraint::init_type();
00066     register_type(_type_handle, "BulletGenericConstraint", 
00067                   BulletConstraint::get_class_type());
00068   }
00069   virtual TypeHandle get_type() const {
00070     return get_class_type();
00071   }
00072   virtual TypeHandle force_init_type() {
00073     init_type();
00074     return get_class_type();
00075   }
00076 
00077 private:
00078   static TypeHandle _type_handle;
00079 };
00080 
00081 #include "bulletGenericConstraint.I"
00082 
00083 #endif // __BULLET_GENERIC_CONSTRAINT_H__
 All Classes Functions Variables Enumerations