Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qssgrendercamera_p.h>
Public Types | |
enum class | DirtyFlag : quint8 { CameraDirty = 0x1 } |
using | FlagT = std::underlying_type_t<DirtyFlag> |
Public Types inherited from QSSGRenderNode | |
enum class | LocalState : quint8 { Active = 1 << 0 , Pickable = 1 << 1 } |
enum class | GlobalState : quint8 { Active = 1 << 2 , Pickable = 1 << 3 } |
enum class | DirtyFlag : quint32 { TransformDirty = 1 << 4 , OpacityDirty = 1 << 5 , ActiveDirty = 1 << 6 , PickableDirty = 1 << 7 , SubNodeDirty = 1 << 8 , GlobalValuesDirty = TransformDirty | OpacityDirty | ActiveDirty | PickableDirty , DirtyMask = GlobalValuesDirty | SubNodeDirty } |
using | FlagT = std::underlying_type_t<DirtyFlag> |
using | ChildList = QSSGInvasiveLinkedList<QSSGRenderNode, &QSSGRenderNode::previousSibling, &QSSGRenderNode::nextSibling> |
Public Types inherited from QSSGRenderGraphObject | |
enum | BaseType : quint32 { Node = 0x1000 , Light = 0x2000 , Camera = 0x4000 , Renderable = 0x8000 , Resource = 0x10000 , Material = 0x20000 , Texture = 0x40000 , Extension = 0x80000 , User = 0x80000000 } |
enum class | Type : quint32 { Unknown = 0 , Node = BaseType::Node , Layer , Joint , Skeleton , ImportScene , ReflectionProbe , DirectionalLight = BaseType::Light | BaseType::Node , PointLight , SpotLight , OrthographicCamera = BaseType::Camera | BaseType::Node , PerspectiveCamera , CustomFrustumCamera , CustomCamera , Model = BaseType::Renderable | BaseType::Node , Item2D , Particles , SceneEnvironment = BaseType::Resource , Effect , Geometry , TextureData , MorphTarget , ModelInstance , ModelBlendParticle , ResourceLoader , DefaultMaterial = BaseType::Material | BaseType::Resource , PrincipledMaterial , CustomMaterial , SpecularGlossyMaterial , Skin , Image2D = BaseType::Texture | BaseType::Resource , ImageCube , RenderExtension = BaseType::Extension } |
enum class | Flags : quint32 { HasGraphicsResources = 0x1 } |
using | TypeT = std::underlying_type_t<Type> |
using | FlagT = std::underlying_type_t<Flags> |
Static Public Member Functions | |
static void | calculateViewProjectionMatrix (const QMatrix4x4 &globalTransform, const QMatrix4x4 &projection, QMatrix4x4 &outMatrix) |
Static Public Member Functions inherited from QSSGRenderNode | |
static QMatrix4x4 | calculateTransformMatrix (QVector3D position, QVector3D scale, QVector3D pivot, QQuaternion rotation) |
static void | calculateMVPAndNormalMatrix (const QMatrix4x4 &globalTransfor, const QMatrix4x4 &inViewProjection, QMatrix4x4 &outMVP, QMatrix3x3 &outNormalMatrix) |
static float | signedSquared (float val) |
Static Public Member Functions inherited from QSSGRenderGraphObject | |
static constexpr bool | isNodeType (Type type) noexcept |
static constexpr bool | isLight (Type type) noexcept |
static constexpr bool | isCamera (Type type) noexcept |
static constexpr bool | isMaterial (Type type) noexcept |
static constexpr bool | isTexture (Type type) noexcept |
static constexpr bool | isRenderable (Type type) noexcept |
static constexpr bool | isResource (Type type) noexcept |
static constexpr bool | isExtension (Type type) noexcept |
static constexpr bool | isUserType (Type type) noexcept |
Static Public Attributes | |
static constexpr DirtyFlag | DirtyMask { std::numeric_limits<FlagT>::max() } |
Static Public Attributes inherited from QSSGRenderNode | |
static constexpr QVector3D | initScale { 1.0f, 1.0f, 1.0f } |
Additional Inherited Members | |
Protected Member Functions inherited from QSSGRenderGraphObject | |
QSSGRenderGraphObject (QSSGRenderGraphObject::Type inType) | |
QSSGRenderGraphObject (QSSGRenderGraphObject::Type inType, FlagT inFlags) | |
Definition at line 34 of file qssgrendercamera_p.h.
using QSSGRenderCamera::FlagT = std::underlying_type_t<DirtyFlag> |
Definition at line 40 of file qssgrendercamera_p.h.
|
strong |
Enumerator | |
---|---|
CameraDirty |
Definition at line 36 of file qssgrendercamera_p.h.
|
explicit |
Definition at line 27 of file qssgrendercamera.cpp.
References CameraDirty, QSSGRenderGraphObject::isCamera(), markDirty(), and Q_ASSERT.
QSSGCameraGlobalCalculationResult QSSGRenderCamera::calculateGlobalVariables | ( | const QRectF & | inViewport | ) |
Definition at line 40 of file qssgrendercamera.cpp.
References QSSGRenderNode::calculateGlobalVariables(), and calculateProjection().
Referenced by QQuick3DCamera::updateGlobalVariables().
bool QSSGRenderCamera::calculateProjection | ( | const QRectF & | inViewport | ) |
Definition at line 46 of file qssgrendercamera.cpp.
References CameraDirty, clearDirty(), computeCustomFrustum(), computeFrustumOrtho(), computeFrustumPerspective(), QMatrix4x4::data(), frustumScale, isDirty(), previousInViewport, projection, QVector2D::setX(), and QVector2D::setY().
Referenced by calculateGlobalVariables().
|
static |
Definition at line 101 of file qssgrendercamera.cpp.
References QMatrix4x4::column(), QSSGRenderNode::globalTransform, QMatrix4x4::inverted(), QVector4D::normalized(), projection, and Qt::Uninitialized.
Referenced by QSSGCameraHelpers::getViewProjectionMatrix().
void QSSGRenderCamera::calculateViewProjectionMatrix | ( | QMatrix4x4 & | outMatrix | ) | const |
Definition at line 160 of file qssgrendercamera.cpp.
References QMatrix4x4::column(), QSSGRenderNode::globalTransform, QMatrix4x4::inverted(), QVector4D::normalized(), projection, and Qt::Uninitialized.
void QSSGRenderCamera::calculateViewProjectionWithoutTranslation | ( | float | near, |
float | far, | ||
QMatrix4x4 & | outMatrix ) const |
Definition at line 170 of file qssgrendercamera.cpp.
References clipFar, clipNear, QMatrix4x4::column(), QSSGRenderNode::globalTransform, QVector4D::normalized(), projection, qFuzzyIsNull(), qWarning, and Qt::Uninitialized.
Definition at line 250 of file qssgrendercamera.cpp.
References cameraDirtyFlags, QSSGRenderNode::clearDirty(), and QSSGRenderNode::SubNodeDirty.
Referenced by calculateProjection().
bool QSSGRenderCamera::computeCustomFrustum | ( | const QRectF & | inViewport | ) |
Definition at line 93 of file qssgrendercamera.cpp.
References clipFar, clipNear, QMatrix4x4::frustum(), projection, Q_UNUSED, and QMatrix4x4::setToIdentity().
Referenced by calculateProjection().
bool QSSGRenderCamera::computeFrustumOrtho | ( | const QRectF & | inViewport | ) |
Compute the projection matrix for a orthographic camera
Definition at line 118 of file qssgrendercamera.cpp.
References clipFar, clipNear, dpr, horizontalMagnification, QMatrix4x4::ortho(), projection, and verticalMagnification.
Referenced by calculateProjection().
bool QSSGRenderCamera::computeFrustumPerspective | ( | const QRectF & | inViewport | ) |
Compute the projection matrix for a perspective camera
Definition at line 86 of file qssgrendercamera.cpp.
References clipFar, clipNear, QMatrix4x4::perspective(), projection, qRadiansToDegrees(), and verticalFov().
Referenced by calculateProjection().
float QSSGRenderCamera::getLevelOfDetailMultiplier | ( | ) | const |
Definition at line 286 of file qssgrendercamera.cpp.
References getViewportHalfExtents(), getZNear(), and projection.
QMatrix3x3 QSSGRenderCamera::getLookAtMatrix | ( | const QVector3D & | inUpDir, |
const QVector3D & | inDirection ) const |
float QSSGRenderCamera::getOrthographicScaleFactor | ( | const QRectF & | inViewport | ) | const |
Definition at line 127 of file qssgrendercamera.cpp.
References horizontalMagnification, Q_UNUSED, qMax(), and verticalMagnification.
Definition at line 113 of file qssgrendercamera_p.h.
References QSSGRenderNode::isDirty().
Referenced by calculateProjection().
void QSSGRenderCamera::lookAt | ( | const QVector3D & | inCameraPos, |
const QVector3D & | inUpDir, | ||
const QVector3D & | inTargetPos, | ||
const QVector3D & | pivot ) |
Definition at line 153 of file qssgrendercamera.cpp.
References QSSGRenderNode::calculateTransformMatrix(), QSSGRenderNode::getScalingCorrectDirection(), QSSGRenderNode::globalTransform, QSSGRenderNode::initScale, QSSGRenderNode::localTransform, QSSGRenderNode::markDirty(), QVector3D::normalized(), QSSGRenderNode::pivot, rotationQuaternionForLookAt(), and QSSGRenderNode::TransformDirty.
Definition at line 244 of file qssgrendercamera.cpp.
References cameraDirtyFlags, QSSGRenderNode::markDirty(), and QSSGRenderNode::SubNodeDirty.
Referenced by QSSGRenderCamera().
QSSGRenderRay QSSGRenderCamera::unproject | ( | const QVector2D & | inLayerRelativeMouseCoords, |
const QRectF & | inViewport ) const |
Definition at line 188 of file qssgrendercamera.cpp.
References QSSGRenderNode::calculateNormalMatrix(), frustumScale, QSSGRenderNode::globalTransform, QSSGUtils::rect::relativeToNormalizedCoordinates(), QSSGUtils::mat33::transform(), QSSGUtils::mat44::transform(), QVector2D::x(), and QVector2D::y().
QVector3D QSSGRenderCamera::unprojectToPosition | ( | const QVector3D & | inGlobalPos, |
const QSSGRenderRay & | inRay ) const |
Definition at line 225 of file qssgrendercamera.cpp.
References QVector3D::dotProduct(), QSSGRenderNode::getDirection(), and QSSGRenderRay::intersect().
float QSSGRenderCamera::verticalFov | ( | const QRectF & | inViewport | ) | const |
Definition at line 239 of file qssgrendercamera.cpp.
References verticalFov().
float QSSGRenderCamera::verticalFov | ( | float | aspectRatio | ) | const |
Definition at line 234 of file qssgrendercamera.cpp.
References fov, fovHorizontal, qAtan(), and qTan().
Referenced by computeFrustumPerspective(), and verticalFov().
float QSSGRenderCamera::bottom = 0.0f |
Definition at line 52 of file qssgrendercamera_p.h.
FlagT QSSGRenderCamera::cameraDirtyFlags = 0 |
Definition at line 66 of file qssgrendercamera_p.h.
Referenced by clearDirty(), and markDirty().
float QSSGRenderCamera::clipFar |
Definition at line 46 of file qssgrendercamera_p.h.
Referenced by calculateViewProjectionWithoutTranslation(), computeCustomFrustum(), computeFrustumOrtho(), and computeFrustumPerspective().
float QSSGRenderCamera::clipNear |
Definition at line 45 of file qssgrendercamera_p.h.
Referenced by calculateViewProjectionWithoutTranslation(), computeCustomFrustum(), computeFrustumOrtho(), and computeFrustumPerspective().
|
staticconstexpr |
Definition at line 42 of file qssgrendercamera_p.h.
float QSSGRenderCamera::dpr = 1.0f |
Definition at line 59 of file qssgrendercamera_p.h.
Referenced by computeFrustumOrtho().
bool QSSGRenderCamera::enableFrustumClipping |
Definition at line 65 of file qssgrendercamera_p.h.
float QSSGRenderCamera::fov |
Definition at line 48 of file qssgrendercamera_p.h.
Referenced by verticalFov().
bool QSSGRenderCamera::fovHorizontal |
Definition at line 49 of file qssgrendercamera_p.h.
Referenced by verticalFov().
QVector2D QSSGRenderCamera::frustumScale |
Definition at line 64 of file qssgrendercamera_p.h.
Referenced by calculateProjection(), and unproject().
float QSSGRenderCamera::horizontalMagnification = 1.0f |
Definition at line 56 of file qssgrendercamera_p.h.
Referenced by computeFrustumOrtho(), and getOrthographicScaleFactor().
float QSSGRenderCamera::left = 0.0f |
Definition at line 53 of file qssgrendercamera_p.h.
float QSSGRenderCamera::levelOfDetailPixelThreshold = 1.0 |
Definition at line 68 of file qssgrendercamera_p.h.
QRectF QSSGRenderCamera::previousInViewport |
Definition at line 70 of file qssgrendercamera_p.h.
Referenced by calculateProjection().
QMatrix4x4 QSSGRenderCamera::projection |
Definition at line 61 of file qssgrendercamera_p.h.
Referenced by calculateProjection(), calculateViewProjectionMatrix(), calculateViewProjectionMatrix(), calculateViewProjectionWithoutTranslation(), computeCustomFrustum(), computeFrustumOrtho(), computeFrustumPerspective(), and getLevelOfDetailMultiplier().
float QSSGRenderCamera::right = 0.0f |
Definition at line 54 of file qssgrendercamera_p.h.
float QSSGRenderCamera::top = 0.0f |
Definition at line 51 of file qssgrendercamera_p.h.
float QSSGRenderCamera::verticalMagnification = 1.0f |
Definition at line 57 of file qssgrendercamera_p.h.
Referenced by computeFrustumOrtho(), and getOrthographicScaleFactor().