X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Ftgdb%2Fuserdata.hxx;h=da1cc3d1908d66b0e0895816802d51e7b742026f;hb=3b5665fe92802d3d36d6304cb2c184dc03e91de4;hp=dfb439035a1830bd682cd7e94fd9b7b52d5e7dd9;hpb=dcb95d131bc6aef1abe25d1f415e309f06e52436;p=simgear.git diff --git a/simgear/scene/tgdb/userdata.hxx b/simgear/scene/tgdb/userdata.hxx index dfb43903..da1cc3d1 100644 --- a/simgear/scene/tgdb/userdata.hxx +++ b/simgear/scene/tgdb/userdata.hxx @@ -27,89 +27,24 @@ #include -#include STL_STRING +#include -#include - -SG_USING_STD(string); - -class SGMaterial; class SGMatModel; -class SGMatModelGroup; -class SGModelLib; class SGPropertyNode; - /** * the application must call sgUserDataInit() and specify the * following values (needed by the model loader callback at draw time) * before drawing any scenery. */ -void sgUserDataInit( SGModelLib *m, const string &r, - SGPropertyNode *p, double t ); +void sgUserDataInit(SGPropertyNode *p); - -/** - * User data for populating leaves when they come in range. - */ -class SGLeafUserData : public ssgBase +namespace simgear { -public: - bool is_filled_in; - ssgLeaf *leaf; - SGMaterial *mat; - ssgBranch *branch; - float sin_lat; - float cos_lat; - float sin_lon; - float cos_lon; - - void setup_triangle( int i ); -}; - - /** - * User data for populating triangles when they come in range. + * Get the property root for the simulation */ -class SGTriUserData : public ssgBase -{ -public: - bool is_filled_in; - float * p1; - float * p2; - float * p3; - sgVec3 center; - double area; - SGMatModelGroup * object_group; - ssgBranch * branch; - SGLeafUserData * leafData; - unsigned int seed; - - void fill_in_triangle(); - void add_object_to_triangle(SGMatModel * object); - void makeWorldMatrix (sgMat4 ROT, double hdg_deg ); -}; - - -/** - * ssgEntity with a dummy bounding sphere, to fool culling. - * - * This forces the in-range and out-of-range branches to be visited - * when appropriate, even if they have no children. It's ugly, but - * it works and seems fairly efficient (since branches can still - * be culled when they're out of the view frustum). - */ -class SGDummyBSphereEntity : public ssgBranch -{ -public: - SGDummyBSphereEntity (float radius) - { - bsphere.setCenter(0, 0, 0); - bsphere.setRadius(radius); - } - virtual ~SGDummyBSphereEntity () {} - virtual void recalcBSphere () { bsphere_is_invalid = false; } -}; - +SGPropertyNode* getPropertyRoot(); +} #endif // _SG_USERDATA_HXX