Panda3D
|
00001 // Filename: physxPointOnLineJoint.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 PHYSXPOINTONLINEJOINT_H 00016 #define PHYSXPOINTONLINEJOINT_H 00017 00018 #include "pandabase.h" 00019 00020 #include "physxJoint.h" 00021 #include "physx_includes.h" 00022 00023 class PhysxPointOnLineJointDesc; 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : PhysxPointOnLineJoint 00027 // Description : A point on line joint constrains a point on one 00028 // body to only move along a line attached to another 00029 // body. 00030 // The starting point of the joint is defined as the 00031 // anchor point. The line through this point is 00032 // specified by its direction (axis) vector. 00033 //////////////////////////////////////////////////////////////////// 00034 class EXPCL_PANDAPHYSX PhysxPointOnLineJoint : public PhysxJoint { 00035 00036 PUBLISHED: 00037 INLINE PhysxPointOnLineJoint(); 00038 INLINE ~PhysxPointOnLineJoint(); 00039 00040 void save_to_desc(PhysxPointOnLineJointDesc &jointDesc) const; 00041 void load_from_desc(const PhysxPointOnLineJointDesc &jointDesc); 00042 00043 //////////////////////////////////////////////////////////////////// 00044 public: 00045 INLINE NxJoint *ptr() const { return (NxJoint *)_ptr; }; 00046 00047 void link(NxJoint *jointPtr); 00048 void unlink(); 00049 00050 private: 00051 NxPointOnLineJoint *_ptr; 00052 00053 //////////////////////////////////////////////////////////////////// 00054 public: 00055 static TypeHandle get_class_type() { 00056 return _type_handle; 00057 } 00058 static void init_type() { 00059 PhysxJoint::init_type(); 00060 register_type(_type_handle, "PhysxPointOnLineJoint", 00061 PhysxJoint::get_class_type()); 00062 } 00063 virtual TypeHandle get_type() const { 00064 return get_class_type(); 00065 } 00066 virtual TypeHandle force_init_type() { 00067 init_type(); 00068 return get_class_type(); 00069 } 00070 00071 private: 00072 static TypeHandle _type_handle; 00073 }; 00074 00075 #include "physxPointOnLineJoint.I" 00076 00077 #endif // PHYSXPOINTONLINEJOINT_H