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>.
Loading...
Searching...
No Matches
QSSGRenderRay Struct Reference

#include <qssgrenderray_p.h>

+ Collaboration diagram for QSSGRenderRay:

Classes

struct  HitResult
 
struct  IntersectionResult
 
struct  RayData
 

Public Member Functions

 QSSGRenderRay ()=default
 
 QSSGRenderRay (const QVector3D &inOrigin, const QVector3D &inDirection)
 
std::optional< QVector2Drelative (const QMatrix4x4 &inGlobalTransform, const QSSGBounds3 &inBounds, QSSGRenderBasisPlanes inPlane) const
 
std::optional< QVector2DrelativeXY (const QMatrix4x4 &inGlobalTransform, const QSSGBounds3 &inBounds) const
 

Static Public Member Functions

static std::optional< QVector3Dintersect (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< IntersectionResultintersectWithBVHTriangles (const RayData &data, const std::vector< QSSGMeshBVHTriangle > &bvhTriangles, int triangleOffset, int triangleCount)
 

Public Attributes

QVector3D origin
 
QVector3D direction
 

Detailed Description

Definition at line 39 of file qssgrenderray_p.h.

Constructor & Destructor Documentation

◆ QSSGRenderRay() [1/2]

QSSGRenderRay::QSSGRenderRay ( )
default

◆ QSSGRenderRay() [2/2]

QSSGRenderRay::QSSGRenderRay ( const QVector3D & inOrigin,
const QVector3D & inDirection )
inline

Definition at line 44 of file qssgrenderray_p.h.

Member Function Documentation

◆ createIntersectionResult()

QSSGRenderRay::IntersectionResult QSSGRenderRay::createIntersectionResult ( const RayData & data,
const HitResult & hit )
static

Definition at line 53 of file qssgrenderray.cpp.

References QSSGUtils::vec3::magnitudeSquared(), QSSGBounds3::maximum, QSSGBounds3::minimum, Q_ASSERT, QSSGUtils::mat44::transform(), QVector3D::x(), and QVector3D::y().

Referenced by QSSGRendererPrivate::intersectRayWithSubsetRenderable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createRayData()

QSSGRenderRay::RayData QSSGRenderRay::createRayData ( const QMatrix4x4 & globalTransform,
const QSSGRenderRay & ray )
static

Definition at line 28 of file qssgrenderray.cpp.

References dir, direction, i, QMatrix4x4::inverted(), QVector3D::normalized(), origin, qFuzzyIsNull(), QSSGUtils::mat44::rotate(), and QSSGUtils::mat44::transform().

Referenced by QSSGRendererPrivate::intersectRayWithSubsetRenderable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersect()

QT_BEGIN_NAMESPACE std::optional< QVector3D > QSSGRenderRay::intersect ( const QSSGPlane & inPlane,
const QSSGRenderRay & ray )
static

Definition at line 18 of file qssgrenderray.cpp.

References direction, QVector3D::dotProduct(), and origin.

Referenced by relative(), and QSSGRenderCamera::unprojectToPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersectWithAABBv2()

QSSGRenderRay::HitResult QSSGRenderRay::intersectWithAABBv2 ( const RayData & data,
const QSSGBounds3 & bounds )
static

Definition at line 77 of file qssgrenderray.cpp.

References QSSGBounds3::maximum, QSSGBounds3::minimum, origin, tmax, tmin, and QSSGRenderRay::RayData::Zero.

Referenced by QSSGRendererPrivate::intersectRayWithSubsetRenderable(), and intersectWithBVH().

+ Here is the caller graph for this function:

◆ intersectWithBVH()

void QSSGRenderRay::intersectWithBVH ( const RayData & data,
const QSSGMeshBVHNode * bvh,
const QSSGRenderMesh * mesh,
QVector< IntersectionResult > & intersections,
int depth = 0 )
static

Definition at line 191 of file qssgrenderray.cpp.

References QSSGMeshBVHNode::boundingData, QSSGRenderMesh::bvh, QSSGMeshBVHNode::count, intersectWithAABBv2(), intersectWithBVH(), intersectWithBVHTriangles(), QList< T >::isEmpty(), QSSGMeshBVHNode::left, QSSGMeshBVHNode::offset, results, and QSSGMeshBVHNode::right.

Referenced by intersectWithBVH().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersectWithBVHTriangles()

QVector< QSSGRenderRay::IntersectionResult > QSSGRenderRay::intersectWithBVHTriangles ( const RayData & data,
const std::vector< QSSGMeshBVHTriangle > & bvhTriangles,
int triangleOffset,
int triangleCount )
static

Definition at line 220 of file qssgrenderray.cpp.

References QList< T >::append(), i, QSSGUtils::vec3::magnitudeSquared(), Q_ASSERT, results, QSSGUtils::mat44::transform(), and triangleIntersect().

Referenced by intersectWithBVH().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ relative()

std::optional< QVector2D > QSSGRenderRay::relative ( const QMatrix4x4 & inGlobalTransform,
const QSSGBounds3 & inBounds,
QSSGRenderBasisPlanes inPlane ) const

Definition at line 272 of file qssgrenderray.cpp.

References direction, QVector3D::dotProduct(), intersect(), QMatrix4x4::inverted(), origin, QSSGUtils::mat44::rotate(), QSSGUtils::mat44::transform(), XY, XZ, and YZ.

+ Here is the call graph for this function:

◆ relativeXY()

std::optional< QVector2D > QSSGRenderRay::relativeXY ( const QMatrix4x4 & inGlobalTransform,
const QSSGBounds3 & inBounds ) const
inline

Definition at line 132 of file qssgrenderray_p.h.

References XY.

◆ triangleIntersect()

bool QSSGRenderRay::triangleIntersect ( const QSSGRenderRay & ray,
const QVector3D & v0,
const QVector3D & v1,
const QVector3D & v2,
float & u,
float & v,
QVector3D & normal )
static

Definition at line 115 of file qssgrenderray.cpp.

References QVector3D::crossProduct(), direction, QVector3D::dotProduct(), epsilon, origin, and v0.

Referenced by intersectWithBVHTriangles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ direction

QVector3D QSSGRenderRay::direction

Definition at line 42 of file qssgrenderray_p.h.

Referenced by createRayData(), intersect(), relative(), and triangleIntersect().

◆ origin

QVector3D QSSGRenderRay::origin

The documentation for this struct was generated from the following files: