#ifndef PLANTSH #define PLANTSH #include #include "collDetect.h" typedef enum {Vine} PlantType; typedef struct pn { /* generic plant node */ PlantType type; void *pl; /* pointer to actual plant */ Boolean stopped; struct pn *next; } PlantNode; typedef struct vs { ObjNode *obj; /* vine seg's object */ Real scale, scFacStart, scFacEnd; /* control scaling */ Real t[3][6]; /* base matrix upon which */ /* transforms are built */ Tupple p1, p2, n; /* points and normal */ Boolean end; /* dead ? */ Boolean branch /* have 2 children ? */ Boolean initial; /* initial (meaning seed) ? */ struct vs *next; } VineSeg; typedef struct ls { ObjNode *obj; /* leaf's object */ Real scFacStart, scFacEnd; /* control scaling */ Tupple orig; /* point to hang off */ VineSeg *vs; /* vine seg hanging off */ Transform *tinfo; /* build up transform from struct ls *next; /* this */ } LeafNode; typedef struct ss { /* store info for a possible new leaf */ int count; /* have to wait "delay" before can try */ VineSeg *vs; struct ss *next; } MaybeLeafNode; typedef struct { VineSeg *gsegs; /* growing segs */ VineSeg *ssegs; /* stopped segs */ LeafNode *gleaves; /* growing leaves */ LeafNode *sleaves; /* stopped leaves */ MaybeLeafNode *potHead; /* head of potential leaf list */ MaybeLeafNode *potTail; /* tail of potential leaf list */ Real growthInc; /* how much to grow at each step */ } VinePlant; void growPlants(ObjDB *, PlantNode *); void createCanonicalVineSeg(int, Real); void createCanonicalLeaf(Real, Real, Real); void showPolyOutputPlants(ObjNode *, PlantNode *); void waveFrontOutputPlants(ObjNode *, PlantNode *); #endif