1 #ifndef _SSG_ENTITY_ARRAY_HXX
2 #define _SSG_ENTITY_ARRAY_HXX
11 class ssgEntityArray : public ssgEntity
13 // The replicated child
16 // The one transformation node
19 // The list of locations and orientations
20 ssgVertexArray *locations;
21 ssgVertexArray *orientations;
25 virtual void copy_from ( ssgEntityArray *src, int clone_flags ) ;
29 virtual void zeroSpareRecursive ();
31 virtual ssgBase *clone ( int clone_flags = 0 ) ;
32 ssgEntityArray (void) ;
33 virtual ~ssgEntityArray (void) ;
35 ssgEntity *getModel () { return model ; }
36 void setModel ( ssgEntity *entity ) { model = entity; }
38 void replaceModel ( ssgEntity *new_entity ) ;
40 ssgVertexArray *getLocations () { return locations; }
41 ssgVertexArray *getOrientations () { return orientations; }
43 float *getLocation ( int i ) { return locations->get( i ); }
44 float *getOrientation ( int i ) { return orientations->get( i ); }
45 void addPlacement ( sgVec3 loc, sgVec3 orient );
46 virtual int getNumPlacements() { return locations->getNum(); }
47 void removeAllPlacements();
49 ssgTransform *getPosTransform() { return pos; }
51 virtual const char *getTypeName(void) ;
52 virtual void cull ( sgFrustum *f, sgMat4 m, int test_needed ) ;
53 virtual void isect ( sgSphere *s, sgMat4 m, int test_needed ) ;
54 virtual void hot ( sgVec3 s, sgMat4 m, int test_needed ) ;
55 virtual void los ( sgVec3 s, sgMat4 m, int test_needed ) ;
56 virtual void print ( FILE *fd = stderr, char *indent = "", int how_much = 2 ) ;
58 virtual void getStats ( int *num_branches, int *num_leaves, int *num_tris, int *num_vertices ) ;
60 virtual int load ( FILE *fd ) ;
61 virtual int save ( FILE *fd ) ;
62 virtual void recalcBSphere () ;
66 #endif // _SSG_ENTITY_ARRAY_HXX