2016-09-14 18:01:13 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Copyright(C) 2015 Christopher Bruns
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with this program. If not, see http://www.gnu.org/licenses/
|
|
|
|
//
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
//
|
2015-12-31 14:06:44 +00:00
|
|
|
/*
|
|
|
|
** scoped_view_shifter.h
|
2016-05-01 15:43:30 +00:00
|
|
|
** Stack-scoped class for temporarily changing camera viewpoint
|
2015-12-31 14:06:44 +00:00
|
|
|
** Used for stereoscopic 3D.
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
2015-10-26 13:08:18 +00:00
|
|
|
#ifndef GL_STEREO3D_SCOPED_VIEW_SHIFTER_H_
|
|
|
|
#define GL_STEREO3D_SCOPED_VIEW_SHIFTER_H_
|
|
|
|
|
|
|
|
#include "basictypes.h"
|
2016-04-02 21:17:16 +00:00
|
|
|
#include "vectors.h"
|
2015-10-26 13:08:18 +00:00
|
|
|
|
|
|
|
namespace s3d {
|
|
|
|
|
|
|
|
/**
|
2016-05-01 15:43:30 +00:00
|
|
|
* Temporarily shift
|
2015-10-26 13:08:18 +00:00
|
|
|
*/
|
|
|
|
class ScopedViewShifter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScopedViewShifter(float dxyz[3]); // in meters
|
|
|
|
~ScopedViewShifter();
|
|
|
|
|
|
|
|
private:
|
2016-04-02 21:17:16 +00:00
|
|
|
DVector3 cachedView;
|
2015-10-26 13:08:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace s3d */
|
|
|
|
|
|
|
|
#endif // GL_STEREO3D_SCOPED_VIEW_SHIFTER_H_
|