From af75d96deb919fc29b0635fe8a7085e5cbb193e9 Mon Sep 17 00:00:00 2001 From: Alexander Filippov Date: Mon, 11 Dec 2017 22:27:01 +0300 Subject: [PATCH 1/2] Hemi-sphere projection, dirty --- StGLWidgets/StGLImageRegion.cpp | 21 ++++++++++++++++----- StImageViewer/StImageViewerGUI.cpp | 2 ++ StImageViewer/StImageViewerStrings.h | 1 + StMoviePlayer/StMoviePlayerGUI.cpp | 2 ++ StMoviePlayer/StMoviePlayerStrings.h | 1 + StShared/StGLUVSphere.cpp | 24 +++++++++++++++++++++--- include/StGL/StParams.h | 19 ++++++++++++++----- include/StGLMesh/StGLUVSphere.h | 11 +++++++++++ include/StGLWidgets/StGLImageRegion.h | 1 + 9 files changed, 69 insertions(+), 13 deletions(-) diff --git a/StGLWidgets/StGLImageRegion.cpp b/StGLWidgets/StGLImageRegion.cpp index 8b60d96e..b4de964d 100644 --- a/StGLWidgets/StGLImageRegion.cpp +++ b/StGLWidgets/StGLImageRegion.cpp @@ -212,6 +212,7 @@ StGLImageRegion::StGLImageRegion(StGLWidget* theParent, : StGLWidget(theParent, 0, 0, StGLCorner(ST_VCORNER_TOP, ST_HCORNER_LEFT)), myQuad(), myUVSphere(StGLVec3(0.0f, 0.0f, 0.0f), 1.0f, 64), + myUVHemiSphere(StGLVec3(0.0f, 0.0f, 0.0f), 1.0f, 64, StGLUVSphereTypeHemi), myTextureQueue(theTextureQueue), myClickPntZo(0.0, 0.0), myKeyFlags(ST_VF_NONE), @@ -394,6 +395,7 @@ StGLImageRegion::~StGLImageRegion() { myTextureQueue->getQTexture().release(aCtx); myQuad.release(aCtx); myUVSphere.release(aCtx); + myUVHemiSphere.release(aCtx); myProgram.release(aCtx); // simplify debugging - nullify pointer to this widget @@ -440,7 +442,9 @@ bool StGLImageRegion::stglInit() { return false; } else if(!myUVSphere.initVBOs(aCtx)) { ST_ERROR_LOG("Fail to init StGLUVSphere"); - } + } else if(!myUVHemiSphere.initVBOs(aCtx)) { + ST_ERROR_LOG("Fail to init StGLUVSphere"); + } // setup texture filter myTextureQueue->getQTexture().setMinMagFilter(aCtx, params.TextureFilter->getValue() == StGLImageProgram::FILTER_NEAREST ? GL_NEAREST : GL_LINEAR); @@ -868,7 +872,8 @@ void StGLImageRegion::stglDrawView(unsigned int theView) { aParams->PanCenter = aPanBack; break; } - case StViewSurface_Sphere: { + case StViewSurface_Sphere: + case StViewSurface_HemiSphere: { if(!myProgram.init(aCtx, aTextures.getColorModel(), aTextures.getColorScale(), aColorGetter)) { break; } @@ -892,7 +897,11 @@ void StGLImageRegion::stglDrawView(unsigned int theView) { myProgram.getActiveProgram()->setProjMat (aCtx, myProjCam.getProjMatrixMono()); myProgram.getActiveProgram()->setModelMat(aCtx, aModelMat); - myUVSphere.draw(aCtx, *myProgram.getActiveProgram()); + if (aViewMode == StViewSurface_Sphere) { + myUVSphere.draw(aCtx, *myProgram.getActiveProgram()); + } else { + myUVHemiSphere.draw(aCtx, *myProgram.getActiveProgram()); + } myProgram.getActiveProgram()->unuse(aCtx); break; @@ -980,7 +989,8 @@ bool StGLImageRegion::tryUnClick(const StClickEvent& theEvent, break; } case StViewSurface_Cubemap: - case StViewSurface_Sphere: { + case StViewSurface_Sphere: + case StViewSurface_HemiSphere: { aParams->moveSphere(getMouseMoveSphere(myClickPntZo, aCursor)); break; } @@ -1060,7 +1070,8 @@ void StGLImageRegion::scaleAt(const StPointD_t& thePoint, break; } case StViewSurface_Cubemap: - case StViewSurface_Sphere: { + case StViewSurface_Sphere: + case StViewSurface_HemiSphere: { if(theStep < 0.0f && aParams->ScaleFactor <= 0.24f) { break; diff --git a/StImageViewer/StImageViewerGUI.cpp b/StImageViewer/StImageViewerGUI.cpp index e646e301..12c17d9e 100644 --- a/StImageViewer/StImageViewerGUI.cpp +++ b/StImageViewer/StImageViewerGUI.cpp @@ -394,6 +394,7 @@ void StImageViewerGUI::fillPanoramaMenu(StGLMenu* theMenu) { myImage->params.ViewMode, StViewSurface_Plain); theMenu->addItem(tr(MENU_VIEW_SURFACE_SPHERE), myImage->params.ViewMode, StViewSurface_Sphere); + theMenu->addItem("Hemi Sphere", myImage->params.ViewMode, StViewSurface_HemiSphere); theMenu->addItem(tr(MENU_VIEW_SURFACE_CUBEMAP), myImage->params.ViewMode, StViewSurface_Cubemap); if(myWindow->hasOrientationSensor()) { @@ -1461,6 +1462,7 @@ void StImageViewerGUI::setVisibility(const StPointD_t& theCursor, switch(aViewMode) { case StViewSurface_Plain: aTrPano = MENU_VIEW_SURFACE_PLANE; break; case StViewSurface_Sphere: aTrPano = MENU_VIEW_SURFACE_SPHERE; break; + case StViewSurface_HemiSphere: aTrPano = MENU_VIEW_SURFACE_HEMISPHERE; break; case StViewSurface_Cubemap: aTrPano = MENU_VIEW_SURFACE_CUBEMAP; break; } myDescr->setText(tr(MENU_VIEW_PANORAMA) + "\n" + tr(aTrPano)); diff --git a/StImageViewer/StImageViewerStrings.h b/StImageViewer/StImageViewerStrings.h index 8d1a1bbe..4d94767c 100644 --- a/StImageViewer/StImageViewerStrings.h +++ b/StImageViewer/StImageViewerStrings.h @@ -99,6 +99,7 @@ namespace StImageViewerStrings { MENU_VIEW_STICK_PANORAMA360 = 1288, MENU_VIEW_FLIPZ_CUBE6x1 = 1291, MENU_VIEW_FLIPZ_CUBE3x2 = 1292, + MENU_VIEW_SURFACE_HEMISPHERE= 1293, // Root -> Output -> Change Device menu MENU_CHANGE_DEVICE = 1400, diff --git a/StMoviePlayer/StMoviePlayerGUI.cpp b/StMoviePlayer/StMoviePlayerGUI.cpp index 36e21192..1a357f71 100644 --- a/StMoviePlayer/StMoviePlayerGUI.cpp +++ b/StMoviePlayer/StMoviePlayerGUI.cpp @@ -622,6 +622,7 @@ void StMoviePlayerGUI::fillPanoramaMenu(StGLMenu* theMenu) { myImage->params.ViewMode, StViewSurface_Plain); theMenu->addItem(tr(MENU_VIEW_SURFACE_SPHERE), myImage->params.ViewMode, StViewSurface_Sphere); + theMenu->addItem("HemiSphere", myImage->params.ViewMode, StViewSurface_HemiSphere); theMenu->addItem(tr(MENU_VIEW_SURFACE_CUBEMAP), myImage->params.ViewMode, StViewSurface_Cubemap); if(myWindow->hasOrientationSensor()) { @@ -1925,6 +1926,7 @@ void StMoviePlayerGUI::setVisibility(const StPointD_t& theCursor) { switch(aViewMode) { case StViewSurface_Plain: aTrPano = MENU_VIEW_SURFACE_PLANE; break; case StViewSurface_Sphere: aTrPano = MENU_VIEW_SURFACE_SPHERE; break; + case StViewSurface_HemiSphere: aTrPano = MENU_VIEW_SURFACE_HEMISPHERE; break; case StViewSurface_Cubemap: aTrPano = MENU_VIEW_SURFACE_CUBEMAP; break; } myDescr->setText(tr(MENU_VIEW_PANORAMA) + "\n" + tr(aTrPano)); diff --git a/StMoviePlayer/StMoviePlayerStrings.h b/StMoviePlayer/StMoviePlayerStrings.h index d5bc22ea..7391538f 100644 --- a/StMoviePlayer/StMoviePlayerStrings.h +++ b/StMoviePlayer/StMoviePlayerStrings.h @@ -117,6 +117,7 @@ namespace StMoviePlayerStrings { MENU_VIEW_TRACK_HEAD_POOR = 1286, MENU_VIEW_TRACK_HEAD_AUDIO = 1287, MENU_VIEW_STICK_PANORAMA360 = 1288, + MENU_VIEW_SURFACE_HEMISPHERE= 1289, // Root -> Audio menu MENU_AUDIO = 1300, diff --git a/StShared/StGLUVSphere.cpp b/StShared/StGLUVSphere.cpp index 187684c5..c2c22a24 100644 --- a/StShared/StGLUVSphere.cpp +++ b/StShared/StGLUVSphere.cpp @@ -19,6 +19,20 @@ namespace { static const GLfloat ST_PIDIV2 = 1.5707963267948966192313216916397f; }; +StGLUVSphere::StGLUVSphere(const StGLVec3& theCenter, + const GLfloat theRadius, + const size_t theRings, + const StGLUVSphereType theType) + : StGLMesh(GL_TRIANGLE_STRIP), + myPrimCounts(1), + myIndPointers(1), + myCenter(theCenter), + myRadius(theRadius), + myRings(theRings), + myType(theType) { + // +} + StGLUVSphere::StGLUVSphere(const StGLVec3& theCenter, const GLfloat theRadius, const size_t theRings) @@ -27,7 +41,8 @@ StGLUVSphere::StGLUVSphere(const StGLVec3& theCenter, myIndPointers(1), myCenter(theCenter), myRadius(theRadius), - myRings(theRings) { + myRings(theRings), + myType(StGLUVSphereTypeFull) { // } @@ -38,7 +53,8 @@ StGLUVSphere::StGLUVSphere(const StBndSphere& theBndSphere, myIndPointers(1), myCenter(theBndSphere.getCenter()), myRadius(theBndSphere.getRadius()), - myRings(theRings) { + myRings(theRings), + myType(StGLUVSphereTypeFull) { // } @@ -68,12 +84,14 @@ bool StGLUVSphere::computeMesh() { StGLVec3* aVert = NULL; StGLVec2 tcrd(0.0f, 0.0f); + GLfloat projections = myType == StGLUVSphereTypeFull ? 1 : 0.5; + for(size_t ringId = 0; ringId <= aRingsCount; ++ringId) { theta = GLfloat(ringId) * ST_PI / GLfloat(aRingsCount) - ST_PIDIV2; tcrd.y() = GLfloat(ringId) / GLfloat(aRingsCount); for(size_t pointId = 0; pointId <= pointPerRing; ++pointId) { - phi = GLfloat(pointId) * ST_TWOPI / GLfloat(pointPerRing); + phi = GLfloat(pointId) * projections * ST_TWOPI / GLfloat(pointPerRing); tcrd.x() = GLfloat(pointId) / GLfloat(pointPerRing); diff --git a/include/StGL/StParams.h b/include/StGL/StParams.h index a0ed937b..11e3d906 100644 --- a/include/StGL/StParams.h +++ b/include/StGL/StParams.h @@ -21,6 +21,7 @@ enum StViewSurface { StViewSurface_Plain, //!< normal 2D image StViewSurface_Cubemap, //!< cubemap texture StViewSurface_Sphere, //!< spherical panorama + StViewSurface_HemiSphere, //!< hemispherical panorama //StViewSurface_Cylinder, //!< cylindrical panorama }; @@ -35,6 +36,7 @@ class StStereoParams { switch(theViewMode) { case StViewSurface_Cubemap: return "cubemap"; case StViewSurface_Sphere: return "sphere"; + case StViewSurface_HemiSphere: return "hemisphere"; case StViewSurface_Plain: return "flat"; } return "flat"; @@ -43,8 +45,11 @@ class StStereoParams { static StViewSurface GET_VIEW_MODE_FROM_STRING(const StString& theViewModeStr) { if(theViewModeStr.isStartsWithIgnoreCase(stCString("cubemap"))) { return StViewSurface_Cubemap; - } else if(theViewModeStr.isStartsWithIgnoreCase(stCString("sphere"))) { - return StViewSurface_Sphere; + } + else if (theViewModeStr.isStartsWithIgnoreCase(stCString("sphere"))) { + return StViewSurface_Sphere; + } else if (theViewModeStr.isStartsWithIgnoreCase(stCString("hemisphere"))) { + return StViewSurface_HemiSphere; } else { return StViewSurface_Plain; } @@ -272,6 +277,7 @@ class StStereoParams { void moveToRight(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: + case StViewSurface_HemiSphere: case StViewSurface_Cubemap: myPanYaw += 100.0f * theDuration; break; @@ -284,7 +290,8 @@ class StStereoParams { void moveToLeft(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: - case StViewSurface_Cubemap: + case StViewSurface_HemiSphere: + case StViewSurface_Cubemap: myPanYaw -= 100.0f * theDuration; break; case StViewSurface_Plain: @@ -308,7 +315,8 @@ class StStereoParams { void moveToDown(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: - case StViewSurface_Cubemap: + case StViewSurface_HemiSphere: + case StViewSurface_Cubemap: myPanPitch = clipPitch(myPanPitch - 100.0f * theDuration); break; case StViewSurface_Plain: @@ -320,7 +328,8 @@ class StStereoParams { void moveToUp(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: - case StViewSurface_Cubemap: + case StViewSurface_HemiSphere: + case StViewSurface_Cubemap: myPanPitch = clipPitch(myPanPitch + 100.0f * theDuration); break; case StViewSurface_Plain: diff --git a/include/StGLMesh/StGLUVSphere.h b/include/StGLMesh/StGLUVSphere.h index 8310a947..6c65691d 100644 --- a/include/StGLMesh/StGLUVSphere.h +++ b/include/StGLMesh/StGLUVSphere.h @@ -11,6 +11,11 @@ #include "StGLMesh.h" +enum StGLUVSphereType { + StGLUVSphereTypeFull, + StGLUVSphereTypeHemi, +}; + class StBndSphere; /** @@ -21,6 +26,11 @@ class StGLUVSphere : public StGLMesh { public: + ST_CPPEXPORT StGLUVSphere(const StGLVec3& theCenter, + const GLfloat theRadius, + const size_t theRings, + const StGLUVSphereType theType); + /** * Defines the UV sphere mesh with specified parameters. */ @@ -55,6 +65,7 @@ class StGLUVSphere : public StGLMesh { StGLVec3 myCenter; GLfloat myRadius; size_t myRings; + StGLUVSphereType myType; }; diff --git a/include/StGLWidgets/StGLImageRegion.h b/include/StGLWidgets/StGLImageRegion.h index 2181c366..7f1eb2ea 100644 --- a/include/StGLWidgets/StGLImageRegion.h +++ b/include/StGLWidgets/StGLImageRegion.h @@ -310,6 +310,7 @@ class StGLImageRegion : public StGLWidget { StGLQuads myQuad; //!< flat quad StGLUVSphere myUVSphere; //!< sphere output helper class + StGLUVSphere myUVHemiSphere; StGLProjCamera myProjCam; //!< copy of projection camera StGLImageProgram myProgram; //!< GL program to draw flat image StHandle myTextureQueue; //!< shared texture queue From f52e05bb2c566b45dc2dd67c912de528d95a1c2b Mon Sep 17 00:00:00 2001 From: Alexander Filippov Date: Sat, 13 Jan 2018 13:33:40 +0300 Subject: [PATCH 2/2] Tabs to spaces --- StGLWidgets/StGLImageRegion.cpp | 24 +++++++++++------------ StImageViewer/StImageViewerGUI.cpp | 4 ++-- StImageViewer/StImageViewerStrings.h | 2 +- StMoviePlayer/StMoviePlayerGUI.cpp | 4 ++-- StMoviePlayer/StMoviePlayerStrings.h | 2 +- StOutDistorted/StOutDistorted.cpp | 4 ++-- StShared/StDevILImage.cpp | 4 ++-- StShared/StGLUVSphere.cpp | 24 +++++++++++------------ include/StGL/StParams.h | 28 +++++++++++++-------------- include/StGLMesh/StGLUVSphere.h | 14 +++++++------- include/StGLWidgets/StGLImageRegion.h | 2 +- 11 files changed, 56 insertions(+), 56 deletions(-) diff --git a/StGLWidgets/StGLImageRegion.cpp b/StGLWidgets/StGLImageRegion.cpp index b4de964d..cacea841 100644 --- a/StGLWidgets/StGLImageRegion.cpp +++ b/StGLWidgets/StGLImageRegion.cpp @@ -395,7 +395,7 @@ StGLImageRegion::~StGLImageRegion() { myTextureQueue->getQTexture().release(aCtx); myQuad.release(aCtx); myUVSphere.release(aCtx); - myUVHemiSphere.release(aCtx); + myUVHemiSphere.release(aCtx); myProgram.release(aCtx); // simplify debugging - nullify pointer to this widget @@ -442,9 +442,9 @@ bool StGLImageRegion::stglInit() { return false; } else if(!myUVSphere.initVBOs(aCtx)) { ST_ERROR_LOG("Fail to init StGLUVSphere"); - } else if(!myUVHemiSphere.initVBOs(aCtx)) { - ST_ERROR_LOG("Fail to init StGLUVSphere"); - } + } else if(!myUVHemiSphere.initVBOs(aCtx)) { + ST_ERROR_LOG("Fail to init StGLUVSphere"); + } // setup texture filter myTextureQueue->getQTexture().setMinMagFilter(aCtx, params.TextureFilter->getValue() == StGLImageProgram::FILTER_NEAREST ? GL_NEAREST : GL_LINEAR); @@ -873,7 +873,7 @@ void StGLImageRegion::stglDrawView(unsigned int theView) { break; } case StViewSurface_Sphere: - case StViewSurface_HemiSphere: { + case StViewSurface_HemiSphere: { if(!myProgram.init(aCtx, aTextures.getColorModel(), aTextures.getColorScale(), aColorGetter)) { break; } @@ -897,11 +897,11 @@ void StGLImageRegion::stglDrawView(unsigned int theView) { myProgram.getActiveProgram()->setProjMat (aCtx, myProjCam.getProjMatrixMono()); myProgram.getActiveProgram()->setModelMat(aCtx, aModelMat); - if (aViewMode == StViewSurface_Sphere) { - myUVSphere.draw(aCtx, *myProgram.getActiveProgram()); - } else { - myUVHemiSphere.draw(aCtx, *myProgram.getActiveProgram()); - } + if (aViewMode == StViewSurface_Sphere) { + myUVSphere.draw(aCtx, *myProgram.getActiveProgram()); + } else { + myUVHemiSphere.draw(aCtx, *myProgram.getActiveProgram()); + } myProgram.getActiveProgram()->unuse(aCtx); break; @@ -990,7 +990,7 @@ bool StGLImageRegion::tryUnClick(const StClickEvent& theEvent, } case StViewSurface_Cubemap: case StViewSurface_Sphere: - case StViewSurface_HemiSphere: { + case StViewSurface_HemiSphere: { aParams->moveSphere(getMouseMoveSphere(myClickPntZo, aCursor)); break; } @@ -1071,7 +1071,7 @@ void StGLImageRegion::scaleAt(const StPointD_t& thePoint, } case StViewSurface_Cubemap: case StViewSurface_Sphere: - case StViewSurface_HemiSphere: { + case StViewSurface_HemiSphere: { if(theStep < 0.0f && aParams->ScaleFactor <= 0.24f) { break; diff --git a/StImageViewer/StImageViewerGUI.cpp b/StImageViewer/StImageViewerGUI.cpp index 12c17d9e..1a3c9743 100644 --- a/StImageViewer/StImageViewerGUI.cpp +++ b/StImageViewer/StImageViewerGUI.cpp @@ -394,7 +394,7 @@ void StImageViewerGUI::fillPanoramaMenu(StGLMenu* theMenu) { myImage->params.ViewMode, StViewSurface_Plain); theMenu->addItem(tr(MENU_VIEW_SURFACE_SPHERE), myImage->params.ViewMode, StViewSurface_Sphere); - theMenu->addItem("Hemi Sphere", myImage->params.ViewMode, StViewSurface_HemiSphere); + theMenu->addItem("Hemi Sphere", myImage->params.ViewMode, StViewSurface_HemiSphere); theMenu->addItem(tr(MENU_VIEW_SURFACE_CUBEMAP), myImage->params.ViewMode, StViewSurface_Cubemap); if(myWindow->hasOrientationSensor()) { @@ -1462,7 +1462,7 @@ void StImageViewerGUI::setVisibility(const StPointD_t& theCursor, switch(aViewMode) { case StViewSurface_Plain: aTrPano = MENU_VIEW_SURFACE_PLANE; break; case StViewSurface_Sphere: aTrPano = MENU_VIEW_SURFACE_SPHERE; break; - case StViewSurface_HemiSphere: aTrPano = MENU_VIEW_SURFACE_HEMISPHERE; break; + case StViewSurface_HemiSphere: aTrPano = MENU_VIEW_SURFACE_HEMISPHERE; break; case StViewSurface_Cubemap: aTrPano = MENU_VIEW_SURFACE_CUBEMAP; break; } myDescr->setText(tr(MENU_VIEW_PANORAMA) + "\n" + tr(aTrPano)); diff --git a/StImageViewer/StImageViewerStrings.h b/StImageViewer/StImageViewerStrings.h index 4d94767c..7173d47c 100644 --- a/StImageViewer/StImageViewerStrings.h +++ b/StImageViewer/StImageViewerStrings.h @@ -99,7 +99,7 @@ namespace StImageViewerStrings { MENU_VIEW_STICK_PANORAMA360 = 1288, MENU_VIEW_FLIPZ_CUBE6x1 = 1291, MENU_VIEW_FLIPZ_CUBE3x2 = 1292, - MENU_VIEW_SURFACE_HEMISPHERE= 1293, + MENU_VIEW_SURFACE_HEMISPHERE= 1293, // Root -> Output -> Change Device menu MENU_CHANGE_DEVICE = 1400, diff --git a/StMoviePlayer/StMoviePlayerGUI.cpp b/StMoviePlayer/StMoviePlayerGUI.cpp index 1a357f71..f04853e5 100644 --- a/StMoviePlayer/StMoviePlayerGUI.cpp +++ b/StMoviePlayer/StMoviePlayerGUI.cpp @@ -622,7 +622,7 @@ void StMoviePlayerGUI::fillPanoramaMenu(StGLMenu* theMenu) { myImage->params.ViewMode, StViewSurface_Plain); theMenu->addItem(tr(MENU_VIEW_SURFACE_SPHERE), myImage->params.ViewMode, StViewSurface_Sphere); - theMenu->addItem("HemiSphere", myImage->params.ViewMode, StViewSurface_HemiSphere); + theMenu->addItem("HemiSphere", myImage->params.ViewMode, StViewSurface_HemiSphere); theMenu->addItem(tr(MENU_VIEW_SURFACE_CUBEMAP), myImage->params.ViewMode, StViewSurface_Cubemap); if(myWindow->hasOrientationSensor()) { @@ -1926,7 +1926,7 @@ void StMoviePlayerGUI::setVisibility(const StPointD_t& theCursor) { switch(aViewMode) { case StViewSurface_Plain: aTrPano = MENU_VIEW_SURFACE_PLANE; break; case StViewSurface_Sphere: aTrPano = MENU_VIEW_SURFACE_SPHERE; break; - case StViewSurface_HemiSphere: aTrPano = MENU_VIEW_SURFACE_HEMISPHERE; break; + case StViewSurface_HemiSphere: aTrPano = MENU_VIEW_SURFACE_HEMISPHERE; break; case StViewSurface_Cubemap: aTrPano = MENU_VIEW_SURFACE_CUBEMAP; break; } myDescr->setText(tr(MENU_VIEW_PANORAMA) + "\n" + tr(aTrPano)); diff --git a/StMoviePlayer/StMoviePlayerStrings.h b/StMoviePlayer/StMoviePlayerStrings.h index 7391538f..7ec857a0 100644 --- a/StMoviePlayer/StMoviePlayerStrings.h +++ b/StMoviePlayer/StMoviePlayerStrings.h @@ -117,7 +117,7 @@ namespace StMoviePlayerStrings { MENU_VIEW_TRACK_HEAD_POOR = 1286, MENU_VIEW_TRACK_HEAD_AUDIO = 1287, MENU_VIEW_STICK_PANORAMA360 = 1288, - MENU_VIEW_SURFACE_HEMISPHERE= 1289, + MENU_VIEW_SURFACE_HEMISPHERE= 1289, // Root -> Audio menu MENU_AUDIO = 1300, diff --git a/StOutDistorted/StOutDistorted.cpp b/StOutDistorted/StOutDistorted.cpp index 188036bd..97aba370 100644 --- a/StOutDistorted/StOutDistorted.cpp +++ b/StOutDistorted/StOutDistorted.cpp @@ -928,7 +928,7 @@ void StOutDistorted::stglDrawVR() { hasComposError = true; } - if(myVrTrackedPoses[vr::k_unTrackedDeviceIndex_Hmd].bPoseIsValid) { + if(myVrTrackedPoses[vr::k_unTrackedDeviceIndex_Hmd].bPoseIsValid) { const vr::HmdMatrix34_t& aHeadPos = myVrTrackedPoses[vr::k_unTrackedDeviceIndex_Hmd].mDeviceToAbsoluteTracking; double aRotMat[3][3]; for(int aRow = 0; aRow < 3; ++aRow) { @@ -937,7 +937,7 @@ void StOutDistorted::stglDrawVR() { } } myVrOrient.setMatrix(aRotMat); - } + } } // real screen buffer diff --git a/StShared/StDevILImage.cpp b/StShared/StDevILImage.cpp index 154e717c..4f53cdb8 100644 --- a/StShared/StDevILImage.cpp +++ b/StShared/StDevILImage.cpp @@ -23,7 +23,7 @@ typedef unsigned int ILenum; typedef unsigned char ILboolean; -typedef int ILint; +typedef int ILint; typedef size_t ILsizei; typedef unsigned char ILubyte; typedef unsigned int ILuint; @@ -59,7 +59,7 @@ typedef unsigned int ILuint; #define IL_BGRA 0x80E1 #define IL_LUMINANCE 0x1909 #define IL_LUMINANCE_ALPHA 0x190A -#define IL_ALPHA 0x190B +#define IL_ALPHA 0x190B #define IL_UNSIGNED_BYTE 0x1401 #define IL_FLOAT 0x1406 diff --git a/StShared/StGLUVSphere.cpp b/StShared/StGLUVSphere.cpp index c2c22a24..13ebcc8c 100644 --- a/StShared/StGLUVSphere.cpp +++ b/StShared/StGLUVSphere.cpp @@ -20,17 +20,17 @@ namespace { }; StGLUVSphere::StGLUVSphere(const StGLVec3& theCenter, - const GLfloat theRadius, - const size_t theRings, - const StGLUVSphereType theType) - : StGLMesh(GL_TRIANGLE_STRIP), - myPrimCounts(1), - myIndPointers(1), - myCenter(theCenter), - myRadius(theRadius), - myRings(theRings), - myType(theType) { - // + const GLfloat theRadius, + const size_t theRings, + const StGLUVSphereType theType) + : StGLMesh(GL_TRIANGLE_STRIP), + myPrimCounts(1), + myIndPointers(1), + myCenter(theCenter), + myRadius(theRadius), + myRings(theRings), + myType(theType) { + // } StGLUVSphere::StGLUVSphere(const StGLVec3& theCenter, @@ -84,7 +84,7 @@ bool StGLUVSphere::computeMesh() { StGLVec3* aVert = NULL; StGLVec2 tcrd(0.0f, 0.0f); - GLfloat projections = myType == StGLUVSphereTypeFull ? 1 : 0.5; + GLfloat projections = myType == StGLUVSphereTypeFull ? 1 : 0.5; for(size_t ringId = 0; ringId <= aRingsCount; ++ringId) { theta = GLfloat(ringId) * ST_PI / GLfloat(aRingsCount) - ST_PIDIV2; diff --git a/include/StGL/StParams.h b/include/StGL/StParams.h index 11e3d906..614fd1be 100644 --- a/include/StGL/StParams.h +++ b/include/StGL/StParams.h @@ -21,7 +21,7 @@ enum StViewSurface { StViewSurface_Plain, //!< normal 2D image StViewSurface_Cubemap, //!< cubemap texture StViewSurface_Sphere, //!< spherical panorama - StViewSurface_HemiSphere, //!< hemispherical panorama + StViewSurface_HemiSphere, //!< hemispherical panorama //StViewSurface_Cylinder, //!< cylindrical panorama }; @@ -36,7 +36,7 @@ class StStereoParams { switch(theViewMode) { case StViewSurface_Cubemap: return "cubemap"; case StViewSurface_Sphere: return "sphere"; - case StViewSurface_HemiSphere: return "hemisphere"; + case StViewSurface_HemiSphere: return "hemisphere"; case StViewSurface_Plain: return "flat"; } return "flat"; @@ -45,11 +45,11 @@ class StStereoParams { static StViewSurface GET_VIEW_MODE_FROM_STRING(const StString& theViewModeStr) { if(theViewModeStr.isStartsWithIgnoreCase(stCString("cubemap"))) { return StViewSurface_Cubemap; - } - else if (theViewModeStr.isStartsWithIgnoreCase(stCString("sphere"))) { - return StViewSurface_Sphere; - } else if (theViewModeStr.isStartsWithIgnoreCase(stCString("hemisphere"))) { - return StViewSurface_HemiSphere; + } + else if (theViewModeStr.isStartsWithIgnoreCase(stCString("sphere"))) { + return StViewSurface_Sphere; + } else if (theViewModeStr.isStartsWithIgnoreCase(stCString("hemisphere"))) { + return StViewSurface_HemiSphere; } else { return StViewSurface_Plain; } @@ -277,7 +277,7 @@ class StStereoParams { void moveToRight(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: - case StViewSurface_HemiSphere: + case StViewSurface_HemiSphere: case StViewSurface_Cubemap: myPanYaw += 100.0f * theDuration; break; @@ -290,8 +290,8 @@ class StStereoParams { void moveToLeft(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: - case StViewSurface_HemiSphere: - case StViewSurface_Cubemap: + case StViewSurface_HemiSphere: + case StViewSurface_Cubemap: myPanYaw -= 100.0f * theDuration; break; case StViewSurface_Plain: @@ -315,8 +315,8 @@ class StStereoParams { void moveToDown(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: - case StViewSurface_HemiSphere: - case StViewSurface_Cubemap: + case StViewSurface_HemiSphere: + case StViewSurface_Cubemap: myPanPitch = clipPitch(myPanPitch - 100.0f * theDuration); break; case StViewSurface_Plain: @@ -328,8 +328,8 @@ class StStereoParams { void moveToUp(const float theDuration = 0.02f) { switch(ViewingMode) { case StViewSurface_Sphere: - case StViewSurface_HemiSphere: - case StViewSurface_Cubemap: + case StViewSurface_HemiSphere: + case StViewSurface_Cubemap: myPanPitch = clipPitch(myPanPitch + 100.0f * theDuration); break; case StViewSurface_Plain: diff --git a/include/StGLMesh/StGLUVSphere.h b/include/StGLMesh/StGLUVSphere.h index 6c65691d..281e2914 100644 --- a/include/StGLMesh/StGLUVSphere.h +++ b/include/StGLMesh/StGLUVSphere.h @@ -12,8 +12,8 @@ #include "StGLMesh.h" enum StGLUVSphereType { - StGLUVSphereTypeFull, - StGLUVSphereTypeHemi, + StGLUVSphereTypeFull, + StGLUVSphereTypeHemi, }; class StBndSphere; @@ -26,10 +26,10 @@ class StGLUVSphere : public StGLMesh { public: - ST_CPPEXPORT StGLUVSphere(const StGLVec3& theCenter, - const GLfloat theRadius, - const size_t theRings, - const StGLUVSphereType theType); + ST_CPPEXPORT StGLUVSphere(const StGLVec3& theCenter, + const GLfloat theRadius, + const size_t theRings, + const StGLUVSphereType theType); /** * Defines the UV sphere mesh with specified parameters. @@ -65,7 +65,7 @@ class StGLUVSphere : public StGLMesh { StGLVec3 myCenter; GLfloat myRadius; size_t myRings; - StGLUVSphereType myType; + StGLUVSphereType myType; }; diff --git a/include/StGLWidgets/StGLImageRegion.h b/include/StGLWidgets/StGLImageRegion.h index 7f1eb2ea..bc49bffb 100644 --- a/include/StGLWidgets/StGLImageRegion.h +++ b/include/StGLWidgets/StGLImageRegion.h @@ -310,7 +310,7 @@ class StGLImageRegion : public StGLWidget { StGLQuads myQuad; //!< flat quad StGLUVSphere myUVSphere; //!< sphere output helper class - StGLUVSphere myUVHemiSphere; + StGLUVSphere myUVHemiSphere; StGLProjCamera myProjCam; //!< copy of projection camera StGLImageProgram myProgram; //!< GL program to draw flat image StHandle myTextureQueue; //!< shared texture queue