Panda3D
 All Classes Functions Variables Enumerations
baseForce.cxx
1 // Filename: baseForce.cxx
2 // Created by: charles (08Aug00)
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 #include "baseForce.h"
16 #include "indent.h"
17 
18 TypeHandle BaseForce::_type_handle;
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function : BaseForce
22 // Access : protected
23 // Description : constructor
24 ////////////////////////////////////////////////////////////////////
25 BaseForce::
26 BaseForce(bool active) :
27  _force_node(NULL),
28  _active(active)
29 {
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function : BaseForce
34 // Access : protected
35 // Description : copy constructor
36 ////////////////////////////////////////////////////////////////////
37 BaseForce::
38 BaseForce(const BaseForce &copy) :
39  TypedReferenceCount(copy)
40 {
41  _active = copy._active;
42  _force_node = (ForceNode *) NULL;
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function : ~BaseForce
47 // Access : public, virtual
48 // Description : destructor
49 ////////////////////////////////////////////////////////////////////
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function : output
56 // Access : Public
57 // Description : Write a string representation of this instance to
58 // <out>.
59 ////////////////////////////////////////////////////////////////////
60 void BaseForce::
61 output(ostream &out) const {
62  out << "BaseForce (id " << this << ")";
63 }
64 
65 ////////////////////////////////////////////////////////////////////
66 // Function : write
67 // Access : Public
68 // Description : Write a string representation of this instance to
69 // <out>.
70 ////////////////////////////////////////////////////////////////////
71 void BaseForce::
72 write(ostream &out, int indent_level) const {
73  indent(out, indent_level)
74  << "BaseForce (id " << this << "):\n";
75 
76  indent(out, indent_level + 2)
77  << "_force_node ";
78  if (_force_node) {
79  out << _force_node_path << "\n";
80  } else {
81  out << "null\n";
82  }
83 
84  indent(out, indent_level + 2)
85  << "_active " << _active << "\n";
86 }
A force that lives in the scene graph and is therefore subject to local coordinate systems...
Definition: forceNode.h:30
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
virtual ~BaseForce()
destructor
Definition: baseForce.cxx:51
pure virtual base class for all forces that could POSSIBLY exist.
Definition: baseForce.h:32
virtual void write(ostream &out, int indent_level=0) const
Write a string representation of this instance to &lt;out&gt;.
Definition: baseForce.cxx:72
virtual void output(ostream &out) const
Write a string representation of this instance to &lt;out&gt;.
Definition: baseForce.cxx:61
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85