![]() |
Qt 6.x
The Qt SDK
|
#include <qssgrenderray_p.h>
Classes | |
struct | HitResult |
struct | IntersectionResult |
struct | RayData |
Public Member Functions | |
QSSGRenderRay ()=default | |
QSSGRenderRay (const QVector3D &inOrigin, const QVector3D &inDirection) | |
std::optional< QVector2D > | relative (const QMatrix4x4 &inGlobalTransform, const QSSGBounds3 &inBounds, QSSGRenderBasisPlanes inPlane) const |
std::optional< QVector2D > | relativeXY (const QMatrix4x4 &inGlobalTransform, const QSSGBounds3 &inBounds) const |
Static Public Member Functions | |
static std::optional< QVector3D > | intersect (const QSSGPlane &inPlane, const QSSGRenderRay &ray) |
static bool | triangleIntersect (const QSSGRenderRay &ray, const QVector3D &v0, const QVector3D &v1, const QVector3D &v2, float &u, float &v, QVector3D &normal) |
static RayData | createRayData (const QMatrix4x4 &globalTransform, const QSSGRenderRay &ray) |
static IntersectionResult | createIntersectionResult (const RayData &data, const HitResult &hit) |
static HitResult | intersectWithAABBv2 (const RayData &data, const QSSGBounds3 &bounds) |
static void | intersectWithBVH (const RayData &data, const QSSGMeshBVHNode *bvh, const QSSGRenderMesh *mesh, QVector< IntersectionResult > &intersections, int depth=0) |
static QVector< IntersectionResult > | intersectWithBVHTriangles (const RayData &data, const QVector< QSSGMeshBVHTriangle * > &bvhTriangles, int triangleOffset, int triangleCount) |
Public Attributes | |
QVector3D | origin |
QVector3D | direction |
Definition at line 39 of file qssgrenderray_p.h.
|
default |
Definition at line 44 of file qssgrenderray_p.h.
|
static |
Definition at line 53 of file qssgrenderray.cpp.
References QSSGRenderRay::HitResult::bounds, QSSGRenderRay::HitResult::intersects(), vec3::magnitudeSquared(), QSSGBounds3::maximum, QSSGRenderRay::HitResult::min, QSSGBounds3::minimum, Q_ASSERT, mat44::transform(), QVector3D::x(), and QVector3D::y().
Referenced by QSSGRenderer::intersectRayWithSubsetRenderable().
|
static |
Definition at line 28 of file qssgrenderray.cpp.
References QMatrix4x4::data(), dir, direction, i, QMatrix4x4::inverted(), QVector3D::normalized(), origin, qFuzzyIsNull(), mat44::rotate(), and mat44::transform().
Referenced by QSSGRenderer::intersectRayWithSubsetRenderable().
|
static |
Definition at line 18 of file qssgrenderray.cpp.
References QSSGPlane::d, direction, QVector3D::dotProduct(), QSSGPlane::n, and origin.
Referenced by relative(), and QSSGRenderCamera::unprojectToPosition().
|
static |
Definition at line 77 of file qssgrenderray.cpp.
References QSSGBounds3::maximum, QSSGBounds3::minimum, origin, tmax, tmin, and QSSGRenderRay::RayData::Zero.
Referenced by QSSGRenderer::intersectRayWithSubsetRenderable(), and intersectWithBVH().
|
static |
Definition at line 191 of file qssgrenderray.cpp.
References QList< T >::append(), QSSGMeshBVHNode::boundingData, QSSGRenderMesh::bvh, QSSGMeshBVHNode::count, intersectWithAABBv2(), intersectWithBVH(), intersectWithBVHTriangles(), QList< T >::isEmpty(), QSSGMeshBVHNode::left, QSSGMeshBVHNode::offset, results, QSSGMeshBVHNode::right, and QSSGMeshBVH::triangles.
Referenced by QSSGRenderer::intersectRayWithSubsetRenderable(), and intersectWithBVH().
|
static |
Definition at line 220 of file qssgrenderray.cpp.
References QList< T >::append(), i, vec3::magnitudeSquared(), Q_ASSERT, results, QList< T >::size(), mat44::transform(), and triangleIntersect().
Referenced by intersectWithBVH().
std::optional< QVector2D > QSSGRenderRay::relative | ( | const QMatrix4x4 & | inGlobalTransform, |
const QSSGBounds3 & | inBounds, | ||
QSSGRenderBasisPlanes | inPlane | ||
) | const |
Definition at line 272 of file qssgrenderray.cpp.
References QMatrix4x4::data(), direction, QVector3D::dotProduct(), intersect(), QMatrix4x4::inverted(), QSSGBounds3::maximum, QSSGBounds3::minimum, origin, mat44::rotate(), mat44::transform(), XY, XZ, and YZ.
|
inline |
Definition at line 132 of file qssgrenderray_p.h.
References XY.
|
static |
Definition at line 115 of file qssgrenderray.cpp.
References QVector3D::crossProduct(), direction, QVector3D::dotProduct(), epsilon, QVector3D::normalized(), origin, and v0.
Referenced by intersectWithBVHTriangles().
QVector3D QSSGRenderRay::direction |
Definition at line 42 of file qssgrenderray_p.h.
Referenced by createRayData(), intersect(), QSSGRenderer::intersectRayWithItem2D(), relative(), triangleIntersect(), and QSSGRenderCamera::unproject().
QVector3D QSSGRenderRay::origin |
Definition at line 41 of file qssgrenderray_p.h.
Referenced by createRayData(), intersect(), QSSGRenderer::intersectRayWithItem2D(), intersectWithAABBv2(), relative(), triangleIntersect(), and QSSGRenderCamera::unproject().