内容表

上一话题

Qt3DRender.QRayCaster

下一话题

Qt3DRender.QRenderAspect

Qt3DRender.QRayCasterHit

Details of a hit when casting a ray through a model. 更多

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QRayCasterHit

New in version 5.11.

详细描述

QRayCasterHit contains the details of a successful hit when casting a ray through a model using a QRayCaster or QScreenRayCaster 组件。

另请参阅

QRayCaster QScreenRayCaster QPickingSettings

class PySide2.Qt3DRender.Qt3DRender. QRayCasterHit

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit(type, id, distance, localIntersect, worldIntersect, primitiveIndex, v1, v2, v3)

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit(other)

参数
  • type HitType

  • v1 uint

  • v2 uint

  • v3 uint

  • primitiveIndex uint

  • id QNodeId

  • distance float

  • other QRayCasterHit

  • localIntersect QVector3D

  • worldIntersect QVector3D

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. HitType

Specifies type of hit that was returned. This is controlled using QPickingSettings .

常量

描述

Qt3DRender.QRayCasterHit.TriangleHit

The picked primitive was a triangle and the vertex indices refer to the three points making up the triangle

Qt3DRender.QRayCasterHit.LineHit

The picked primitive was a line segment, and the first two vertices refer to the two points making up the line

Qt3DRender.QRayCasterHit.PointHit

The picked primitive was a single point; all 3 vertex indices will be undefined

Qt3DRender.QRayCasterHit.EntityHit

Only the bounding volume was considered; the primitive and vertex indices will be undefined

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. distance ( )
返回类型

float

Returns the distance between the origin of the ray and the intersection point

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. entity ( )
返回类型

QEntity

Returns a pointer to the entity that was hit

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. entityId ( )
返回类型

QNodeId

Returns the id of the entity that was hit

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. localIntersection ( )
返回类型

QVector3D

Returns the coordinates of the intersection point in the entity’s coordinate system

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. primitiveIndex ( )
返回类型

uint

Returns the index of the picked primitive

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. type ( )
返回类型

HitType

Returns the type of the hit

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. vertex1Index ( )
返回类型

uint

Returns the index of the first vertex of the picked primitive

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. vertex2Index ( )
返回类型

uint

Returns the index of the second vertex of the picked primitive

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. vertex3Index ( )
返回类型

uint

Returns the index of the third vertex of the picked primitive

PySide2.Qt3DRender.Qt3DRender.QRayCasterHit. worldIntersection ( )
返回类型

QVector3D

Returns the coordinates of the intersection point in the model’s coordinate system