00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GAS_EnforceBoundary__
00020 #define __GAS_EnforceBoundary__
00021
00022 #include "GAS_API.h"
00023
00024 #include <UT/UT_ThreadedAlgorithm.h>
00025 #include <GU/GU_Detail.h>
00026
00027 #include "GAS_SubSolver.h"
00028 #include "GAS_Utils.h"
00029
00030 class GU_Detail;
00031 class SIM_VectorField;
00032 class SIM_IndexField;
00033
00034 class GAS_API GAS_EnforceBoundary : public GAS_SubSolver
00035 {
00036 public:
00037 GET_DATA_FUNC_S(GAS_NAME_FIELD, FieldName);
00038 GET_DATA_FUNC_S(GAS_NAME_COLLISION, CollisionName);
00039 GET_DATA_FUNC_S(GAS_NAME_COLLISIONVALUE, CollisionValueName);
00040 GET_DATA_FUNC_B("velocityenforce", VelocityEnforce);
00041 GET_DATA_FUNC_I("veltype", VelocityType);
00042 GET_DATA_FUNC_B("usephysparms", UsePhysParms);
00043 GET_DATA_FUNC_B("forbidinterference", ForbidInterference);
00044
00045
00046 void calculatePhysParms(const UT_Vector3 &pos,
00047 fpreal &bounce,
00048 fpreal &friction, fpreal &dynfriction);
00049
00050
00051
00052 UT_Vector3 calculateVelocity(const UT_Vector3 &pos);
00053
00054 protected:
00055 explicit GAS_EnforceBoundary(const SIM_DataFactory *factory);
00056 virtual ~GAS_EnforceBoundary();
00057
00058
00059
00060 virtual bool solveGasSubclass(SIM_Engine &engine,
00061 SIM_Object *obj,
00062 SIM_Time time,
00063 SIM_Time timestep);
00064
00065 void enforceVelBoundary(SIM_Engine &engine,
00066 SIM_Object *obj,
00067 SIM_VectorField *vectorfield,
00068 SIM_ScalarField *collision,
00069 SIM_IndexField *colindexfield);
00070
00071 private:
00072 static const SIM_DopDescription *getDopDescription();
00073
00074 bool myUsePhysParms;
00075 SIM_Object *myObject;
00076 SIM_Engine *myEngine;
00077 SIM_IndexField *myCollisionIndex;
00078 bool myVelUseSDF, myVelUsePoint;
00079
00080 DECLARE_STANDARD_GETCASTTOTYPE();
00081 DECLARE_DATAFACTORY(GAS_EnforceBoundary,
00082 GAS_SubSolver,
00083 "Gas Enforce Boundary",
00084 getDopDescription());
00085 };
00086
00087 #endif