Qt 6.x
The Qt SDK
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 QVector< 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 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().

+ 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 QMatrix4x4::data(), dir, direction, i, QMatrix4x4::inverted(), QVector3D::normalized(), origin, qFuzzyIsNull(), mat44::rotate(), and mat44::transform().

Referenced by QSSGRenderer::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 QSSGPlane::d, direction, QVector3D::dotProduct(), QSSGPlane::n, 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 QSSGRenderer::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 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().

+ 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 QVector< QSSGMeshBVHTriangle * > &  bvhTriangles,
int  triangleOffset,
int  triangleCount 
)
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().

+ 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 QMatrix4x4::data(), direction, QVector3D::dotProduct(), intersect(), QMatrix4x4::inverted(), QSSGBounds3::maximum, QSSGBounds3::minimum, origin, mat44::rotate(), 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, QVector3D::normalized(), 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

◆ origin


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