Panda3D
 All Classes Functions Variables Enumerations
linearCylinderVortexForce.h
1 // Filename: linearCylinderVortexForce.h
2 // Created by: charles (24Jul00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef LINEARCYLINDERVORTEXFORCE_H
16 #define LINEARCYLINDERVORTEXFORCE_H
17 
18 #include "linearForce.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : LinearCylinderVortexForce
22 // Description : Defines a cylinder inside of which all forces are
23 // tangential to the theta of the particle wrt the
24 // z-axis in local coord. space. This happens by
25 // assigning the force a node by which the cylinder is
26 // transformed. Be warned- this will suck anything
27 // that it can reach directly into orbit and will NOT
28 // let go.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAPHYSICS LinearCylinderVortexForce : public LinearForce {
31 PUBLISHED:
32  LinearCylinderVortexForce(PN_stdfloat radius = 1.0f,
33  PN_stdfloat length = 0.0f,
34  PN_stdfloat coef = 1.0f,
35  PN_stdfloat a = 1.0f,
36  bool md = false);
38  virtual ~LinearCylinderVortexForce();
39 
40  INLINE void set_coef(PN_stdfloat coef);
41  INLINE PN_stdfloat get_coef() const;
42 
43  INLINE void set_radius(PN_stdfloat radius);
44  INLINE PN_stdfloat get_radius() const;
45 
46  INLINE void set_length(PN_stdfloat length);
47  INLINE PN_stdfloat get_length() const;
48 
49  virtual void output(ostream &out) const;
50  virtual void write(ostream &out, unsigned int indent=0) const;
51 
52 private:
53  PN_stdfloat _radius;
54  PN_stdfloat _length;
55  PN_stdfloat _coef;
56 
57  virtual LinearForce *make_copy();
58  virtual LVector3 get_child_vector(const PhysicsObject *po);
59 
60 public:
61  static TypeHandle get_class_type() {
62  return _type_handle;
63  }
64  static void init_type() {
65  LinearForce::init_type();
66  register_type(_type_handle, "LinearCylinderVortexForce",
67  LinearForce::get_class_type());
68  }
69  virtual TypeHandle get_type() const {
70  return get_class_type();
71  }
72  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
73 
74 private:
75  static TypeHandle _type_handle;
76 };
77 
78 #include "linearCylinderVortexForce.I"
79 
80 #endif // LINEARCYLINDERVORTEXFORCE_H
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
A body on which physics will be applied.
Definition: physicsObject.h:29
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
A force that acts on a PhysicsObject by way of an Integrator.
Definition: linearForce.h:25
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
Definition: linearForce.cxx:97
Defines a cylinder inside of which all forces are tangential to the theta of the particle wrt the z-a...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85