00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __GU_Spring_h__
00016 #define __GU_Spring_h__
00017
00018 #include "GU_API.h"
00019 #include <UT/UT_PtrArray.h>
00020 #include <GEO/GEO_Detail.h>
00021 #include "GU_Topology.h"
00022
00023 class GU_SpringEdge;
00024
00025 class GU_API GU_Spring
00026 {
00027 public:
00028
00029 GU_Spring (void);
00030 virtual ~GU_Spring (void);
00031
00032 void setupEdges (GU_Detail *gdp, GB_PrimitiveGroup *group = 0,
00033 int force = 0);
00034 void computeEdges (GU_Detail *gdp, int behavior,
00035 float tension = 1.0f, int tensionoffset = -1,
00036 int veloffset = -1, float timeinc = 0);
00037 void getForce (UT_Vector3& force, const GEO_Point *ppt,
00038 float springk = 1.0f, int springkoffset = -1);
00039
00040 private:
00041
00042 UT_PtrArray<GU_SpringEdge*> edges;
00043 GU_Topology topology;
00044
00045 void cleanEdges (void);
00046 void buildEdges (GEO_Primitive *prim);
00047
00048 };
00049
00050 #endif