5 #include "custtrans.hxx"
6 void _ssgPushMatrix ( sgMat4 m );
8 void _ssgReadInt ( FILE *fd, int *var );
9 void _ssgWriteInt ( FILE *fd, const int var );
10 extern sgMat4 _ssgOpenGLAxisSwapMatrix;
12 void SGCustomTransform::copy_from( SGCustomTransform *src, int clone_flags )
14 ssgBranch::copy_from( src, clone_flags );
15 _callback = src->_callback;
19 ssgBase *SGCustomTransform::clone( int clone_flags )
21 SGCustomTransform *b = new SGCustomTransform;
22 b -> copy_from( this, clone_flags );
27 SGCustomTransform::SGCustomTransform()
28 : _callback(0),_data(0)
30 type = ssgTypeBranch();
33 SGCustomTransform::~SGCustomTransform()
37 void SGCustomTransform::cull( sgFrustum *f, sgMat4 m, int test_needed )
39 if ( ! preTravTests( &test_needed, SSGTRAV_CULL ) )
44 _callback( tmp, f, m, _data );
46 _ssgPushMatrix( tmp );
48 glLoadMatrixf( (float *) tmp );
50 for ( ssgEntity *e = getKid ( 0 ); e != NULL; e = getNextKid() )
51 e -> cull( f, tmp, test_needed );
56 postTravTests( SSGTRAV_CULL );
60 const char *SGCustomTransform::getTypeName (void) { return "SGCustomTransform"; }