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

panda/src/physics/linearVectorForce.h

Go to the documentation of this file.
00001 // Filename: linearVectorForce.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 LINEARVECTORFORCE_H
00020 #define LINEARVECTORFORCE_H
00021 
00022 #include "linearForce.h"
00023 
00024 ////////////////////////////////////////////////////////////////
00025 //       Class : LinearVectorForce
00026 // Description : Simple directed vector force.  Suitable for
00027 //               gravity, non-turbulent wind, etc...
00028 ////////////////////////////////////////////////////////////////
00029 class EXPCL_PANDAPHYSICS LinearVectorForce : public LinearForce {
00030 private:
00031   LVector3f _fvec;
00032 
00033   virtual LinearForce *make_copy(void);
00034   virtual LVector3f get_child_vector(const PhysicsObject *po);
00035 
00036 PUBLISHED:
00037   LinearVectorForce(const LVector3f& vec, float a = 1.0f, bool mass = false);
00038   LinearVectorForce(const LinearVectorForce &copy);
00039   LinearVectorForce(float x = 0.0f, float y = 0.0f, float z = 0.0f,
00040               float a = 1.0f, bool mass = false);
00041   virtual ~LinearVectorForce(void);
00042 
00043   INLINE void set_vector(const LVector3f& v);
00044   INLINE void set_vector(float x, float y, float z);
00045 
00046   INLINE LVector3f get_local_vector(void) const;
00047 
00048 public:
00049   static TypeHandle get_class_type(void) {
00050     return _type_handle;
00051   }
00052   static void init_type(void) {
00053     LinearForce::init_type();
00054     register_type(_type_handle, "LinearVectorForce",
00055                   LinearForce::get_class_type());
00056   }
00057   virtual TypeHandle get_type(void) const {
00058     return get_class_type();
00059   }
00060   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00061 
00062 private:
00063   static TypeHandle _type_handle;
00064 };
00065 
00066 #include "linearVectorForce.I"
00067 
00068 #endif // LINEARVECTORFORCE_H

Generated on Fri May 2 00:43:01 2003 for Panda by doxygen1.3