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,
00036 const GB_AttributeRef &tensionoffset,
00037 const GB_AttributeRef &veloffset,
00038 float timeinc);
00039 void getForce (UT_Vector3& force, const GEO_Point *ppt,
00040 float springk,
00041 const GB_AttributeRef &springkoffset);
00042
00043 private:
00044
00045 UT_PtrArray<GU_SpringEdge*> edges;
00046 GU_Topology topology;
00047
00048 void cleanEdges (void);
00049 void buildEdges (GEO_Primitive *prim);
00050
00051 };
00052
00053 #endif