Panda3D
|
00001 // Filename: physxPulleyJoint.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 PHYSXPULLEYJOINT_H 00016 #define PHYSXPULLEYJOINT_H 00017 00018 #include "pandabase.h" 00019 00020 #include "physxJoint.h" 00021 #include "physx_includes.h" 00022 00023 class PhysxMotorDesc; 00024 class PhysxPulleyJointDesc; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : PhysxPulleyJoint 00028 // Description : A pulley joint simulates a rope between two 00029 // objects passing over two pulleys. 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDAPHYSX PhysxPulleyJoint : public PhysxJoint { 00032 00033 PUBLISHED: 00034 INLINE PhysxPulleyJoint(); 00035 INLINE ~PhysxPulleyJoint(); 00036 00037 void save_to_desc(PhysxPulleyJointDesc &jointDesc) const; 00038 void load_from_desc(const PhysxPulleyJointDesc &jointDesc); 00039 00040 void set_motor(const PhysxMotorDesc &motor); 00041 void set_flag(PhysxPulleyJointFlag flag, bool value); 00042 00043 bool get_flag(PhysxPulleyJointFlag flag) const; 00044 PhysxMotorDesc get_motor() const; 00045 00046 //////////////////////////////////////////////////////////////////// 00047 public: 00048 INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; }; 00049 00050 void link(NxJoint *jointPtr); 00051 void unlink(); 00052 00053 private: 00054 NxPulleyJoint *_ptr; 00055 00056 //////////////////////////////////////////////////////////////////// 00057 public: 00058 static TypeHandle get_class_type() { 00059 return _type_handle; 00060 } 00061 static void init_type() { 00062 PhysxJoint::init_type(); 00063 register_type(_type_handle, "PhysxPulleyJoint", 00064 PhysxJoint::get_class_type()); 00065 } 00066 virtual TypeHandle get_type() const { 00067 return get_class_type(); 00068 } 00069 virtual TypeHandle force_init_type() { 00070 init_type(); 00071 return get_class_type(); 00072 } 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 #include "physxPulleyJoint.I" 00079 00080 #endif // PHYSXPULLEYJOINT_H