]> git.mxchange.org Git - flightgear.git/blob - src/Objects/ssgEntityArray.hxx
This is a little something I'm dabbling with ... an alternate approach
[flightgear.git] / src / Objects / ssgEntityArray.hxx
1 #ifndef _SSG_ENTITY_ARRAY_HXX
2 #define _SSG_ENTITY_ARRAY_HXX
3
4 #include <plib/ssg.h>
5
6
7 class ssgEntityArray : public ssgEntity
8 {
9     // The replicated child
10     ssgEntity *model ;
11
12     // The one transformation node
13     ssgTransform *pos;
14
15     // The list of locations and orientations
16     ssgVertexArray *locations;
17     ssgVertexArray *orientations;
18
19 protected:
20
21     virtual void copy_from ( ssgEntityArray *src, int clone_flags ) ;
22
23 public:
24
25     virtual void zeroSpareRecursive ();
26
27     virtual ssgBase *clone ( int clone_flags = 0 ) ;
28     ssgEntityArray (void) ;
29     virtual ~ssgEntityArray (void) ;
30
31     ssgEntity *getModel () { return model ; }
32     void setModel        ( ssgEntity *entity ) { model = entity; }
33     void removeModel     () ;
34     void replaceModel    ( ssgEntity *new_entity ) ;
35
36     ssgVertexArray *getLocations () { return locations; }
37     ssgVertexArray *getOrientations () { return orientations; }
38
39     float *getLocation ( int i ) { return locations->get( i ); }
40     float *getOrientation ( int i ) { return orientations->get( i ); }
41     void addPlacement ( sgVec3 loc, sgVec3 orient );
42     virtual int getNumPlacements() { return locations->getNum(); }
43     void removeAllPlacements();
44
45     ssgTransform *getPosTransform() { return pos; }
46
47     virtual const char *getTypeName(void) ;
48     virtual void cull          ( sgFrustum *f, sgMat4 m, int test_needed ) ;
49     virtual void isect         ( sgSphere  *s, sgMat4 m, int test_needed ) ;
50     virtual void hot           ( sgVec3     s, sgMat4 m, int test_needed ) ;
51     virtual void los           ( sgVec3     s, sgMat4 m, int test_needed ) ;
52     virtual void print         ( FILE *fd = stderr, char *indent = "", int how_much = 2 ) ;
53     virtual void getStats ( int *num_branches, int *num_leaves, int *num_tris, int *num_vertices ) ;
54     virtual int load ( FILE *fd ) ;
55     virtual int save ( FILE *fd ) ;
56     virtual void recalcBSphere () ;
57 } ;
58
59
60 #endif // _SSG_ENTITY_ARRAY_HXX