diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-23 09:33:53 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-09-23 09:33:53 +0200 |
commit | ec2c6c0f13004bc1bba92f14443228778da287a0 (patch) | |
tree | 5c4e2621091ad7bbd31e6ffb6a277c1aaee39b55 /src/extras | |
parent | 5476bc6b4b6a12c921da502c24c4e078b04dd3b3 (diff) | |
parent | 0e3d54f8d7f9be26687afebcc9f456e4cefc2357 (diff) |
Merge remote-tracking branch 'origin/5.8' into devwip/particles
Change-Id: I4e1c528eb8e1c81aead51a5664635ca2becad397
Diffstat (limited to 'src/extras')
25 files changed, 804 insertions, 333 deletions
diff --git a/src/extras/defaults/qdiffusemapmaterial.cpp b/src/extras/defaults/qdiffusemapmaterial.cpp index 854d0a809..b3aa3bf00 100644 --- a/src/extras/defaults/qdiffusemapmaterial.cpp +++ b/src/extras/defaults/qdiffusemapmaterial.cpp @@ -178,14 +178,16 @@ void QDiffuseMapMaterialPrivate::handleTextureScaleChanged(const QVariant &var) } /*! - \class Qt3DRender::QDiffuseMapMaterial - \brief The QDiffuseMapMaterial provides a default implementation of the phong lighting effect where the diffuse light component - is read from a texture map. - \inmodule Qt3DRender - \since 5.5 + \class Qt3DExtras::QDiffuseMapMaterial + \brief The QDiffuseMapMaterial provides a default implementation of the phong lighting effect + where the diffuse light component is read from a texture map. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QMaterial - The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. - The relative strengths of these components is controlled by means of their reflectivity coefficients which are modelled as RGB triplets: + The specular lighting effect is based on the combination of 3 lighting components ambient, + diffuse and specular. The relative strengths of these components are controlled by means of + their reflectivity coefficients which are modelled as RGB triplets: \list \li Ambient is the color that is emitted by an object without any other light source. @@ -194,12 +196,12 @@ void QDiffuseMapMaterialPrivate::handleTextureScaleChanged(const QVariant &var) \li The shininess of a surface is controlled by a float property. \endlist - This material uses an effect with a single render pass approach and performs per fragment lighting. - Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. + This material uses an effect with a single render pass approach and performs per fragment + lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. */ /*! - Constructs a new Qt3DRender::QDiffuseMapMaterial instance with parent object \a parent. + Constructs a new QDiffuseMapMaterial instance with parent object \a parent. */ QDiffuseMapMaterial::QDiffuseMapMaterial(QNode *parent) : QMaterial(*new QDiffuseMapMaterialPrivate, parent) @@ -216,7 +218,7 @@ QDiffuseMapMaterial::~QDiffuseMapMaterial() } /*! - \property Qt3DRender::QDiffuseMapMaterial::ambient + \property QDiffuseMapMaterial::ambient Holds the current ambient color. */ @@ -228,7 +230,7 @@ QColor QDiffuseMapMaterial::ambient() const } /*! - \property Qt3DRender::QDiffuseMapMaterial::specular + \property QDiffuseMapMaterial::specular Holds the current specular color. */ @@ -239,7 +241,7 @@ QColor QDiffuseMapMaterial::specular() const } /*! - \property Qt3DRender::QDiffuseMapMaterial::shininess + \property QDiffuseMapMaterial::shininess Holds the current shininess as a float value. */ @@ -250,9 +252,9 @@ float QDiffuseMapMaterial::shininess() const } /*! - \property Qt3DRender::QDiffuseMapMaterial::diffuse + \property QDiffuseMapMaterial::diffuse - Holds the current QTexture used as the diffuse map. + Holds the current texture used as the diffuse map. By default, the diffuse texture has the following properties: @@ -270,9 +272,10 @@ QAbstractTexture *QDiffuseMapMaterial::diffuse() const } /*! - \property Qt3DRender::QDiffuseMapMaterial::textureScale + \property QDiffuseMapMaterial::textureScale - Holds the current texture scale as a float value. + Holds the current texture scale. It is applied as a multiplier to texture + coordinates at render time. Defaults to 1.0. */ float QDiffuseMapMaterial::textureScale() const diff --git a/src/extras/defaults/qdiffusespecularmapmaterial.cpp b/src/extras/defaults/qdiffusespecularmapmaterial.cpp index a4ccb6121..4b79eea2b 100644 --- a/src/extras/defaults/qdiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qdiffusespecularmapmaterial.cpp @@ -185,14 +185,16 @@ void QDiffuseSpecularMapMaterialPrivate::handleTextureScaleChanged(const QVarian } /*! - \class Qt3DRender::QDiffuseSpecularMapMaterial - \brief The QDiffuseSpecularMapMaterial provides a default implementation of the phong lighting and bump effect where the diffuse and specular light components - are read from texture maps. - \inmodule Qt3DRender - \since 5.5 + \class Qt3DExtras::QDiffuseSpecularMapMaterial + \brief The QDiffuseSpecularMapMaterial provides a default implementation of the phong lighting + effect where the diffuse and specular light components are read from texture maps. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QMaterial - The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. - The relative strengths of these components is controlled by means of their reflectivity coefficients which are modelled as RGB triplets: + The specular lighting effect is based on the combination of 3 lighting components ambient, + diffuse and specular. The relative strengths of these components are controlled by means of + their reflectivity coefficients which are modelled as RGB triplets: \list \li Ambient is the color that is emitted by an object without any other light source. @@ -201,12 +203,12 @@ void QDiffuseSpecularMapMaterialPrivate::handleTextureScaleChanged(const QVarian \li The shininess of a surface is controlled by a float property. \endlist - This material uses an effect with a single render pass approach and performs per fragment lighting. - Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. + This material uses an effect with a single render pass approach and performs per fragment + lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. */ /*! - Constructs a new Qt3DRender::QDiffuseSpecularMapMaterial instance with parent object \a parent. + Constructs a new QDiffuseSpecularMapMaterial instance with parent object \a parent. */ QDiffuseSpecularMapMaterial::QDiffuseSpecularMapMaterial(QNode *parent) : QMaterial(*new QDiffuseSpecularMapMaterialPrivate, parent) @@ -223,7 +225,7 @@ QDiffuseSpecularMapMaterial::~QDiffuseSpecularMapMaterial() } /*! - \property Qt3DRender::QDiffuseSpecularMapMaterial::ambient + \property QDiffuseSpecularMapMaterial::ambient Holds the current ambient color. */ @@ -234,7 +236,7 @@ QColor QDiffuseSpecularMapMaterial::ambient() const } /*! - \property Qt3DRender::QDiffuseSpecularMapMaterial::diffuse + \property QDiffuseSpecularMapMaterial::diffuse Holds the current diffuse map texture. @@ -254,7 +256,7 @@ QAbstractTexture *QDiffuseSpecularMapMaterial::diffuse() const } /*! - \property Qt3DRender::QDiffuseSpecularMapMaterial::specular + \property QDiffuseSpecularMapMaterial::specular Holds the current specular map texture. @@ -274,7 +276,7 @@ QAbstractTexture *QDiffuseSpecularMapMaterial::specular() const } /*! - \property Qt3DRender::QDiffuseSpecularMapMaterial::shininess + \property QDiffuseSpecularMapMaterial::shininess Holds the current shininess as a float value. */ @@ -285,9 +287,10 @@ float QDiffuseSpecularMapMaterial::shininess() const } /*! - \property Qt3DRender::QDiffuseSpecularMapMaterial::textureScale + \property QDiffuseSpecularMapMaterial::textureScale - Holds the current texture scale as a float value. + Holds the current texture scale. It is applied as a multiplier to texture + coordinates at render time. Defaults to 1.0. */ float QDiffuseSpecularMapMaterial::textureScale() const { diff --git a/src/extras/defaults/qfirstpersoncameracontroller.cpp b/src/extras/defaults/qfirstpersoncameracontroller.cpp index 37892d3d3..19446d3ba 100644 --- a/src/extras/defaults/qfirstpersoncameracontroller.cpp +++ b/src/extras/defaults/qfirstpersoncameracontroller.cpp @@ -188,12 +188,45 @@ void QFirstPersonCameraControllerPrivate::_q_onTriggered(float dt) m_tyAxis->value() * m_linearSpeed, m_tzAxis->value() * m_linearSpeed) * dt); if (m_leftMouseButtonAction->isActive()) { - m_camera->pan(m_rxAxis->value() * m_lookSpeed * dt, m_firstPersonUp); - m_camera->tilt(m_ryAxis->value() * m_lookSpeed * dt); + float lookSpeed = m_lookSpeed; + if (m_fineMotionAction->isActive()) + lookSpeed *= 0.2f; + m_camera->pan(m_rxAxis->value() * lookSpeed * dt, m_firstPersonUp); + m_camera->tilt(m_ryAxis->value() * lookSpeed * dt); } } } +/*! + \class Qt3DExtras::QFirstPersonCameraController + \brief The QFirstPersonCameraController class allows controlling the scene camera + from the first person perspective. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DCore::QEntity + + The controls are: + \table + \header + \li Input + \li Action + \row + \li Left mouse button + \li While the left mouse button is pressed, mouse movement along x-axis pans the camera and + movement along y-axis tilts it. + \row + \li Shift key + \li Turns the fine motion control active while pressed. Makes mouse pan and tilt less + sensitive. + \row + \li Arrow keys + \li Move the camera horizontally relative to camera viewport. + \row + \li Page up and page down keys + \li Move the camera vertically relative to camera viewport. + \endtable +*/ + QFirstPersonCameraController::QFirstPersonCameraController(Qt3DCore::QNode *parent) : Qt3DCore::QEntity(*new QFirstPersonCameraControllerPrivate, parent) { @@ -205,18 +238,35 @@ QFirstPersonCameraController::~QFirstPersonCameraController() { } +/*! + \property QFirstPersonCameraController::camera + + Holds the currently controlled camera. +*/ Qt3DRender::QCamera *QFirstPersonCameraController::camera() const { Q_D(const QFirstPersonCameraController); return d->m_camera; } +/*! + \property QFirstPersonCameraController::linearSpeed + + Holds the current linear speed of the camera controller. Linear speed determines the + movement speed of the camera. +*/ float QFirstPersonCameraController::linearSpeed() const { Q_D(const QFirstPersonCameraController); return d->m_linearSpeed; } +/*! + \property QFirstPersonCameraController::lookSpeed + + Holds the current look speed of the camera controller. The look speed determines the turn rate + of the camera pan and tilt. +*/ float QFirstPersonCameraController::lookSpeed() const { Q_D(const QFirstPersonCameraController); diff --git a/src/extras/defaults/qforwardrenderer.cpp b/src/extras/defaults/qforwardrenderer.cpp index 43d8c1029..d556b58d3 100644 --- a/src/extras/defaults/qforwardrenderer.cpp +++ b/src/extras/defaults/qforwardrenderer.cpp @@ -85,26 +85,46 @@ void QForwardRendererPrivate::init() } /*! - \class Qt3DRender::QForwardRenderer - \brief The Qt3DRender::QForwardRenderer provides a default \l {QFrameGraph}{FrameGraph} implementation of a forward renderer. - \inmodule Qt3DRender - \since 5.5 - - Forward rendering is how OpenGL is traditionally. It renders directly to the backbuffer + \class Qt3DExtras::QForwardRenderer + \brief The QForwardRenderer provides a default \l{Qt 3D Render Framegraph}{FrameGraph} + implementation of a forward renderer. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QTechniqueFilter + + Forward rendering is what OpenGL traditionally uses. It renders directly to the backbuffer one object at a time shading each one as it goes. - Internally the Qt3DRender::QForwardRenderer is a subclass of Qt3DRender::QTechniqueFilter. - This a is a single leaf Framegraph tree which contains a Qt3DRender::QViewport, a Qt3DRender::QCameraSelector - and a Qt3DRender::QClearBuffers. - The Qt3DRender::QForwardRenderer has a default requirement annotation whose name is "renderingStyle" and value "forward". - If you need to filter out your techniques, you should do so based on that annotation. + QForwardRenderer is a single leaf \l{Qt 3D Render Framegraph}{FrameGraph} tree which contains + a Qt3DRender::QViewport, a Qt3DRender::QCameraSelector, and a Qt3DRender::QClearBuffers. + The QForwardRenderer has a default requirement filter key whose name is "renderingStyle" and + value "forward". + If you need to filter out your techniques, you should do so based on that filter key. - By default the viewport occupies the whole screen and the clear color is white. Frustum culling is also enabled. + By default the viewport occupies the whole screen and the clear color is white. + Frustum culling is also enabled. */ - /*! - Constructs a new Qt3DRender::QForwardRenderer instance with parent object \a parent. + \qmltype ForwardRenderer + \brief The ForwardRenderer provides a default \l{Qt 3D Render Framegraph}{FrameGraph} + implementation of a forward renderer. + \since 5.7 + \inqmlmodule Qt3D.Extras + \instantiates Qt3DExtras::QForwardRenderer + + Forward rendering is what OpenGL traditionally uses. It renders directly to the backbuffer + one object at a time shading each one as it goes. + + ForwardRenderer is a single leaf \l{Qt 3D Render Framegraph}{FrameGraph} tree which contains + a Viewport, a CameraSelector, and a ClearBuffers. + The ForwardRenderer has a default requirement filter key whose name is "renderingStyle" and + value "forward". + If you need to filter out your techniques, you should do so based on that filter key. + + By default the viewport occupies the whole screen and the clear color is white. + Frustum culling is also enabled. */ + QForwardRenderer::QForwardRenderer(QNode *parent) : QTechniqueFilter(*new QForwardRendererPrivate, parent) { @@ -117,9 +137,6 @@ QForwardRenderer::QForwardRenderer(QNode *parent) d->init(); } -/*! - Destroys the QForwardRenderer instance. -*/ QForwardRenderer::~QForwardRenderer() { } @@ -136,11 +153,6 @@ void QForwardRenderer::setClearColor(const QColor &clearColor) d->m_clearBuffer->setClearColor(clearColor); } -/*! - Sets the camera which should be used to render the scene to \a camera. - - \note A camera is a QEntity having a QCameraLens as one of its components. -*/ void QForwardRenderer::setCamera(Qt3DCore::QEntity *camera) { Q_D(QForwardRenderer); @@ -160,10 +172,15 @@ void QForwardRenderer::setExternalRenderTargetSize(const QSize &size) } /*! - \property Qt3DRender::QForwardRenderer::viewportRect + \qmlproperty rect ForwardRenderer::viewportRect - Holds the current viewport normalizedRect. - */ + Holds the current normalized viewport rectangle. +*/ +/*! + \property QForwardRenderer::viewportRect + + Holds the current normalized viewport rectangle. +*/ QRectF QForwardRenderer::viewportRect() const { Q_D(const QForwardRenderer); @@ -171,9 +188,16 @@ QRectF QForwardRenderer::viewportRect() const } /*! - \property Qt3DRender::QForwardRenderer::clearColor + \qmlproperty color ForwardRenderer::clearColor + + Holds the current clear color of the scene. The frame buffer is initialized to the clear color + before rendering. +*/ +/*! + \property QForwardRenderer::clearColor - Holds the current clearColor. + Holds the current clear color of the scene. The frame buffer is initialized to the clear color + before rendering. */ QColor QForwardRenderer::clearColor() const { @@ -182,9 +206,16 @@ QColor QForwardRenderer::clearColor() const } /*! - \property Qt3DRender::QForwardRenderer::camera + \qmlproperty Entity ForwardRenderer::camera + + Holds the current camera entity used to render the scene. + + \note A camera is an Entity that has a CameraLens as one of its components. +*/ +/*! + \property QForwardRenderer::camera - Holds the current QEntity camera used to render the scene. + Holds the current camera entity used to render the scene. \note A camera is a QEntity that has a QCameraLens as one of its components. */ @@ -194,6 +225,16 @@ Qt3DCore::QEntity *QForwardRenderer::camera() const return d->m_cameraSelector->camera(); } +/*! + \qmlproperty Object ForwardRenderer::surface + + Holds the current render surface. +*/ +/*! + \property QForwardRenderer::surface + + Holds the current render surface. +*/ QObject *QForwardRenderer::surface() const { Q_D(const QForwardRenderer); diff --git a/src/extras/defaults/qgoochmaterial.cpp b/src/extras/defaults/qgoochmaterial.cpp index 6b6ea131a..f2f34fc84 100644 --- a/src/extras/defaults/qgoochmaterial.cpp +++ b/src/extras/defaults/qgoochmaterial.cpp @@ -191,7 +191,8 @@ void QGoochMaterialPrivate::handleShininessChanged(const QVariant &var) \brief The QGoochMaterial provides a material that implements the Gooch shading model, popular in CAD and CAM applications. \inmodule Qt3DExtras - \since 5.5 + \since 5.7 + \inherits Qt3DRender::QMaterial The Gooch lighting model uses both color and brightness to help show the curvature of 3D surfaces. This is often better than models such as Phong @@ -201,7 +202,7 @@ void QGoochMaterialPrivate::handleShininessChanged(const QVariant &var) solution. The Gooch lighting model is explained fully in the \l{original Gooch - paper}. The Gooch model mixes a diffuse objetc color with a user-provided + paper}. The Gooch model mixes a diffuse object color with a user-provided cool color and warm color to produce the end points of a color ramp that is used to shade the object based upon the cosine of the angle between the vector from the fragment to the light source and the fragment's normal @@ -215,7 +216,7 @@ void QGoochMaterialPrivate::handleShininessChanged(const QVariant &var) */ /*! - Constructs a new Qt3DExtras::QGoochMaterial instance with parent object \a parent. + Constructs a new QGoochMaterial instance with parent object \a parent. */ QGoochMaterial::QGoochMaterial(QNode *parent) : QMaterial(*new QGoochMaterialPrivate, parent) @@ -237,7 +238,7 @@ QGoochMaterial::QGoochMaterial(QGoochMaterialPrivate &dd, QNode *parent) } /*! - \property Qt3DExtras::QGoochMaterial::diffuse + \property QGoochMaterial::diffuse Holds the current diffuse color. */ @@ -248,7 +249,7 @@ QColor QGoochMaterial::diffuse() const } /*! - \property Qt3DExtras::QGoochMaterial::specular + \property QGoochMaterial::specular Holds the current specular color. */ @@ -259,7 +260,7 @@ QColor QGoochMaterial::specular() const } /*! - \property Qt3DExtras::QGoochMaterial::cool + \property QGoochMaterial::cool Holds the current cool color. */ @@ -270,7 +271,7 @@ QColor QGoochMaterial::cool() const } /*! - \property Qt3DExtras::QGoochMaterial::warm + \property QGoochMaterial::warm Holds the current warm color. */ @@ -281,7 +282,7 @@ QColor QGoochMaterial::warm() const } /*! - \property Qt3DExtras::QGoochMaterial::alpha + \property QGoochMaterial::alpha Holds the current alpha value. The start point of the color ramp used by the Gooch shader is calculated as {c = cool + alpha * diffuse}. @@ -293,7 +294,7 @@ float QGoochMaterial::alpha() const } /*! - \property Qt3DExtras::QGoochMaterial::beta + \property QGoochMaterial::beta Holds the current beta value. The start point of the color ramp used by the Gooch shader is calculated as {c = warm + beta * diffuse}. @@ -305,7 +306,7 @@ float QGoochMaterial::beta() const } /*! - \property Qt3DExtras::QGoochMaterial::shininess + \property QGoochMaterial::shininess Holds the current shininess value. Higher values of shininess result in a smaller and brighter highlight. diff --git a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp index 61b8def84..92564ee3f 100644 --- a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp @@ -146,15 +146,16 @@ void QNormalDiffuseMapAlphaMaterialPrivate::init() /*! - \class Qt3DRender::QNormalDiffuseMapAlphaMaterial - \brief The QNormalDiffuseMapAlphaMaterial provides a default implementation of the phong lighting and bump effect where the diffuse light component - is read from a texture map and the normals of the mesh being rendered from a normal texture map. In addition, it defines an alpha to coverage and - a depth test to be performed in the rendering pass. - \inmodule Qt3DRender - \since 5.5 + \class Qt3DExtras::QNormalDiffuseMapAlphaMaterial + \brief The QNormalDiffuseMapAlphaMaterial provides a specialization of QNormalDiffuseMapMaterial + with alpha coverage and a depth test performed in the rendering pass. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DExtras::QNormalDiffuseMapMaterial - The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. - The relative strengths of these components is controlled by means of their reflectivity coefficients which are modelled as RGB triplets: + The specular lighting effect is based on the combination of 3 lighting components ambient, + diffuse and specular. The relative strengths of these components are controlled by means of + their reflectivity coefficients which are modelled as RGB triplets: \list \li Ambient is the color that is emitted by an object without any other light source. @@ -163,11 +164,11 @@ void QNormalDiffuseMapAlphaMaterialPrivate::init() \li The shininess of a surface is controlled by a float property. \endlist - This material uses an effect with a single render pass approach and performs per fragment lighting. - Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. + This material uses an effect with a single render pass approach and performs per fragment + lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. */ /*! - Constructs a new Qt3DRender::QNormalDiffuseMapAlphaMaterial instance with parent object \a parent. + Constructs a new QNormalDiffuseMapAlphaMaterial instance with parent object \a parent. */ QNormalDiffuseMapAlphaMaterial::QNormalDiffuseMapAlphaMaterial(QNode *parent) : QNormalDiffuseMapMaterial(*new QNormalDiffuseMapAlphaMaterialPrivate, parent) diff --git a/src/extras/defaults/qnormaldiffusemapmaterial.cpp b/src/extras/defaults/qnormaldiffusemapmaterial.cpp index c38756c98..8373c4d5d 100644 --- a/src/extras/defaults/qnormaldiffusemapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapmaterial.cpp @@ -195,14 +195,17 @@ void QNormalDiffuseMapMaterialPrivate::handleTextureScaleChanged(const QVariant } /*! - \class Qt3DRender::QNormalDiffuseMapMaterial - \brief The QNormalDiffuseMapMaterial provides a default implementation of the phong lighting and bump effect where the diffuse light component - is read from a texture map and the normals of the mesh being rendered from a normal texture map. - \inmodule Qt3DRender - \since 5.5 - - The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. - The relative strengths of these components is controlled by means of their reflectivity coefficients which are modelled as RGB triplets: + \class Qt3DExtras::QNormalDiffuseMapMaterial + \brief The QNormalDiffuseMapMaterial provides a default implementation of the phong lighting + and bump effect where the diffuse light component is read from a texture map and the normals of + the mesh being rendered from a normal texture map. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QMaterial + + The specular lighting effect is based on the combination of 3 lighting components ambient, + diffuse and specular. The relative strengths of these components are controlled by means of + their reflectivity coefficients which are modelled as RGB triplets: \list \li Ambient is the color that is emitted by an object without any other light source. @@ -211,12 +214,12 @@ void QNormalDiffuseMapMaterialPrivate::handleTextureScaleChanged(const QVariant \li The shininess of a surface is controlled by a float property. \endlist - This material uses an effect with a single render pass approach and performs per fragment lighting. - Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. + This material uses an effect with a single render pass approach and performs per fragment + lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. */ /*! - Constructs a new Qt3DRender::QNormalDiffuseMapMaterial instance with parent object \a parent. + Constructs a new QNormalDiffuseMapMaterial instance with parent object \a parent. */ QNormalDiffuseMapMaterial::QNormalDiffuseMapMaterial(QNode *parent) : QMaterial(*new QNormalDiffuseMapMaterialPrivate, parent) @@ -241,7 +244,7 @@ QNormalDiffuseMapMaterial::~QNormalDiffuseMapMaterial() } /*! - \property Qt3DRender::QNormalDiffuseMapMaterial::ambient + \property QNormalDiffuseMapMaterial::ambient Holds the current ambient color. */ @@ -252,7 +255,7 @@ QColor QNormalDiffuseMapMaterial::ambient() const } /*! - \property Qt3DRender::QNormalDiffuseMapMaterial::specular + \property QNormalDiffuseMapMaterial::specular Holds the current specular color. */ @@ -263,7 +266,7 @@ QColor QNormalDiffuseMapMaterial::specular() const } /*! - \property Qt3DRender::QNormalDiffuseMapMaterial::diffuse + \property QNormalDiffuseMapMaterial::diffuse Holds the current diffuse map texture. @@ -283,7 +286,7 @@ QAbstractTexture *QNormalDiffuseMapMaterial::diffuse() const } /*! - \property Qt3DRender::QNormalDiffuseMapMaterial::normal + \property QNormalDiffuseMapMaterial::normal Holds the current normal map texture. @@ -302,7 +305,7 @@ QAbstractTexture *QNormalDiffuseMapMaterial::normal() const } /*! - \property Qt3DRender::QNormalDiffuseMapMaterial::shininess + \property QNormalDiffuseMapMaterial::shininess Holds the current shininess as a float value. */ @@ -313,9 +316,10 @@ float QNormalDiffuseMapMaterial::shininess() const } /*! - \property Qt3DRender::QNormalDiffuseMapMaterial::textureScale + \property QNormalDiffuseMapMaterial::textureScale - Holds the current texture scale as a float value. + Holds the current texture scale. It is applied as a multiplier to texture + coordinates at render time. Defaults to 1.0. */ float QNormalDiffuseMapMaterial::textureScale() const { diff --git a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp index 3c26fde5a..e4a83c50c 100644 --- a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp @@ -202,14 +202,17 @@ void QNormalDiffuseSpecularMapMaterialPrivate::handleTextureScaleChanged(const Q } /*! - \class Qt3DRender::QNormalDiffuseSpecularMapMaterial - \brief The QNormalDiffuseSpecularMapMaterial provides a default implementation of the phong lighting and bump effect where the diffuse and specular light components - are read from texture maps and the normals of the mesh being rendered from a normal texture map. - \inmodule Qt3DRender - \since 5.5 - - The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. - The relative strengths of these components is controlled by means of their reflectivity coefficients which are modelled as RGB triplets: + \class Qt3DExtras::QNormalDiffuseSpecularMapMaterial + \brief The QNormalDiffuseSpecularMapMaterial provides a default implementation of the phong + lighting and bump effect where the diffuse and specular light components are read from texture + maps and the normals of the mesh being rendered from a normal texture map. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QMaterial + + The specular lighting effect is based on the combination of 3 lighting components ambient, + diffuse and specular. The relative strengths of these components are controlled by means of + their reflectivity coefficients which are modelled as RGB triplets: \list \li Ambient is the color that is emitted by an object without any other light source. @@ -218,12 +221,12 @@ void QNormalDiffuseSpecularMapMaterialPrivate::handleTextureScaleChanged(const Q \li The shininess of a surface is controlled by a float property. \endlist - This material uses an effect with a single render pass approach and performs per fragment lighting. - Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. + This material uses an effect with a single render pass approach and performs per fragment + lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. */ /*! - Constructs a new Qt3DRender::QNormalDiffuseSpecularMapMaterial instance with parent object \a parent. + Constructs a new QNormalDiffuseSpecularMapMaterial instance with parent object \a parent. */ QNormalDiffuseSpecularMapMaterial::QNormalDiffuseSpecularMapMaterial(QNode *parent) : QMaterial(*new QNormalDiffuseSpecularMapMaterialPrivate, parent) @@ -241,14 +244,14 @@ QNormalDiffuseSpecularMapMaterial::QNormalDiffuseSpecularMapMaterial(QNormalDiff } /*! - Destroys the Qt3DRender::QNormalDiffuseSpecularMapMaterial instance. + Destroys the QNormalDiffuseSpecularMapMaterial instance. */ QNormalDiffuseSpecularMapMaterial::~QNormalDiffuseSpecularMapMaterial() { } /*! - \property Qt3DRender::QNormalDiffuseSpecularMapMaterial::ambient + \property QNormalDiffuseSpecularMapMaterial::ambient Holds the current ambient color. */ @@ -259,7 +262,7 @@ QColor QNormalDiffuseSpecularMapMaterial::ambient() const } /*! - \property Qt3DRender::QNormalDiffuseSpecularMapMaterial::diffuse + \property QNormalDiffuseSpecularMapMaterial::diffuse Holds the current diffuse map texture. @@ -279,7 +282,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::diffuse() const } /*! - \property Qt3DRender::QNormalDiffuseSpecularMapMaterial::normal + \property QNormalDiffuseSpecularMapMaterial::normal Holds the current normal map texture. @@ -298,7 +301,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::normal() const } /*! - \property Qt3DRender::QNormalDiffuseSpecularMapMaterial::specular + \property QNormalDiffuseSpecularMapMaterial::specular Holds the current specular map texture. @@ -318,7 +321,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::specular() const } /*! - \property Qt3DRender::QNormalDiffuseSpecularMapMaterial::shininess + \property QNormalDiffuseSpecularMapMaterial::shininess Holds the current shininess as a float value. */ @@ -329,9 +332,10 @@ float QNormalDiffuseSpecularMapMaterial::shininess() const } /*! - \property Qt3DRender::QNormalDiffuseSpecularMapMaterial::textureScale + \property QNormalDiffuseSpecularMapMaterial::textureScale - Holds the current texture scale as a float value. + Holds the current texture scale. It is applied as a multiplier to texture + coordinates at render time. Defaults to 1.0. */ float QNormalDiffuseSpecularMapMaterial::textureScale() const { diff --git a/src/extras/defaults/qorbitcameracontroller.cpp b/src/extras/defaults/qorbitcameracontroller.cpp index c12a78292..e340941a8 100644 --- a/src/extras/defaults/qorbitcameracontroller.cpp +++ b/src/extras/defaults/qorbitcameracontroller.cpp @@ -54,9 +54,46 @@ QT_BEGIN_NAMESPACE namespace Qt3DExtras { /*! - * \class QOrbitCameraController::QOrbitCameraController - * \internal - */ + \class Qt3DExtras::QOrbitCameraController + \brief The QOrbitCameraController class allows controlling the scene camera along orbital path. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DCore::QEntity + + The controls are: + \table + \header + \li Input + \li Action + \row + \li Left mouse button + \li While the left mouse button is pressed, mouse movement along x-axis moves the camera + left and right and movement along y-axis moves it up and down. + \row + \li Right mouse button + \li While the right mouse button is pressed, mouse movement along x-axis pans the camera + around the camera view center and movement along y-axis tilts it around the camera + view center. + \row + \li Both left and right mouse button + \li While both the left and the right mouse button are pressed, mouse movement along y-axis + zooms the camera in and out without changing the view center. + \row + \li Arrow keys + \li Move the camera vertically and horizontally relative to camera viewport. + \row + \li Page up and page down keys + \li Move the camera forwards and backwards. + \row + \li Shift key + \li Changes the behavior of the up and down arrow keys to zoom the camera in and out + without changing the view center. The other movement keys are disabled. + \row + \li Alt key + \li Changes the behovior of the arrow keys to pan and tilt the camera around the view + center. Disables the page up and page down keys. + \endtable +*/ QOrbitCameraControllerPrivate::QOrbitCameraControllerPrivate() : Qt3DCore::QEntityPrivate() @@ -218,8 +255,8 @@ void QOrbitCameraControllerPrivate::_q_onTriggered(float dt) m_camera->translate(QVector3D(clampInputs(m_rxAxis->value(), m_txAxis->value()) * m_linearSpeed, clampInputs(m_ryAxis->value(), m_tyAxis->value()) * m_linearSpeed, 0) * dt); - return; } + return; } else if (m_rightMouseButtonAction->isActive()) { // Orbit @@ -258,24 +295,47 @@ QOrbitCameraController::~QOrbitCameraController() { } +/*! + \property QOrbitCameraController::camera + + Holds the currently controlled camera. +*/ Qt3DRender::QCamera *QOrbitCameraController::camera() const { Q_D(const QOrbitCameraController); return d->m_camera; } +/*! + \property QOrbitCameraController::linearSpeed + + Holds the current linear speed of the camera controller. Linear speed determines the + movement speed of the camera. +*/ float QOrbitCameraController::linearSpeed() const { Q_D(const QOrbitCameraController); return d->m_linearSpeed; } +/*! + \property QOrbitCameraController::lookSpeed + + Holds the current look speed of the camera controller. The look speed determines the turn rate + of the camera pan and tilt. +*/ float QOrbitCameraController::lookSpeed() const { Q_D(const QOrbitCameraController); return d->m_lookSpeed; } +/*! + \property QOrbitCameraController::zoomInLimit + + Holds the current zoom-in limit. The zoom-in limit determines how close to the view center + the camera can be zoomed. +*/ float QOrbitCameraController::zoomInLimit() const { Q_D(const QOrbitCameraController); diff --git a/src/extras/defaults/qorbitcameracontroller.h b/src/extras/defaults/qorbitcameracontroller.h index fb4d0aa7a..e48e39142 100644 --- a/src/extras/defaults/qorbitcameracontroller.h +++ b/src/extras/defaults/qorbitcameracontroller.h @@ -62,7 +62,6 @@ public: explicit QOrbitCameraController(Qt3DCore::QNode *parent = nullptr); ~QOrbitCameraController(); - float clampInputs(float input1, float input2); Qt3DRender::QCamera *camera() const; float linearSpeed() const; float lookSpeed() const; diff --git a/src/extras/defaults/qpervertexcolormaterial.cpp b/src/extras/defaults/qpervertexcolormaterial.cpp index 2a301cd3f..514f994c1 100644 --- a/src/extras/defaults/qpervertexcolormaterial.cpp +++ b/src/extras/defaults/qpervertexcolormaterial.cpp @@ -73,12 +73,15 @@ QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate() } /*! - \class Qt3DRender::QPerVertexColorMaterial - \brief The QPerVertexColorMaterial class provides a default implementation for rendering the color properties set for each vertex. - \inmodule Qt3DRender - \since 5.5 - - This lighting effect is based on the combination of 2 lighting components ambient and diffuse. Ambient is set by the vertex color. + \class Qt3DExtras::QPerVertexColorMaterial + \brief The QPerVertexColorMaterial class provides a default implementation for rendering the + color properties set for each vertex. + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QMaterial + + This lighting effect is based on the combination of 2 lighting components ambient and diffuse. + Ambient is set by the vertex color. Diffuse takes in account the normal distribution of each vertex. \list @@ -91,8 +94,6 @@ QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate() */ /*! - \fn Qt3DRender::QPerVertexColorMaterial::QPerVertexColorMaterial(Qt3DCore::QNode *parent) - Constructs a new QPerVertexColorMaterial instance with parent object \a parent. */ QPerVertexColorMaterial::QPerVertexColorMaterial(QNode *parent) @@ -103,8 +104,6 @@ QPerVertexColorMaterial::QPerVertexColorMaterial(QNode *parent) } /*! - \fn Qt3DRender::QPerVertexColorMaterial::~QPerVertexColorMaterial() - Destroys the QPerVertexColorMaterial */ QPerVertexColorMaterial::~QPerVertexColorMaterial() diff --git a/src/extras/defaults/qphongalphamaterial.cpp b/src/extras/defaults/qphongalphamaterial.cpp index efc413a86..7a05610c2 100644 --- a/src/extras/defaults/qphongalphamaterial.cpp +++ b/src/extras/defaults/qphongalphamaterial.cpp @@ -194,15 +194,17 @@ void QPhongAlphaMaterialPrivate::handleAlphaChanged(const QVariant &var) } /*! - \class Qt3DRender::QPhongAlphaMaterial + \class Qt3DExtras::QPhongAlphaMaterial \brief The QPhongAlphaMaterial class provides a default implementation of the phong lighting effect with alpha. - \inmodule Qt3DRenderer - \since 5.5 + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QMaterial - The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. - The relative strengths of these components is controlled by means of their reflectivity coefficients which are modelled as RGB triplets: + The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse + and specular. The relative strengths of these components are controlled by means of their + reflectivity coefficients which are modelled as RGB triplets: \list \li Ambient is the color that is emitted by an object without any other light source. @@ -212,13 +214,11 @@ void QPhongAlphaMaterialPrivate::handleAlphaChanged(const QVariant &var) \li Alpha is the transparency of the surface between 0 (fully transparent) and 1 (opaque). \endlist - This material uses an effect with a single render pass approach and performs per fragment lighting. - Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. + This material uses an effect with a single render pass approach and performs per fragment + lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. */ /*! - \fn Qt3DRender::QPhongAlphaMaterial::QPhongAlphaMaterial(Qt3DCore::QNode *parent) - Constructs a new QPhongAlphaMaterial instance with parent object \a parent. */ QPhongAlphaMaterial::QPhongAlphaMaterial(QNode *parent) @@ -247,7 +247,7 @@ QPhongAlphaMaterial::~QPhongAlphaMaterial() } /*! - \property Qt3DRender::QPhongAlphaMaterial::ambient + \property QPhongAlphaMaterial::ambient Holds the ambient color. */ @@ -258,7 +258,7 @@ QColor QPhongAlphaMaterial::ambient() const } /*! - \property Qt3DRender::QPhongAlphaMaterial::diffuse + \property QPhongAlphaMaterial::diffuse Holds the diffuse color. */ @@ -269,7 +269,7 @@ QColor QPhongAlphaMaterial::diffuse() const } /*! - \property Qt3DRender::QPhongAlphaMaterial::specular + \property QPhongAlphaMaterial::specular Holds the specular color. */ @@ -280,7 +280,7 @@ QColor QPhongAlphaMaterial::specular() const } /*! - \property Qt3DRender::QPhongAlphaMaterial::shininess + \property QPhongAlphaMaterial::shininess Holds the shininess exponent. */ @@ -291,11 +291,11 @@ float QPhongAlphaMaterial::shininess() const } /*! - \property Qt3DRender::QPhongAlphaMaterial::alpha + \property QPhongAlphaMaterial::alpha Holds the alpha component of the object which varies between 0 and 1. - \note: default value is 0.5f + The default value is 0.5f. */ float QPhongAlphaMaterial::alpha() const { @@ -303,30 +303,65 @@ float QPhongAlphaMaterial::alpha() const return d->m_alphaParameter->value().toFloat(); } +/*! + \property QPhongAlphaMaterial::sourceRgbArg + + Holds the blend equation source RGB blending argument. + + \sa Qt3DRender::QBlendEquationArguments::Blending +*/ QBlendEquationArguments::Blending QPhongAlphaMaterial::sourceRgbArg() const { Q_D(const QPhongAlphaMaterial); return d->m_blendState->sourceRgb(); } +/*! + \property QPhongAlphaMaterial::destinationRgbArg + + Holds the blend equation destination RGB blending argument. + + \sa Qt3DRender::QBlendEquationArguments::Blending +*/ QBlendEquationArguments::Blending QPhongAlphaMaterial::destinationRgbArg() const { Q_D(const QPhongAlphaMaterial); return d->m_blendState->destinationRgb(); } +/*! + \property QPhongAlphaMaterial::sourceAlphaArg + + Holds the blend equation source alpha blending argument. + + \sa Qt3DRender::QBlendEquationArguments::Blending +*/ QBlendEquationArguments::Blending QPhongAlphaMaterial::sourceAlphaArg() const { Q_D(const QPhongAlphaMaterial); return d->m_blendState->sourceAlpha(); } +/*! + \property QPhongAlphaMaterial::destinationAlphaArg + + Holds the blend equation destination alpha blending argument. + + \sa Qt3DRender::QBlendEquationArguments::Blending +*/ QBlendEquationArguments::Blending QPhongAlphaMaterial::destinationAlphaArg() const { Q_D(const QPhongAlphaMaterial); return d->m_blendState->destinationAlpha(); } +/*! + \property QPhongAlphaMaterial::blendFunctionArg + + Holds the blend equation function argument. + + \sa Qt3DRender::QBlendEquation::BlendFunction +*/ QBlendEquation::BlendFunction QPhongAlphaMaterial::blendFunctionArg() const { Q_D(const QPhongAlphaMaterial); diff --git a/src/extras/defaults/qphongmaterial.cpp b/src/extras/defaults/qphongmaterial.cpp index f9c51bae8..c294984b6 100644 --- a/src/extras/defaults/qphongmaterial.cpp +++ b/src/extras/defaults/qphongmaterial.cpp @@ -162,13 +162,15 @@ void QPhongMaterialPrivate::handleShininessChanged(const QVariant &var) } /*! - \class Qt3DRender::QPhongMaterial + \class Qt3DExtras::QPhongMaterial \brief The QPhongMaterial class provides a default implementation of the phong lighting effect. - \inmodule Qt3DRender - \since 5.5 + \inmodule Qt3DExtras + \since 5.7 + \inherits Qt3DRender::QMaterial - The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. - The relative strengths of these components is controlled by means of their reflectivity coefficients which are modelled as RGB triplets: + The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse + and specular. The relative strengths of these components are controlled by means of their + reflectivity coefficients which are modelled as RGB triplets: \list \li Ambient is the color that is emitted by an object without any other light source. @@ -177,13 +179,11 @@ void QPhongMaterialPrivate::handleShininessChanged(const QVariant &var) \li The shininess of a surface is controlled by a float property. \endlist - This material uses an effect with a single render pass approach and performs per fragment lighting. - Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. + This material uses an effect with a single render pass approach and performs per fragment + lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. */ /*! - \fn Qt3DRender::QPhongMaterial::QPhongMaterial(Qt3DCore::QNode *parent) - Constructs a new QPhongMaterial instance with parent object \a parent. */ QPhongMaterial::QPhongMaterial(QNode *parent) @@ -194,8 +194,6 @@ QPhongMaterial::QPhongMaterial(QNode *parent) } /*! - \fn Qt3DRender::QPhongMaterial::~QPhongMaterial() - Destroys the QPhongMaterial. */ QPhongMaterial::~QPhongMaterial() @@ -203,7 +201,7 @@ QPhongMaterial::~QPhongMaterial() } /*! - \property Qt3DRender::QPhongMaterial::ambient + \property QPhongMaterial::ambient Holds the ambient color. */ @@ -214,7 +212,7 @@ QColor QPhongMaterial::ambient() const } /*! - \property Qt3DRender::QPhongMaterial::diffuse + \property QPhongMaterial::diffuse Holds the diffuse color. */ @@ -225,7 +223,7 @@ QColor QPhongMaterial::diffuse() const } /*! - \property Qt3DRender::QPhongMaterial::specular + \property QPhongMaterial::specular Holds the specular color. */ @@ -236,7 +234,7 @@ QColor QPhongMaterial::specular() const } /*! - \property Qt3DRender::QPhongMaterial::shininess + \property QPhongMaterial::shininess Holds the shininess exponent. */ diff --git a/src/extras/geometries/qconegeometry.cpp b/src/extras/geometries/qconegeometry.cpp index ab652b5dd..9db7e2b46 100644 --- a/src/extras/geometries/qconegeometry.cpp +++ b/src/extras/geometries/qconegeometry.cpp @@ -38,18 +38,16 @@ ****************************************************************************/ /*! - * \class QConeGeometry + * \class Qt3DExtras::QConeGeometry + * \inmodule Qt3DExtras * \brief The QConeGeometry class allows creation of a cone in 3D space. * \since 5.7 * \ingroup geometries + * \inherits Qt3DRender::QGeometry * - * The Cone is a common sight in 3D software shape libraries. - * - * The QConeGeometry class is most commonly used as part of the QConeMesh - * but can also be used in custom QGeometryRenderer subclasses. The class - * allows for creation of both the cone and truncated cone. - * - * \sa Qt3DExtras::QCylinderGeometry, Qt3DExtras::QConeMesh, Qt3DExtras::QGeometryRenderer + * The QConeGeometry class is most commonly used internally by the QConeMesh + * but can also be used in custom Qt3DRender::QGeometryRenderer subclasses. The class + * allows for creation of both a cone and a truncated cone. */ #ifndef _USE_MATH_DEFINES @@ -417,6 +415,83 @@ void QConeGeometryPrivate::init() q->addAttribute(m_indexAttribute); } +/*! + * \qmltype ConeGeometry + * \instantiates Qt3DExtras::QConeGeometry + * \inqmlmodule Qt3D.Extras + * \brief ConeGeometry allows creation of a cone in 3D space. + * + * The ConeGeometry type is most commonly used internally by the ConeMesh type + * but can also be used in custom GeometryRenderer types. + * The ConeGeometry type allows for creation of both a cone and a truncated cone. + */ + +/*! + * \qmlproperty bool ConeGeometry::hasTopEndcap + * + * Determines if the cone top is capped or open. + */ + +/*! + * \qmlproperty bool ConeGeometry::hasBottomEndcap + * + * Determines if the cone bottom is capped or open. + */ + +/*! + * \qmlproperty int ConeGeometry::rings + * + * Holds the number of rings in the geometry. + */ + +/*! + * \qmlproperty int ConeGeometry::slices + * + * Holds the number of slices in the geometry. + */ + +/*! + * \qmlproperty real ConeGeometry::topRadius + * + * Holds the top radius of the cone. + */ + +/*! + * \qmlproperty real ConeGeometry::bottomRadius + * + * Holds the bottom radius of the cone. + */ + +/*! + * \qmlproperty real ConeGeometry::length + * + * Holds the length of the cone. + */ + +/*! + * \qmlproperty Attribute ConeGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ + +/*! + * \qmlproperty Attribute ConeGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ + +/*! + * \qmlproperty Attribute ConeGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ + +/*! + * \qmlproperty Attribute ConeGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ + QConeGeometry::QConeGeometry(QNode *parent) : QGeometry(*new QConeGeometryPrivate, parent) { @@ -437,6 +512,9 @@ QConeGeometry::~QConeGeometry() { } +/*! + * Updates vertices based on geometry properties. + */ void QConeGeometry::updateVertices() { Q_D(QConeGeometry); @@ -448,6 +526,9 @@ void QConeGeometry::updateVertices() d->m_topRadius, d->m_bottomRadius, d->m_length)); } +/*! + * Updates indices based on geometry properties. + */ void QConeGeometry::updateIndices() { Q_D(QConeGeometry); @@ -462,8 +543,70 @@ void QConeGeometry::updateIndices() } /*! - * Sets whether the cone has a sealed top to \a hasTopEndcap. + * \property QConeGeometry::hasTopEndcap + * + * Determines if the cone top is capped or open. + */ +/*! + * \property QConeGeometry::hasBottomEndcap + * + * Determines if the cone bottom is capped or open. */ + +/*! + * \property QConeGeometry::rings + * + * Holds the number of rings in the geometry. + */ + +/*! + * \property QConeGeometry::slices + * + * Holds the number of slices in the geometry. + */ + +/*! + * \property QConeGeometry::topRadius + * + * Holds the top radius of the cone. + */ + +/*! + * \property QConeGeometry::bottomRadius + * + * Holds the bottom radius of the cone. + */ + +/*! + * \property QConeGeometry::length + * + * Holds the length of the cone. + */ + +/*! + * \property QConeGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ + +/*! + * \property QConeGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ + +/*! + * \property QConeGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ + +/*! + * \property QConeGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ + void QConeGeometry::setHasTopEndcap(bool hasTopEndcap) { Q_D(QConeGeometry); @@ -474,9 +617,6 @@ void QConeGeometry::setHasTopEndcap(bool hasTopEndcap) } } -/*! - * Sets whether the cone has a sealed bottom to \a hasBottomEndcap. - */ void QConeGeometry::setHasBottomEndcap(bool hasBottomEndcap) { Q_D(QConeGeometry); @@ -487,9 +627,6 @@ void QConeGeometry::setHasBottomEndcap(bool hasBottomEndcap) } } -/*! - * Sets the number of rings used in the cone's construction tp \a rings. - */ void QConeGeometry::setRings(int rings) { Q_D(QConeGeometry); @@ -501,9 +638,6 @@ void QConeGeometry::setRings(int rings) } } -/*! - * Sets the number of slices used in the cone's construction to \a slices. - */ void QConeGeometry::setSlices(int slices) { Q_D(QConeGeometry); @@ -515,9 +649,6 @@ void QConeGeometry::setSlices(int slices) } } -/*! - * Sets the radius for the top of the cone tp \a topRadius. - */ void QConeGeometry::setTopRadius(float topRadius) { Q_D(QConeGeometry); @@ -528,9 +659,6 @@ void QConeGeometry::setTopRadius(float topRadius) } } -/*! - * Sets the radius for the bottom of the cone to \a bottomRadius. - */ void QConeGeometry::setBottomRadius(float bottomRadius) { Q_D(QConeGeometry); @@ -541,9 +669,6 @@ void QConeGeometry::setBottomRadius(float bottomRadius) } } -/*! - * Sets the cone's length to \a length. - */ void QConeGeometry::setLength(float length) { Q_D(QConeGeometry); @@ -555,63 +680,42 @@ void QConeGeometry::setLength(float length) } } -/*! - * \return whether the cone has a top endcap. - */ bool QConeGeometry::hasTopEndcap() const { Q_D(const QConeGeometry); return d->m_hasTopEndcap; } -/*! - * \return whether the cone has a bottom endcap. - */ bool QConeGeometry::hasBottomEndcap() const { Q_D(const QConeGeometry); return d->m_hasBottomEndcap; } -/*! - * \return the top radius of the cone. - */ float QConeGeometry::topRadius() const { Q_D(const QConeGeometry); return d->m_topRadius; } -/*! - * \return the bottom radius of the cone. - */ float QConeGeometry::bottomRadius() const { Q_D(const QConeGeometry); return d->m_bottomRadius; } -/*! - * \return the number of rings used in the construction of the cone. - */ int QConeGeometry::rings() const { Q_D(const QConeGeometry); return d->m_rings; } -/*! - * \return the number of slices used in the construction of the cone. - */ int QConeGeometry::slices() const { Q_D(const QConeGeometry); return d->m_slices; } -/*! - * \return the cone's length. - */ float QConeGeometry::length() const { Q_D(const QConeGeometry); diff --git a/src/extras/geometries/qconemesh.cpp b/src/extras/geometries/qconemesh.cpp index e2f43b16d..385c469e0 100644 --- a/src/extras/geometries/qconemesh.cpp +++ b/src/extras/geometries/qconemesh.cpp @@ -53,6 +53,64 @@ QT_BEGIN_NAMESPACE namespace Qt3DExtras { +/*! + * \qmltype ConeMesh + * \instantiates Qt3DExtras::QConeMesh + * \inqmlmodule Qt3D.Extras + * \brief A conical mesh. + */ + +/*! + * \qmlproperty int ConeMesh::rings + * + * Holds the number of rings in the mesh. + */ + +/*! + * \qmlproperty int ConeMesh::slices + * + * Holds the number of slices in the mesh. + */ + +/*! + * \qmlproperty bool ConeMesh::hasTopEndcap + * + * Determines if the cone top is capped or open. + */ + +/*! + * \qmlproperty bool ConeMesh::hasBottomEndcap + * + * Determines if the cone bottom is capped or open. + */ + +/*! + * \qmlproperty real ConeMesh::topRadius + * + * Holds the top radius of the cone. + */ + +/*! + * \qmlproperty real ConeMesh::bottomRadius + * + * Holds the bottom radius of the cone. + */ + +/*! + * \qmlproperty real ConeMesh::length + * + * Holds the length of the cone. + */ + +/*! + * \class Qt3DExtras::QConeMesh + * \inmodule Qt3DExtras + * + * \inherits Qt3DRender::QGeometryRenderer + * + * \brief A conical mesh. + */ + QConeMesh::QConeMesh(QNode *parent) : QGeometryRenderer(parent) { @@ -108,36 +166,71 @@ void QConeMesh::setLength(float length) static_cast<QConeGeometry *>(geometry())->setLength(length); } +/*! + * \property QConeMesh::hasTopEndcap + * + * Determines if the cone top is capped or open. + */ bool QConeMesh::hasTopEndcap() const { return static_cast<QConeGeometry *>(geometry())->hasTopEndcap(); } +/*! + * \property QConeMesh::hasBottomEndcap + * + * Determines if the cone bottom is capped or open. + */ bool QConeMesh::hasBottomEndcap() const { return static_cast<QConeGeometry *>(geometry())->hasBottomEndcap(); } +/*! + * \property QConeMesh::topRadius + * + * Holds the top radius of the cone. + */ float QConeMesh::topRadius() const { return static_cast<QConeGeometry *>(geometry())->topRadius(); } +/*! + * \property QConeMesh::bottomRadius + * + * Holds the bottom radius of the cone. + */ float QConeMesh::bottomRadius() const { return static_cast<QConeGeometry *>(geometry())->bottomRadius(); } +/*! + * \property QConeMesh::rings + * + * Holds the number of rings in the mesh. + */ int QConeMesh::rings() const { return static_cast<QConeGeometry *>(geometry())->rings(); } +/*! + * \property QConeMesh::slices + * + * Holds the number of slices in the mesh. + */ int QConeMesh::slices() const { return static_cast<QConeGeometry *>(geometry())->slices(); } +/*! + * \property QConeMesh::length + * + * Holds the length of the cone. + */ float QConeMesh::length() const { return static_cast<QConeGeometry *>(geometry())->length(); diff --git a/src/extras/geometries/qcuboidgeometry.cpp b/src/extras/geometries/qcuboidgeometry.cpp index a632111f6..0f7b5220f 100644 --- a/src/extras/geometries/qcuboidgeometry.cpp +++ b/src/extras/geometries/qcuboidgeometry.cpp @@ -76,23 +76,23 @@ void createPlaneVertexData(float w, float h, const QSize &resolution, switch (normal) { case NegativeX: // Iterate over z - for (int j = resolution.width() - 1; j >= 0; --j) { - const float a = a0 + static_cast<float>(j) * da; - const float u = static_cast<float>(j) * du; + for (int j = resolution.height() - 1; j >= 0; --j) { + const float b = b0 + static_cast<float>(j) * db; + const float v = static_cast<float>(j) * dv; // Iterate over y - for (int i = 0; i < resolution.height(); ++i) { - const float b = b0 + static_cast<float>(i) * db; - const float v = static_cast<float>(i) * dv; + for (int i = 0; i < resolution.width(); ++i) { + const float a = a0 + static_cast<float>(i) * da; + const float u = static_cast<float>(i) * du; // position *vertices++ = planeDistance; - *vertices++ = b; *vertices++ = a; + *vertices++ = b; // texture coordinates - *vertices++ = 1.0f - u; *vertices++ = v; + *vertices++ = u; // normal *vertices++ = -1.0f; @@ -102,8 +102,8 @@ void createPlaneVertexData(float w, float h, const QSize &resolution, // tangent *vertices++ = 0.0f; *vertices++ = 0.0f; - *vertices++ = -1.0f; - *vertices++ = -1.0f; + *vertices++ = 1.0f; + *vertices++ = 1.0f; } } break; @@ -111,22 +111,22 @@ void createPlaneVertexData(float w, float h, const QSize &resolution, case PositiveX: { // Iterate over z for (int j = 0; j < resolution.height(); ++j) { - const float a = a0 + static_cast<float>(j) * da; - const float u = static_cast<float>(j) * du; + const float b = b0 + static_cast<float>(j) * db; + const float v = static_cast<float>(j) * dv; // Iterate over y for (int i = 0; i < resolution.width(); ++i) { - const float b = b0 + static_cast<float>(i) * db; - const float v = static_cast<float>(i) * dv; + const float a = a0 + static_cast<float>(i) * da; + const float u = static_cast<float>(i) * du; // position *vertices++ = planeDistance; - *vertices++ = b; *vertices++ = a; + *vertices++ = b; // texture coordinates + *vertices++ = 1.0f - v; *vertices++ = u; - *vertices++ = v; // normal *vertices++ = 1.0f; @@ -136,8 +136,8 @@ void createPlaneVertexData(float w, float h, const QSize &resolution, // tangent *vertices++ = 0.0f; *vertices++ = 0.0f; - *vertices++ = 1.0f; *vertices++ = -1.0f; + *vertices++ = 1.0f; } } break; @@ -563,44 +563,54 @@ void QCuboidGeometryPrivate::init() /*! * \qmltype CuboidGeometry - * \instantiates Qt3DRender::QCuboidGeometry - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QCuboidGeometry + * \inqmlmodule Qt3D.Extras + * \brief CuboidGeometry allows creation of a cuboid in 3D space. + * + * The CuboidGeometry type is most commonly used internally by the CuboidMesh type + * but can also be used in custom GeometryRenderer types. */ /*! - * \qmlproperty float CuboidGeometry::xExtent + * \qmlproperty real CuboidGeometry::xExtent * - * Holds the x extent. + * Holds the x extent of the geometry. */ /*! - * \qmlproperty float CuboidGeometry::yExtent + * \qmlproperty real CuboidGeometry::yExtent * - * Holds the y extent. + * Holds the y extent of the geometry. */ /*! - * \qmlproperty float CuboidGeometry::zExtent + * \qmlproperty real CuboidGeometry::zExtent * - * Holds the z extent. + * Holds the z extent of the geometry. */ /*! * \qmlproperty size CuboidGeometry::yzMeshResolution * * Holds the y-z resolution. + * The width and height values of this property specify the number of vertices generated for + * the y-z faces of the mesh. */ /*! * \qmlproperty size CuboidGeometry::xzMeshResolution * * Holds the x-z resolution. + * The width and height values of this property specify the number of vertices generated for + * the x-z faces of the mesh. */ /*! * \qmlproperty size CuboidGeometry::xyMeshResolution * * Holds the x-y resolution. + * The width and height values of this property specify the number of vertices generated for + * the x-y faces of the mesh. */ /*! @@ -634,11 +644,15 @@ void QCuboidGeometryPrivate::init() */ /*! - * \class Qt3DRender::QCuboidGeometry - * \inmodule Qt3DRender - * + * \class Qt3DExtras::QCuboidGeometry + * \inmodule Qt3DExtras + * \brief The QCuboidGeometry class allows creation of a cuboid in 3D space. + * \since 5.7 + * \ingroup geometries * \inherits Qt3DRender::QGeometry * + * The QCuboidGeometry class is most commonly used internally by the QCuboidMesh + * but can also be used in custom Qt3DRender::QGeometryRenderer subclasses. */ /*! @@ -770,7 +784,7 @@ void QCuboidGeometry::setXYMeshResolution(const QSize &resolution) /*! * \property QCuboidGeometry::xExtent * - * Holds the x extent. + * Holds the x extent of the geometry. */ float QCuboidGeometry::xExtent() const { @@ -781,7 +795,7 @@ float QCuboidGeometry::xExtent() const /*! * \property QCuboidGeometry::yExtent * - * Holds the y extent. + * Holds the y extent of the geometry. */ float QCuboidGeometry::yExtent() const { @@ -792,7 +806,7 @@ float QCuboidGeometry::yExtent() const /*! * \property QCuboidGeometry::zExtent * - * Holds the z extent. + * Holds the z extent of the geometry. */ float QCuboidGeometry::zExtent() const { @@ -804,6 +818,8 @@ float QCuboidGeometry::zExtent() const * \property QCuboidGeometry::yzMeshResolution * * Holds the y-z resolution. + * The width and height values of this property specify the number of vertices generated for + * the y-z faces of the mesh. */ QSize QCuboidGeometry::yzMeshResolution() const { @@ -815,6 +831,8 @@ QSize QCuboidGeometry::yzMeshResolution() const * \property QCuboidGeometry::xzMeshResolution * * Holds the x-z resolution. + * The width and height values of this property specify the number of vertices generated for + * the x-z faces of the mesh. */ QSize QCuboidGeometry::xyMeshResolution() const { @@ -826,6 +844,8 @@ QSize QCuboidGeometry::xyMeshResolution() const * \property QCuboidGeometry::xyMeshResolution * * Holds the x-y resolution. + * The width and height values of this property specify the number of vertices generated for + * the x-y faces of the mesh. */ QSize QCuboidGeometry::xzMeshResolution() const { diff --git a/src/extras/geometries/qcuboidmesh.cpp b/src/extras/geometries/qcuboidmesh.cpp index 004fca472..7df77ec63 100644 --- a/src/extras/geometries/qcuboidmesh.cpp +++ b/src/extras/geometries/qcuboidmesh.cpp @@ -45,59 +45,65 @@ QT_BEGIN_NAMESPACE namespace Qt3DExtras { /*! - * \qmltype QCuboidMesh - * \instantiates Qt3DRender::QCuboidMesh - * \inqmlmodule Qt3D.Render - * \brief A cube mesh. + * \qmltype CuboidMesh + * \instantiates Qt3DExtras::QCuboidMesh + * \inqmlmodule Qt3D.Extras + * \brief A cuboid mesh. */ /*! - * \qmlproperty float CuboidMesh::xExtent + * \qmlproperty real CuboidMesh::xExtent * - * Holds the x extent. + * Holds the x extent of the mesh. */ /*! - * \qmlproperty float CuboidMesh::yExtent + * \qmlproperty real CuboidMesh::yExtent * - * Holds the y extent. + * Holds the y extent of the mesh. */ /*! - * \qmlproperty float CuboidMesh::zExtent + * \qmlproperty real CuboidMesh::zExtent * - * Holds the z extent. + * Holds the z extent of the mesh. */ /*! * \qmlproperty size CuboidMesh::yzMeshResolution * - * Holds the y-z resolution. + * Holds the y-z resolution of the mesh. + * The width and height values of this property specify the number of vertices generated for + * the y-z faces of the mesh. */ /*! * \qmlproperty size CuboidMesh::xzMeshResolution * - * Holds the x-z resolution. + * Holds the x-z resolution of the mesh. + * The width and height values of this property specify the number of vertices generated for + * the x-z faces of the mesh. */ /*! * \qmlproperty size CuboidMesh::xyMeshResolution * - * Holds the x-y resolution. + * Holds the x-y resolution of the mesh. + * The width and height values of this property specify the number of vertices generated for + * the x-y faces of the mesh. */ /*! - * \class Qt3DRender::QCuboidMesh - * \inmodule Qt3DRender + * \class Qt3DExtras::QCuboidMesh + * \inmodule Qt3DExtras * * \inherits Qt3DRender::QGeometryRenderer * - * \brief A cube mesh. + * \brief A cuboid mesh. */ /*! - * Constructs a new QCuboidMedh with \a parent. + * Constructs a new QCuboidMesh with \a parent. */ QCuboidMesh::QCuboidMesh(QNode *parent) : QGeometryRenderer(parent) @@ -125,7 +131,7 @@ void QCuboidMesh::setXExtent(float xExtent) /*! * \property QCuboidMesh::xExtent * - * Holds the x extent. + * Holds the x extent of the mesh. */ float QCuboidMesh::xExtent() const { @@ -140,7 +146,7 @@ void QCuboidMesh::setYExtent(float yExtent) /*! * \property QCuboidMesh::yExtent * - * Holds the y extent. + * Holds the y extent of the mesh. */ float QCuboidMesh::yExtent() const { @@ -155,7 +161,7 @@ void QCuboidMesh::setZExtent(float zExtent) /*! * \property QCuboidMesh::zExtent * - * Holds the z extent. + * Holds the z extent of the mesh. */ float QCuboidMesh::zExtent() const { @@ -170,7 +176,9 @@ void QCuboidMesh::setYZMeshResolution(const QSize &resolution) /*! * \property QCuboidMesh::yzMeshResolution * - * Holds the y-z resolution. + * Holds the y-z resolution of the mesh. + * The width and height values of this property specify the number of vertices generated for + * the y-z faces of the mesh. */ QSize QCuboidMesh::yzMeshResolution() const { @@ -185,7 +193,9 @@ void QCuboidMesh::setXZMeshResolution(const QSize &resolution) /*! * \property QCuboidMesh::xzMeshResolution * - * Holds the x-z resolution. + * Holds the x-z resolution of the mesh. + * The width and height values of this property specify the number of vertices generated for + * the x-z faces of the mesh. */ QSize QCuboidMesh::xzMeshResolution() const { @@ -200,7 +210,9 @@ void QCuboidMesh::setXYMeshResolution(const QSize &resolution) /*! * \property QCuboidMesh::xyMeshResolution * - * Holds the x-y resolution. + * Holds the x-y resolution of the mesh. + * The width and height values of this property specify the number of vertices generated for + * the x-y faces of the mesh. */ QSize QCuboidMesh::xyMeshResolution() const { diff --git a/src/extras/geometries/qcylindergeometry.cpp b/src/extras/geometries/qcylindergeometry.cpp index 659d38359..136258162 100644 --- a/src/extras/geometries/qcylindergeometry.cpp +++ b/src/extras/geometries/qcylindergeometry.cpp @@ -338,8 +338,12 @@ void QCylinderGeometryPrivate::init() /*! * \qmltype CylinderGeometry - * \instantiates Qt3DRender::QCylinderGeometry - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QCylinderGeometry + * \inqmlmodule Qt3D.Extras + * \brief CylinderGeometry allows creation of a cylinder in 3D space. + * + * The CylinderGeometry type is most commonly used internally by the CylinderMesh type + * but can also be used in custom GeometryRenderer types. */ /*! @@ -355,13 +359,13 @@ void QCylinderGeometryPrivate::init() */ /*! - * \qmlproperty float CylinderGeometry::radius + * \qmlproperty real CylinderGeometry::radius * * Holds the radius of the cylinder. */ /*! - * \qmlproperty float CylinderGeometry::length + * \qmlproperty real CylinderGeometry::length * * Holds the length of the cylinder. */ @@ -391,10 +395,15 @@ void QCylinderGeometryPrivate::init() */ /*! - * \class Qt3DRender::QCylinderGeometry - * \inmodule Qt3DRender - * + * \class Qt3DExtras::QCylinderGeometry + * \inmodule Qt3DExtras + * \brief The QCylinderGeometry class allows creation of a cylinder in 3D space. + * \since 5.7 + * \ingroup geometries * \inherits Qt3DRender::QGeometry + * + * The QCylinderGeometry class is most commonly used internally by the QCylinderMesh + * but can also be used in custom Qt3DRender::QGeometryRenderer subclasses. */ /*! @@ -425,7 +434,7 @@ QCylinderGeometry::~QCylinderGeometry() } /*! - * Updates the vertices based on rings and slices. + * Updates the vertices based on rings, slices, and length properties. */ void QCylinderGeometry::updateVertices() { @@ -439,7 +448,7 @@ void QCylinderGeometry::updateVertices() } /*! - * Updates the indices based on rings and slices. + * Updates the indices based on rings, slices, and length properties. */ void QCylinderGeometry::updateIndices() { diff --git a/src/extras/geometries/qcylindermesh.cpp b/src/extras/geometries/qcylindermesh.cpp index ef405cb6e..875d8ed9a 100644 --- a/src/extras/geometries/qcylindermesh.cpp +++ b/src/extras/geometries/qcylindermesh.cpp @@ -58,8 +58,8 @@ namespace Qt3DExtras { /*! * \qmltype CylinderMesh - * \instantiates Qt3DRender::QCylinderMesh - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QCylinderMesh + * \inqmlmodule Qt3D.Extras * \brief A cylindrical mesh. */ @@ -76,20 +76,20 @@ namespace Qt3DExtras { */ /*! - * \qmlproperty float CylinderMesh::radius + * \qmlproperty real CylinderMesh::radius * * Holds the radius of the cylinder. */ /*! - * \qmlproperty float CylinderMesh::length + * \qmlproperty real CylinderMesh::length * * Holds the length of the cylinder. */ /*! - * \class Qt3DRender::QCylinderMesh - * \inmodule Qt3DRender + * \class Qt3DExtras::QCylinderMesh + * \inmodule Qt3DExtras * * \inherits Qt3DRender::QGeometryRenderer * diff --git a/src/extras/geometries/qplanegeometry.cpp b/src/extras/geometries/qplanegeometry.cpp index dad3147ff..74c90cf1b 100644 --- a/src/extras/geometries/qplanegeometry.cpp +++ b/src/extras/geometries/qplanegeometry.cpp @@ -208,18 +208,22 @@ public: /*! * \qmltype PlaneGeometry - * \instantiates Qt3DRender::QPlaneGeometry - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QPlaneGeometry + * \inqmlmodule Qt3D.Extras + * \brief PlaneGeometry allows creation of a plane in 3D space. + * + * The PlaneGeometry type is most commonly used internally by the PlaneMesh type + * but can also be used in custom GeometryRenderer types. */ /*! - * \qmlproperty float PlaneGeometry::width + * \qmlproperty real PlaneGeometry::width * * Holds the plane width. */ /*! - * \qmlproperty float PlaneGeometry::height + * \qmlproperty real PlaneGeometry::height * * Holds the plane height. */ @@ -261,10 +265,15 @@ public: */ /*! - * \class Qt3DRender::QPlaneGeometry - * \inmodule Qt3DRender - * + * \class Qt3DExtras::QPlaneGeometry + * \inmodule Qt3DExtras + * \brief The QPlaneGeometry class allows creation of a plane in 3D space. + * \since 5.7 + * \ingroup geometries * \inherits Qt3DRender::QGeometry + * + * The QPlaneGeometry class is most commonly used internally by the QPlaneMesh + * but can also be used in custom Qt3DRender::QGeometryRenderer subclasses. */ /*! @@ -295,7 +304,7 @@ QPlaneGeometry::~QPlaneGeometry() } /*! - * Updates vertices based on resolution. + * Updates vertices based on mesh resolution, width, and height properties. */ void QPlaneGeometry::updateVertices() { @@ -310,7 +319,7 @@ void QPlaneGeometry::updateVertices() } /*! - * Updates indices based on resolution. + * Updates indices based on mesh resolution. */ void QPlaneGeometry::updateIndices() { diff --git a/src/extras/geometries/qplanemesh.cpp b/src/extras/geometries/qplanemesh.cpp index f9d1a105b..f14d7cb97 100644 --- a/src/extras/geometries/qplanemesh.cpp +++ b/src/extras/geometries/qplanemesh.cpp @@ -46,19 +46,19 @@ namespace Qt3DExtras { /*! * \qmltype PlaneMesh - * \instantiates Qt3DRender::QPlaneMesh - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QPlaneMesh + * \inqmlmodule Qt3D.Extras * \brief A square planar mesh. */ /*! - * \qmlproperty float PlaneMesh::width + * \qmlproperty real PlaneMesh::width * * Holds the plane width. */ /*! - * \qmlproperty float PlaneMesh::height + * \qmlproperty real PlaneMesh::height * * Holds the plane height. */ @@ -67,11 +67,13 @@ namespace Qt3DExtras { * \qmlproperty size PlaneMesh::meshResolution * * Holds the plane resolution. + * The width and height values of this property specify the number of vertices generated for + * the mesh in the respective dimensions. */ /*! - * \class Qt3DRender::QPlaneMesh - * \inmodule Qt3DRender + * \class Qt3DExtras::QPlaneMesh + * \inmodule Qt3DExtras * * \inherits Qt3DRender::QGeometryRenderer * @@ -135,6 +137,8 @@ void QPlaneMesh::setMeshResolution(const QSize &resolution) * \property QPlaneMesh::meshResolution * * Holds the plane resolution. + * The width and height values of this property specify the number of vertices generated for + * the mesh in the respective dimensions. */ QSize QPlaneMesh::meshResolution() const { diff --git a/src/extras/geometries/qspheregeometry.cpp b/src/extras/geometries/qspheregeometry.cpp index 77844b2af..277d4fcb9 100644 --- a/src/extras/geometries/qspheregeometry.cpp +++ b/src/extras/geometries/qspheregeometry.cpp @@ -315,8 +315,12 @@ void QSphereGeometryPrivate::init() /*! * \qmltype SphereGeometry - * \instantiates QSphereGeometry - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QSphereGeometry + * \inqmlmodule Qt3D.Extras + * \brief SphereGeometry allows creation of a sphere in 3D space. + * + * The SphereGeometry type is most commonly used internally by the SphereMesh type + * but can also be used in custom GeometryRenderer types. */ /*! @@ -332,7 +336,7 @@ void QSphereGeometryPrivate::init() */ /*! - * \qmlproperty float SphereGeometry::radius + * \qmlproperty real SphereGeometry::radius * * Holds the radius of the sphere. */ @@ -340,7 +344,8 @@ void QSphereGeometryPrivate::init() /*! * \qmlproperty bool SphereGeometry::generateTangents * - * Holds the value of the automatic tangent generation flag. + * Holds the value of the automatic tangent vectors generation flag. + * Tangent vectors are orthogonal to normal vectors. */ /*! @@ -374,10 +379,15 @@ void QSphereGeometryPrivate::init() */ /*! - * \class QSphereGeometry - * \inmodule Qt3DRender + * \class Qt3DExtras::QSphereGeometry + * \inmodule Qt3DExtras + * \brief The QSphereGeometry class allows creation of a sphere in 3D space. + * \since 5.7 + * \ingroup geometries + * \inherits Qt3DRender::QGeometry * - * \inherits QGeometry + * The QSphereGeometry class is most commonly used internally by the QSphereMesh + * but can also be used in custom Qt3DRender::QGeometryRenderer subclasses. */ /*! @@ -408,7 +418,7 @@ QSphereGeometry::~QSphereGeometry() } /*! - * Updates vertices based on rings and slices. + * Updates vertices based on rings, slices, and radius properties */ void QSphereGeometry::updateVertices() { @@ -422,7 +432,7 @@ void QSphereGeometry::updateVertices() } /*! - * Updates indices based on rings and slices. + * Updates indices based on rings and slices properties. */ void QSphereGeometry::updateIndices() { @@ -481,7 +491,8 @@ void QSphereGeometry::setGenerateTangents(bool gen) /*! * \property QSphereGeometry::generateTangents * - * Holds the value of the automatic tangent generation flag. + * Holds the value of the automatic tangent vectors generation flag. + * Tangent vectors are orthogonal to normal vectors. */ bool QSphereGeometry::generateTangents() const { diff --git a/src/extras/geometries/qspheremesh.cpp b/src/extras/geometries/qspheremesh.cpp index 205f6437f..90cf5a872 100644 --- a/src/extras/geometries/qspheremesh.cpp +++ b/src/extras/geometries/qspheremesh.cpp @@ -47,8 +47,8 @@ namespace Qt3DExtras { /*! * \qmltype SphereMesh - * \instantiates Qt3DRender::QSphereMesh - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QSphereMesh + * \inqmlmodule Qt3D.Extras * \brief A spherical mesh. */ @@ -65,7 +65,7 @@ namespace Qt3DExtras { */ /*! - * \qmlproperty float SphereMesh::radius + * \qmlproperty real SphereMesh::radius * * Holds the radius of the sphere. */ @@ -73,12 +73,13 @@ namespace Qt3DExtras { /*! * \qmlproperty bool SphereMesh::generateTangents * - * Holds the value of the automatic tangent generation flag. + * Holds the value of the automatic tangent vectors generation flag. + * Tangent vectors are orthogonal to normal vectors. */ /*! - * \class Qt3DRender::QSphereMesh - * \inmodule Qt3DRender + * \class Qt3DExtras::QSphereMesh + * \inmodule Qt3DExtras * * \inherits Qt3DRender::QGeometryRenderer * @@ -127,7 +128,8 @@ void QSphereMesh::setGenerateTangents(bool gen) /*! * \property QSphereMesh::generateTangents * - * Holds the value of the automatic tangent generation flag. + * Holds the value of the automatic tangent vectors generation flag. + * Tangent vectors are orthogonal to normal vectors. */ bool QSphereMesh::generateTangents() const { diff --git a/src/extras/geometries/qtorusgeometry.cpp b/src/extras/geometries/qtorusgeometry.cpp index 1d292dec3..801281110 100644 --- a/src/extras/geometries/qtorusgeometry.cpp +++ b/src/extras/geometries/qtorusgeometry.cpp @@ -264,8 +264,12 @@ void QTorusGeometryPrivate::init() /*! * \qmltype TorusGeometry - * \instantiates Qt3DRender::QTorusGeometry - * \inqmlmodule Qt3D.Render + * \instantiates Qt3DExtras::QTorusGeometry + * \inqmlmodule Qt3D.Extras + * \brief TorusGeometry allows creation of a torus in 3D space. + * + * The TorusGeometry type is most commonly used internally by the TorusMesh type + * but can also be used in custom GeometryRenderer types. */ /*! @@ -281,13 +285,13 @@ void QTorusGeometryPrivate::init() */ /*! - * \qmlproperty float TorusGeometry::radius + * \qmlproperty real TorusGeometry::radius * * Holds the outer radius of the torus. */ /*! - * \qmlproperty float TorusGeometry::minorRadius + * \qmlproperty real TorusGeometry::minorRadius * * Holds the inner radius of the torus. */ @@ -317,10 +321,15 @@ void QTorusGeometryPrivate::init() */ /*! - * \class Qt3DRender::QTorusGeometry - * \inmodule Qt3DRender - * + * \class Qt3DExtras::QTorusGeometry + * \inmodule Qt3DExtras + * \brief The QTorusGeometry class allows creation of a torus in 3D space. + * \since 5.7 + * \ingroup geometries * \inherits Qt3DRender::QGeometry + * + * The QTorusGeometry class is most commonly used internally by the QTorusMesh + * but can also be used in custom Qt3DRender::QGeometryRenderer subclasses. */ /*! @@ -351,7 +360,7 @@ QTorusGeometry::~QTorusGeometry() } /*! - * Updates vertices based on rings and slices. + * Updates vertices based on rings, slices, and radius properties. */ void QTorusGeometry::updateVertices() { @@ -364,7 +373,7 @@ void QTorusGeometry::updateVertices() } /*! - * Updates indices based on rings and slices. + * Updates indices based on rings and slices properties. */ void QTorusGeometry::updateIndices() { diff --git a/src/extras/geometries/qtorusmesh.cpp b/src/extras/geometries/qtorusmesh.cpp index e3b5b61d0..a77631b73 100644 --- a/src/extras/geometries/qtorusmesh.cpp +++ b/src/extras/geometries/qtorusmesh.cpp @@ -51,9 +51,9 @@ namespace Qt3DExtras { /*! * \qmltype TorusMesh - * \instantiates Qt3DRender::QTorusMesh - * \inqmlmodule Qt3D.Render - * \brief A custom mesh. + * \instantiates Qt3DExtras::QTorusMesh + * \inqmlmodule Qt3D.Extras + * \brief A toroidal mesh. */ /*! @@ -69,24 +69,24 @@ namespace Qt3DExtras { */ /*! - * \qmlproperty float TorusMesh::radius + * \qmlproperty real TorusMesh::radius * * Holds the outer radius of the torus. */ /*! - * \qmlproperty float TorusMesh::minorRadius + * \qmlproperty real TorusMesh::minorRadius * * Holds the inner radius of the torus. */ /*! - * \class Qt3DRender::QTorusMesh - * \inmodule Qt3DRender + * \class Qt3DExtras::QTorusMesh + * \inmodule Qt3DExtras * * \inherits Qt3DRender::QGeometryRenderer * - * \brief A custom mesh. + * \brief A toroidal mesh. */ /*! |