00001 // Filename: linearRandomForce.cxx 00002 // Created by: charles (19Jun00) 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 "linearRandomForce.h" 00020 00021 TypeHandle LinearRandomForce::_type_handle; 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Function : LinearRandomForce 00025 // Access : Protected 00026 // Description : vector constructor 00027 //////////////////////////////////////////////////////////////////// 00028 LinearRandomForce:: 00029 LinearRandomForce(float a, bool mass) : 00030 LinearForce(a, mass) { 00031 } 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Function : LinearRandomForce 00035 // Access : Protected 00036 // Description : copy constructor 00037 //////////////////////////////////////////////////////////////////// 00038 LinearRandomForce:: 00039 LinearRandomForce(const LinearRandomForce ©) : 00040 LinearForce(copy) { 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function : ~LinearRandomForce 00045 // Access : public 00046 // Description : destructor 00047 //////////////////////////////////////////////////////////////////// 00048 LinearRandomForce:: 00049 ~LinearRandomForce(void) { 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function : bounded_rand 00054 // Access : Protected 00055 // Description : Returns a float in [0, 1] 00056 //////////////////////////////////////////////////////////////////// 00057 float LinearRandomForce:: 00058 bounded_rand(void) { 00059 return ((float)rand() / (float)RAND_MAX); 00060 }