]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/jpg-httpd.cxx
Use SG_LOG instead of printf
[flightgear.git] / src / Network / jpg-httpd.cxx
index 0cc9ee29fd466737be4f03073090c0981659c1cd..f8ec013485a1ab299256d88599a2999218a70a9c 100644 (file)
 
 #include "jpg-httpd.hxx"
 
-//[Leidson<]
 #define __MAX_HTTP_BLOCK_SIZE       4096
 #define __MAX_STRING_SIZE           2048
 #define __TIMEOUT_COUNT             5
 #define __HTTP_GET_STRING           "GET "
-//[Leidson>]
 
+#include <osg/CameraNode>
+extern osg::ref_ptr<osg::CameraNode> mSceneCamera;
 
 SG_USING_STD(string);
 
@@ -105,6 +105,10 @@ void HttpdImageChannel :: foundTerminator( void ) {
         
         SG_LOG( SG_IO, SG_DEBUG, "<<<<<<<<< HTTP Request : " << pRequest );
 
+        double left, right, bottom, top, zNear, zFar;
+        mSceneCamera->getProjectionMatrixAsFrustum( left, right, bottom, top, zNear, zFar );
+        JpgFactory->setFrustum( left, right, bottom, top, zNear, zFar );
+
         nImageLen  = JpgFactory -> render();
        nBlockSize = ( nImageLen < __MAX_HTTP_BLOCK_SIZE ? nImageLen : __MAX_HTTP_BLOCK_SIZE );