Panda3D
|
00001 // Filename: linearCylinderVortexForce.h 00002 // Created by: charles (24Jul00) 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 LINEARCYLINDERVORTEXFORCE_H 00016 #define LINEARCYLINDERVORTEXFORCE_H 00017 00018 #include "linearForce.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Class : LinearCylinderVortexForce 00022 // Description : Defines a cylinder inside of which all forces are 00023 // tangential to the theta of the particle wrt the 00024 // z-axis in local coord. space. This happens by 00025 // assigning the force a node by which the cylinder is 00026 // transformed. Be warned- this will suck anything 00027 // that it can reach directly into orbit and will NOT 00028 // let go. 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_PANDAPHYSICS LinearCylinderVortexForce : public LinearForce { 00031 PUBLISHED: 00032 LinearCylinderVortexForce(PN_stdfloat radius = 1.0f, 00033 PN_stdfloat length = 0.0f, 00034 PN_stdfloat coef = 1.0f, 00035 PN_stdfloat a = 1.0f, 00036 bool md = false); 00037 LinearCylinderVortexForce(const LinearCylinderVortexForce ©); 00038 virtual ~LinearCylinderVortexForce(); 00039 00040 INLINE void set_coef(PN_stdfloat coef); 00041 INLINE PN_stdfloat get_coef() const; 00042 00043 INLINE void set_radius(PN_stdfloat radius); 00044 INLINE PN_stdfloat get_radius() const; 00045 00046 INLINE void set_length(PN_stdfloat length); 00047 INLINE PN_stdfloat get_length() const; 00048 00049 virtual void output(ostream &out) const; 00050 virtual void write(ostream &out, unsigned int indent=0) const; 00051 00052 private: 00053 PN_stdfloat _radius; 00054 PN_stdfloat _length; 00055 PN_stdfloat _coef; 00056 00057 virtual LinearForce *make_copy(); 00058 virtual LVector3 get_child_vector(const PhysicsObject *po); 00059 00060 public: 00061 static TypeHandle get_class_type() { 00062 return _type_handle; 00063 } 00064 static void init_type() { 00065 LinearForce::init_type(); 00066 register_type(_type_handle, "LinearCylinderVortexForce", 00067 LinearForce::get_class_type()); 00068 } 00069 virtual TypeHandle get_type() const { 00070 return get_class_type(); 00071 } 00072 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 #include "linearCylinderVortexForce.I" 00079 00080 #endif // LINEARCYLINDERVORTEXFORCE_H