00001 // Filename: linearVectorForce.cxx 00002 // Created by: charles (14Jun00) 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 <datagram.h> 00020 #include <datagramIterator.h> 00021 #include <bamReader.h> 00022 #include <bamWriter.h> 00023 00024 #include "linearVectorForce.h" 00025 00026 TypeHandle LinearVectorForce::_type_handle; 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function : LinearVectorForce 00030 // Access : Public 00031 // Description : Vector Constructor 00032 //////////////////////////////////////////////////////////////////// 00033 LinearVectorForce:: 00034 LinearVectorForce(const LVector3f& vec, float a, bool mass) : 00035 LinearForce(a, mass), 00036 _fvec(vec) 00037 { 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function : LinearVectorForce 00042 // Access : Public 00043 // Description : Default/Piecewise constructor 00044 //////////////////////////////////////////////////////////////////// 00045 LinearVectorForce:: 00046 LinearVectorForce(float x, float y, float z, float a, bool mass) : 00047 LinearForce(a, mass) { 00048 _fvec.set(x, y, z); 00049 } 00050 00051 //////////////////////////////////////////////////////////////////// 00052 // Function : LinearVectorForce 00053 // Access : Public 00054 // Description : Copy Constructor 00055 //////////////////////////////////////////////////////////////////// 00056 LinearVectorForce:: 00057 LinearVectorForce(const LinearVectorForce ©) : 00058 LinearForce(copy) { 00059 _fvec = copy._fvec; 00060 } 00061 00062 //////////////////////////////////////////////////////////////////// 00063 // Function : LinearVectorForce 00064 // Access : Public 00065 // Description : Destructor 00066 //////////////////////////////////////////////////////////////////// 00067 LinearVectorForce:: 00068 ~LinearVectorForce(void) { 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function : make_copy 00073 // Access : Public, virtual 00074 // Description : copier 00075 //////////////////////////////////////////////////////////////////// 00076 LinearForce *LinearVectorForce:: 00077 make_copy(void) { 00078 return new LinearVectorForce(*this); 00079 } 00080 00081 //////////////////////////////////////////////////////////////////// 00082 // Function : get_child_vector 00083 // Access : Public 00084 // Description : vector access 00085 //////////////////////////////////////////////////////////////////// 00086 LVector3f LinearVectorForce:: 00087 get_child_vector(const PhysicsObject *) { 00088 return _fvec; 00089 } 00090