Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/physics/linearSourceForce.cxx

Go to the documentation of this file.
00001 // Filename: linearSourceForce.cxx
00002 // Created by:  charles (21Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #include "linearSourceForce.h"
00020 
00021 TypeHandle LinearSourceForce::_type_handle;
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //    Function : LinearSourceForce
00025 //      Access : Public
00026 // Description : Simple constructor
00027 ////////////////////////////////////////////////////////////////////
00028 LinearSourceForce::
00029 LinearSourceForce(const LPoint3f& p, FalloffType f, float r, float a,
00030           bool mass) :
00031   LinearDistanceForce(p, f, r, a, mass) {
00032 }
00033 
00034 ////////////////////////////////////////////////////////////////////
00035 //    Function : LinearSourceForce
00036 //      Access : Public
00037 // Description : Simple constructor
00038 ////////////////////////////////////////////////////////////////////
00039 LinearSourceForce::
00040 LinearSourceForce(void) :
00041   LinearDistanceForce(LPoint3f(0.0f, 0.0f, 0.0f), FT_ONE_OVER_R_SQUARED,
00042                       1.0f, 1.0f, true) {
00043 }
00044 
00045 ////////////////////////////////////////////////////////////////////
00046 //    Function : LinearSourceForce
00047 //      Access : Public
00048 // Description : copy constructor
00049 ////////////////////////////////////////////////////////////////////
00050 LinearSourceForce::
00051 LinearSourceForce(const LinearSourceForce &copy) :
00052   LinearDistanceForce(copy) {
00053 }
00054 
00055 ////////////////////////////////////////////////////////////////////
00056 //    Function : ~LinearSourceForce
00057 //      Access : Public
00058 // Description : Simple destructor
00059 ////////////////////////////////////////////////////////////////////
00060 LinearSourceForce::
00061 ~LinearSourceForce(void) {
00062 }
00063 
00064 ////////////////////////////////////////////////////////////////////
00065 //    Function : make_copy
00066 //      Access : Public
00067 // Description : copier
00068 ////////////////////////////////////////////////////////////////////
00069 LinearForce *LinearSourceForce::
00070 make_copy(void) {
00071   return new LinearSourceForce(*this);
00072 }
00073 
00074 ////////////////////////////////////////////////////////////////////
00075 //    Function : get_child_vector
00076 //      Access : Public
00077 // Description : virtual force query
00078 ////////////////////////////////////////////////////////////////////
00079 LVector3f LinearSourceForce::
00080 get_child_vector(const PhysicsObject *po) {
00081   return (po->get_position() - get_force_center()) * get_scalar_term();
00082 }

Generated on Fri May 2 00:42:59 2003 for Panda by doxygen1.3