Panda3D
linearDistanceForce.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file linearDistanceForce.cxx
10  * @author charles
11  * @date 2000-06-21
12  */
13 
14 #include "linearDistanceForce.h"
15 
16 TypeHandle LinearDistanceForce::_type_handle;
17 
18 /**
19  * Simple constructor
20  */
21 LinearDistanceForce::
22 LinearDistanceForce(const LPoint3& p, FalloffType ft, PN_stdfloat r, PN_stdfloat a, bool m) :
23  LinearForce(a, m),
24  _force_center(p), _falloff(ft), _radius(r)
25 {
26 }
27 
28 /**
29  * copy constructor
30  */
31 LinearDistanceForce::
32 LinearDistanceForce(const LinearDistanceForce &copy) :
33  LinearForce(copy) {
34  _falloff = copy._falloff;
35  _radius = copy._radius;
36  _force_center = copy._force_center;
37 }
38 
39 /**
40  * destructor
41  */
42 LinearDistanceForce::
43 ~LinearDistanceForce() {
44 }
45 
46 /**
47  * Write a string representation of this instance to <out>.
48  */
50 output(std::ostream &out) const {
51  #ifndef NDEBUG //[
52  out<<"LinearDistanceForce";
53  #endif //] NDEBUG
54 }
55 
56 /**
57  * Write a string representation of this instance to <out>.
58  */
60 write(std::ostream &out, int indent) const {
61  #ifndef NDEBUG //[
62  out.width(indent); out<<""; out<<"LinearDistanceForce:\n";
63  out.width(indent+2); out<<""; out<<"_force_center "<<_force_center<<"\n";
64  out.width(indent+2); out<<""; out<<"_falloff "<<_falloff<<"\n";
65  out.width(indent+2); out<<""; out<<"_radius "<<_radius<<"\n";
66  LinearForce::write(out, indent+2);
67  #endif //] NDEBUG
68 }
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
Pure virtual class for sinks and sources.
A force that acts on a PhysicsObject by way of an Integrator.
Definition: linearForce.h:23
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Definition: linearForce.cxx:95
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.