Panda3D
|
00001 // Filename: physxSphericalJoint.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 PHYSXSPHERICALJOINT_H 00016 #define PHYSXSPHERICALJOINT_H 00017 00018 #include "pandabase.h" 00019 00020 #include "physxJoint.h" 00021 #include "physx_includes.h" 00022 00023 class PhysxSphericalJointDesc; 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : PhysxSphericalJoint 00027 // Description : A sphere joint constrains two points on two bodies 00028 // to coincide. This point, specified in world space 00029 // (this guarantees that the points coincide to start 00030 // with) is the only parameter that has to be 00031 // specified. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_PANDAPHYSX PhysxSphericalJoint : public PhysxJoint { 00034 00035 PUBLISHED: 00036 INLINE PhysxSphericalJoint(); 00037 INLINE ~PhysxSphericalJoint(); 00038 00039 void save_to_desc(PhysxSphericalJointDesc &jointDesc) const; 00040 void load_from_desc(const PhysxSphericalJointDesc &jointDesc); 00041 00042 void set_flag(PhysxSphericalJointFlag flag, bool value); 00043 void set_projection_mode(PhysxProjectionMode mode); 00044 00045 bool get_flag(PhysxSphericalJointFlag flag) const; 00046 PhysxProjectionMode get_projection_mode() const; 00047 00048 //////////////////////////////////////////////////////////////////// 00049 public: 00050 INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; }; 00051 00052 void link(NxJoint *jointPtr); 00053 void unlink(); 00054 00055 private: 00056 NxSphericalJoint *_ptr; 00057 00058 //////////////////////////////////////////////////////////////////// 00059 public: 00060 static TypeHandle get_class_type() { 00061 return _type_handle; 00062 } 00063 static void init_type() { 00064 PhysxJoint::init_type(); 00065 register_type(_type_handle, "PhysxSphericalJoint", 00066 PhysxJoint::get_class_type()); 00067 } 00068 virtual TypeHandle get_type() const { 00069 return get_class_type(); 00070 } 00071 virtual TypeHandle force_init_type() { 00072 init_type(); 00073 return get_class_type(); 00074 } 00075 00076 private: 00077 static TypeHandle _type_handle; 00078 }; 00079 00080 #include "physxSphericalJoint.I" 00081 00082 #endif // PHYSXSPHERICALJOINT_H