Panda3D

baseForce.cxx

00001 // Filename: baseForce.cxx
00002 // Created by:  charles (08Aug00)
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 #include "baseForce.h"
00016 #include "indent.h"
00017 
00018 TypeHandle BaseForce::_type_handle;
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //    Function : BaseForce
00022 //      Access : protected
00023 // Description : constructor
00024 ////////////////////////////////////////////////////////////////////
00025 BaseForce::
00026 BaseForce(bool active) :
00027   _force_node(NULL), 
00028   _active(active) 
00029 {
00030 }
00031 
00032 ////////////////////////////////////////////////////////////////////
00033 //    Function : BaseForce
00034 //      Access : protected
00035 // Description : copy constructor
00036 ////////////////////////////////////////////////////////////////////
00037 BaseForce::
00038 BaseForce(const BaseForce &copy) :
00039   TypedReferenceCount(copy) 
00040 {
00041   _active = copy._active;
00042   _force_node = (ForceNode *) NULL;
00043 }
00044 
00045 ////////////////////////////////////////////////////////////////////
00046 //    Function : ~BaseForce
00047 //      Access : public, virtual
00048 // Description : destructor
00049 ////////////////////////////////////////////////////////////////////
00050 BaseForce::
00051 ~BaseForce() {
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function : output
00056 //       Access : Public
00057 //  Description : Write a string representation of this instance to
00058 //                <out>.
00059 ////////////////////////////////////////////////////////////////////
00060 void BaseForce::
00061 output(ostream &out) const {
00062   out << "BaseForce (id " << this << ")";
00063 }
00064 
00065 ////////////////////////////////////////////////////////////////////
00066 //     Function : write
00067 //       Access : Public
00068 //  Description : Write a string representation of this instance to
00069 //                <out>.
00070 ////////////////////////////////////////////////////////////////////
00071 void BaseForce::
00072 write(ostream &out, int indent_level) const {
00073   indent(out, indent_level)
00074     << "BaseForce (id " << this << "):\n";
00075   
00076   indent(out, indent_level + 2)
00077     << "_force_node ";
00078   if (_force_node) {
00079     out << _force_node_path << "\n";
00080   } else {
00081     out << "null\n";
00082   }
00083   
00084   indent(out, indent_level + 2)
00085     << "_active " << _active << "\n";
00086 }
 All Classes Functions Variables Enumerations