Skip to content

Commit 98c4456

Browse files
committed
Review and travis fixes
1 parent d1e4c5e commit 98c4456

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

src/3d/qgscameracontroller.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,32 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity
7272
//! Sets the point toward which the camera is looking - this is used when world origin changes (e.g. after terrain generator changes)
7373
void setLookingAtPoint( const QgsVector3D &point, float distance = -1 );
7474

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

83+
/**
84+
* Returns distance of the camera from the point it is looking at.
85+
* \since QGIS 3.4
86+
*/
7787
float distance() const { return mCameraData.dist; }
88+
89+
/**
90+
* Returns pitch angle in degrees (0 = looking from the top, 90 = looking from the side).
91+
* The angle should range from 0 to 180.
92+
* \since QGIS 3.4
93+
*/
7894
float pitch() const { return mCameraData.pitch; }
95+
96+
/**
97+
* Returns yaw angle in degrees. Yaw value of zero means the camera is pointing towards north.
98+
* The angle should range from 0 to 360.
99+
* \since QGIS 3.4
100+
*/
79101
float yaw() const { return mCameraData.yaw; }
80102

81103
//! Writes camera configuration to the given DOM element

src/app/3d/qgs3danimationsettings.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,18 @@ class Qgs3DAnimationSettings
3636
//! keyframe definition
3737
struct Keyframe
3838
{
39-
float time; //!< Relative time of the keyframe in seconds
40-
41-
QgsVector3D point; //!< Point towards which the camera is looking in 3D world coords
42-
float dist; //!< Distance of the camera from the focal point
43-
float pitch; //!< Tilt of the camera in degrees (0 = looking from the top, 90 = looking from the side, 180 = looking from the bottom)
44-
float yaw; //!< Horizontal rotation around the focal point in degrees
39+
float time = 0; //!< Relative time of the keyframe in seconds
40+
QgsVector3D point; //!< Point towards which the camera is looking in 3D world coords
41+
float dist = 0; //!< Distance of the camera from the focal point
42+
float pitch = 0; //!< Tilt of the camera in degrees (0 = looking from the top, 90 = looking from the side, 180 = looking from the bottom)
43+
float yaw = 0; //!< Horizontal rotation around the focal point in degrees
4544
};
4645

4746
typedef QVector<Keyframe> Keyframes;
4847

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

5253
//! Returns duration of the whole animation in seconds

0 commit comments

Comments
 (0)