Panda3D

linearDistanceForce.cxx

00001 // Filename: linearDistanceForce.cxx
00002 // Created by:  charles (21Jun00)
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 "linearDistanceForce.h"
00016 
00017 TypeHandle LinearDistanceForce::_type_handle;
00018 
00019 ////////////////////////////////////////////////////////////////////
00020 //    Function : LinearDistanceForce
00021 //      Access : Protected
00022 // Description : Simple constructor
00023 ////////////////////////////////////////////////////////////////////
00024 LinearDistanceForce::
00025 LinearDistanceForce(const LPoint3& p, FalloffType ft, PN_stdfloat r, PN_stdfloat a, bool m) :
00026   LinearForce(a, m),
00027   _force_center(p), _falloff(ft), _radius(r)
00028 {
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //    Function : LinearDistanceForce
00033 //      Access : Protected
00034 // Description : copy constructor
00035 ////////////////////////////////////////////////////////////////////
00036 LinearDistanceForce::
00037 LinearDistanceForce(const LinearDistanceForce &copy) :
00038   LinearForce(copy) {
00039   _falloff = copy._falloff;
00040   _radius = copy._radius;
00041   _force_center = copy._force_center;
00042 }
00043 
00044 ////////////////////////////////////////////////////////////////////
00045 //    Function : ~LinearDistanceForce
00046 //      Access : Protected
00047 // Description : destructor
00048 ////////////////////////////////////////////////////////////////////
00049 LinearDistanceForce::
00050 ~LinearDistanceForce() {
00051 }
00052 
00053 ////////////////////////////////////////////////////////////////////
00054 //     Function : output
00055 //       Access : Public
00056 //  Description : Write a string representation of this instance to
00057 //                <out>.
00058 ////////////////////////////////////////////////////////////////////
00059 void LinearDistanceForce::
00060 output(ostream &out) const {
00061   #ifndef NDEBUG //[
00062   out<<"LinearDistanceForce";
00063   #endif //] NDEBUG
00064 }
00065 
00066 ////////////////////////////////////////////////////////////////////
00067 //     Function : write
00068 //       Access : Public
00069 //  Description : Write a string representation of this instance to
00070 //                <out>.
00071 ////////////////////////////////////////////////////////////////////
00072 void LinearDistanceForce::
00073 write(ostream &out, unsigned int indent) const {
00074   #ifndef NDEBUG //[
00075   out.width(indent); out<<""; out<<"LinearDistanceForce:\n";
00076   out.width(indent+2); out<<""; out<<"_force_center "<<_force_center<<"\n";
00077   out.width(indent+2); out<<""; out<<"_falloff "<<_falloff<<"\n";
00078   out.width(indent+2); out<<""; out<<"_radius "<<_radius<<"\n";
00079   LinearForce::write(out, indent+2);
00080   #endif //] NDEBUG
00081 }
 All Classes Functions Variables Enumerations