From: fredb Date: Tue, 7 Nov 2006 07:22:48 +0000 (+0000) Subject: This class is for plib only X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e947bac4a3cfb14ea9d520b196b9fa7578cfe0a0;p=simgear.git This class is for plib only --- diff --git a/simgear/scene/model/custtrans.cxx b/simgear/scene/model/custtrans.cxx deleted file mode 100755 index 7957a61d..00000000 --- a/simgear/scene/model/custtrans.cxx +++ /dev/null @@ -1,57 +0,0 @@ -/* - $Id$ -*/ - -#include "custtrans.hxx" -void _ssgPushMatrix ( sgMat4 m ); -void _ssgPopMatrix (); - -void SGCustomTransform::copy_from( SGCustomTransform *src, int clone_flags ) -{ - ssgBranch::copy_from( src, clone_flags ); - _callback = src->_callback; - _data = src->_data; -} - -ssgBase *SGCustomTransform::clone( int clone_flags ) -{ - SGCustomTransform *b = new SGCustomTransform; - b -> copy_from( this, clone_flags ); - return b; -} - - -SGCustomTransform::SGCustomTransform() - : _callback(0),_data(0) -{ - type = ssgTypeBranch(); -} - -SGCustomTransform::~SGCustomTransform() -{ -} - -void SGCustomTransform::cull( sgFrustum *f, sgMat4 m, int test_needed ) -{ - if ( ! preTravTests( &test_needed, SSGTRAV_CULL ) ) - return; - - if ( _callback ) { - sgMat4 tmp; - _callback( tmp, f, m, _data ); - - _ssgPushMatrix( tmp ); - glPushMatrix(); - glLoadMatrixf( (float *) tmp ); - - for ( ssgEntity *e = getKid ( 0 ); e != NULL; e = getNextKid() ) - e -> cull( f, tmp, test_needed ); - - glPopMatrix(); - _ssgPopMatrix(); - } - postTravTests( SSGTRAV_CULL ); -} - - -const char *SGCustomTransform::getTypeName (void) { return "SGCustomTransform"; } diff --git a/simgear/scene/model/custtrans.hxx b/simgear/scene/model/custtrans.hxx deleted file mode 100755 index 2b0da4a5..00000000 --- a/simgear/scene/model/custtrans.hxx +++ /dev/null @@ -1,32 +0,0 @@ -/** - * $Id$ - */ - -#ifndef _SG_CUSTOM_TRANSFORM_HXX -#define _SG_CUSTOM_TRANSFORM_HXX 1 - -class SGCustomTransform : public ssgBranch -{ -public: - typedef void (*TransCallback)( sgMat4 r, sgFrustum *f, sgMat4 m, void *d ); - virtual ssgBase *clone( int clone_flags = 0 ); - SGCustomTransform(); - virtual ~SGCustomTransform(void); - - void setTransCallback( TransCallback c, void *d ) { - _callback = c; - _data = d; - } - - virtual const char *getTypeName(void); - virtual void cull( sgFrustum *f, sgMat4 m, int test_needed ); - -protected: - virtual void copy_from( SGCustomTransform *src, int clone_flags ); - -private: - TransCallback _callback; - void *_data; -}; - -#endif // _SG_CUSTOM_TRANSFORM_HXX