Skip to content
Permalink
Browse files

Review and travis fixes

  • Loading branch information
wonder-sk committed Jul 5, 2018
1 parent d1e4c5e commit 98c44564ed728c283ad18333690760fc17e3ef4c
Showing with 29 additions and 6 deletions.
  1. +22 −0 src/3d/qgscameracontroller.h
  2. +7 −6 src/app/3d/qgs3danimationsettings.h
@@ -72,10 +72,32 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity
//! Sets the point toward which the camera is looking - this is used when world origin changes (e.g. after terrain generator changes)
void setLookingAtPoint( const QgsVector3D &point, float distance = -1 );

/**
* Sets the complete camera configuration: the point towards it is looking (in 3D world coordinates), the distance
* of the camera from the point, pitch angle in degrees (0 = looking from the top, 90 = looking from the side) and
* yaw angle in degrees.
* \since QGIS 3.4
*/
void setLookingAtPoint( const QgsVector3D &point, float distance, float pitch, float yaw );

/**
* Returns distance of the camera from the point it is looking at.
* \since QGIS 3.4
*/
float distance() const { return mCameraData.dist; }

/**
* Returns pitch angle in degrees (0 = looking from the top, 90 = looking from the side).
* The angle should range from 0 to 180.
* \since QGIS 3.4
*/
float pitch() const { return mCameraData.pitch; }

/**
* Returns yaw angle in degrees. Yaw value of zero means the camera is pointing towards north.
* The angle should range from 0 to 360.
* \since QGIS 3.4
*/
float yaw() const { return mCameraData.yaw; }

//! Writes camera configuration to the given DOM element
@@ -36,17 +36,18 @@ class Qgs3DAnimationSettings
//! keyframe definition
struct Keyframe
{
float time; //!< Relative time of the keyframe in seconds

QgsVector3D point; //!< Point towards which the camera is looking in 3D world coords
float dist; //!< Distance of the camera from the focal point
float pitch; //!< Tilt of the camera in degrees (0 = looking from the top, 90 = looking from the side, 180 = looking from the bottom)
float yaw; //!< Horizontal rotation around the focal point in degrees
float time = 0; //!< Relative time of the keyframe in seconds
QgsVector3D point; //!< Point towards which the camera is looking in 3D world coords
float dist = 0; //!< Distance of the camera from the focal point
float pitch = 0; //!< Tilt of the camera in degrees (0 = looking from the top, 90 = looking from the side, 180 = looking from the bottom)
float yaw = 0; //!< Horizontal rotation around the focal point in degrees
};

typedef QVector<Keyframe> Keyframes;

//! Configures keyframes of the animation. It is expected that the keyframes are ordered according to their time.
void setKeyframes( const Keyframes &keyframes ) { mKeyframes = keyframes; }
//! Returns keyframes of the animation
Keyframes keyFrames() const { return mKeyframes; }

//! Returns duration of the whole animation in seconds

0 comments on commit 98c4456

Please sign in to comment.
You can’t perform that action at this time.