Panda3D
|
00001 // Filename: linearIntegrator.h 00002 // Created by: charles (13Jun00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef LINEARINTEGRATOR_H 00016 #define LINEARINTEGRATOR_H 00017 00018 #include "physicsObject.h" 00019 #include "baseIntegrator.h" 00020 #include "linearForce.h" 00021 #include "configVariableDouble.h" 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : LinearIntegrator 00025 // Description : Pure virtual base class for physical modeling. 00026 // Takes physically modelable objects and applies 00027 // forces to them. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_PANDAPHYSICS LinearIntegrator : public BaseIntegrator { 00030 PUBLISHED: 00031 virtual ~LinearIntegrator(); 00032 public: 00033 00034 void integrate(Physical *physical, LinearForceVector &forces, 00035 PN_stdfloat dt); 00036 00037 PUBLISHED: 00038 virtual void output(ostream &out) const; 00039 virtual void write(ostream &out, unsigned int indent=0) const; 00040 00041 protected: 00042 LinearIntegrator(); 00043 00044 private: 00045 static ConfigVariableDouble _max_linear_dt; 00046 00047 // this allows baseLinearIntegrator to censor/modify data that the 00048 // actual integration function receives. 00049 virtual void child_integrate(Physical *physical, 00050 LinearForceVector &forces, 00051 PN_stdfloat dt) = 0; 00052 }; 00053 00054 #endif // LINEARINTEGRATOR_H