Panda3D
 All Classes Functions Variables Enumerations
linearFrictionForce.h
1 // Filename: linearFrictionForce.h
2 // Created by: charles (23Jun00)
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 LINEARFRICTIONFORCE_H
16 #define LINEARFRICTIONFORCE_H
17 
18 #include "linearForce.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : LinearFrictionForce
22 // Description : Friction-based drag force
23 ////////////////////////////////////////////////////////////////////
24 class EXPCL_PANDAPHYSICS LinearFrictionForce : public LinearForce {
25 PUBLISHED:
26  LinearFrictionForce(PN_stdfloat coef = 1.0f, PN_stdfloat a = 1.0f, bool m = false);
28  virtual ~LinearFrictionForce();
29 
30  INLINE void set_coef(PN_stdfloat coef);
31  INLINE PN_stdfloat get_coef() const;
32 
33  virtual void output(ostream &out) const;
34  virtual void write(ostream &out, unsigned int indent=0) const;
35 
36 private:
37  PN_stdfloat _coef;
38 
39  virtual LinearForce *make_copy();
40  virtual LVector3 get_child_vector(const PhysicsObject *);
41 
42 public:
43  static TypeHandle get_class_type() {
44  return _type_handle;
45  }
46  static void init_type() {
47  LinearForce::init_type();
48  register_type(_type_handle, "LinearFrictionForce",
49  LinearForce::get_class_type());
50  }
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
60 #include "linearFrictionForce.I"
61 
62 #endif // LINEARFRICTIONFORCE_H
Friction-based drag force.
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
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85