]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/shadowvolume.hxx
- better error message when submodel loading failed
[simgear.git] / simgear / scene / model / shadowvolume.hxx
index c852b969ce7731db96c25eb0766d3c45ce97ec29..11fc71fd28a8ff2f025e5e218094dbb7e409d4b6 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 //
 
@@ -41,7 +41,7 @@ class SGPropertyNode;
 class SGShadowVolume {
 
 public:
-       SGShadowVolume();
+       SGShadowVolume( ssgBranch *root );
        ~SGShadowVolume();
 
        typedef enum {
@@ -58,7 +58,7 @@ public:
        void setupShadows(double lon, double lat,
                double gst, double SunRightAscension, double SunDeclination, double sunAngle );
        void endOfFrame(void);
-
+       static int ACpostTravCB( ssgEntity *entity, int traversal_mask );
 
 private:
 
@@ -87,7 +87,7 @@ private:
                sgVec4 * vertices;
                GLushort *silhouetteEdgeIndices;
                int lastSilhouetteIndicesCount;
-
+               bool isTranslucent;
 
                ShadowCaster( int _num_tri, ssgBranch * _geometry_leaf );
                ~ShadowCaster();
@@ -97,7 +97,7 @@ private:
                void DrawInfiniteShadowVolume(sgVec3 lightPosition, bool drawCaps);
                void computeShadows(sgMat4 rotation, sgMat4 rotation_translation, OccluderType occluder_type);
                void getNetTransform ( ssgBranch * branch, sgMat4 xform );
-               bool isSelected (  ssgBranch * branch );
+               bool isSelected (  ssgBranch * branch, float dist);
 
                bool sameVertex(int edge1, int edge2);
        };
@@ -123,10 +123,11 @@ private:
 private:
        void update_light_view(void);
        void computeShadows(void);
+       void cull ( ssgBranch *b, sgFrustum *f, sgMat4 m, int test_needed );
 
-       bool    init_done;
        bool    shadows_enabled;
        bool    shadowsAC_enabled, shadowsAI_enabled, shadowsTO_enabled, shadowsDebug_enabled;
+       bool    shadowsAC_transp_enabled;
        bool    use_alpha;
        bool    canDoAlpha, canDoStencil;
        SGPropertyNode *sim_rendering;
@@ -135,14 +136,10 @@ private:
        int frameNumber;
        int lastTraverseTreeFrame;
        sgMat4 CameraViewM;
-       sgMat4 invViewAngle;
        double  sun_angle;
        SceneryObject_map sceneryObjects;
-       /** this sphere contains the visible scene and is used to cull shadow casters */
-       sgSphere frustumSphere;
-       /** this sphere contains the near clip plane and is used to check the need of a zfail */
-       sgSphere nearClipSphere;
-
+       ssgBranch *ssg_root;
+       bool shadows_rendered;
 };
 
 #endif // _SHADOWVOLUME_HXX