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

panda/src/physics/linearNoiseForce.h

Go to the documentation of this file.
00001 // Filename: linearNoiseForce.h
00002 // Created by:  charles (13Jun00)
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 #ifndef LINEARNOISEFORCE_H
00020 #define LINEARNOISEFORCE_H
00021 
00022 #include "pandabase.h"
00023 #include "linearRandomForce.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : LinearNoiseForce
00027 // Description : Repeating noise force vector.
00028 ////////////////////////////////////////////////////////////////////
00029 class EXPCL_PANDAPHYSICS LinearNoiseForce : public LinearRandomForce {
00030 private:
00031   static unsigned char _prn_table[256];
00032   static LVector3f _gradient_table[256];
00033   static bool _initialized;
00034 
00035   INLINE float cubic_step(const float x) const;
00036   INLINE LVector3f vlerp(const float t, const LVector3f& v0, const LVector3f& v1) const;
00037 
00038   INLINE unsigned char get_prn_entry(const LPoint3f& point) const;
00039   INLINE unsigned char get_prn_entry(const float x, const float y, const float z) const;
00040 
00041   INLINE LVector3f& get_lattice_entry(const LPoint3f& point);
00042   INLINE LVector3f& get_lattice_entry(const float x, const float y, const float z);
00043 
00044   INLINE unsigned char prn_lookup(int index) const;
00045 
00046   virtual LVector3f get_child_vector(const PhysicsObject *po);
00047   virtual LinearForce *make_copy(void);
00048 
00049 public:
00050   static int _random_seed;
00051   static void init_noise_tables(void);
00052 
00053 PUBLISHED:
00054   LinearNoiseForce(float a = 1.0f, bool m = false);
00055   LinearNoiseForce(const LinearNoiseForce &copy);
00056   virtual ~LinearNoiseForce(void);
00057 
00058 public:
00059   static TypeHandle get_class_type(void) {
00060     return _type_handle;
00061   }
00062   static void init_type(void) {
00063     LinearRandomForce::init_type();
00064     register_type(_type_handle, "LinearNoiseForce",
00065                   LinearRandomForce::get_class_type());
00066   }
00067   virtual TypeHandle get_type(void) const {
00068     return get_class_type();
00069   }
00070   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00071 
00072 private:
00073   static TypeHandle _type_handle;
00074 };
00075 
00076 #include "linearNoiseForce.I"
00077 
00078 #endif // LINEARNOISEFORCE_H

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