Changed TerrainManipulator to use HEADING rather than AZIM to keep it consistent with SphericalManipulator
This commit is contained in:
parent
cd18dc01da
commit
56c32eb131
@ -30,8 +30,8 @@ class OSGGA_EXPORT TerrainManipulator : public MatrixManipulator
|
|||||||
|
|
||||||
enum RotationMode
|
enum RotationMode
|
||||||
{
|
{
|
||||||
ELEVATION_AZIM_ROLL,
|
ELEVATION_HEADING_ROLL,
|
||||||
ELEVATION_AZIM
|
ELEVATION_HEADING
|
||||||
};
|
};
|
||||||
|
|
||||||
void setRotationMode(RotationMode mode);
|
void setRotationMode(RotationMode mode);
|
||||||
|
@ -22,7 +22,7 @@ using namespace osgGA;
|
|||||||
|
|
||||||
TerrainManipulator::TerrainManipulator()
|
TerrainManipulator::TerrainManipulator()
|
||||||
{
|
{
|
||||||
_rotationMode =ELEVATION_AZIM;
|
_rotationMode =ELEVATION_HEADING;
|
||||||
_distance = 1.0;
|
_distance = 1.0;
|
||||||
|
|
||||||
_thrown = false;
|
_thrown = false;
|
||||||
@ -380,7 +380,7 @@ bool TerrainManipulator::calcMovement()
|
|||||||
if (buttonMask==GUIEventAdapter::LEFT_MOUSE_BUTTON)
|
if (buttonMask==GUIEventAdapter::LEFT_MOUSE_BUTTON)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_rotationMode==ELEVATION_AZIM_ROLL)
|
if (_rotationMode==ELEVATION_HEADING_ROLL)
|
||||||
{
|
{
|
||||||
// rotate camera.
|
// rotate camera.
|
||||||
osg::Vec3 axis;
|
osg::Vec3 axis;
|
||||||
@ -557,7 +557,7 @@ bool TerrainManipulator::calcMovement()
|
|||||||
|
|
||||||
void TerrainManipulator::clampOrientation()
|
void TerrainManipulator::clampOrientation()
|
||||||
{
|
{
|
||||||
if (_rotationMode==ELEVATION_AZIM)
|
if (_rotationMode==ELEVATION_HEADING)
|
||||||
{
|
{
|
||||||
osg::Matrixd rotation_matrix;
|
osg::Matrixd rotation_matrix;
|
||||||
rotation_matrix.makeRotate(_rotation);
|
rotation_matrix.makeRotate(_rotation);
|
||||||
|
Loading…
Reference in New Issue
Block a user