vrdRayIntersection

class vrdRayIntersection

(Inherits vrdData)

Represents an intersection of an ray with a node in the scene.

Functions

vrdRayIntersection.getNode()

Gets that node that has been hit.

Returns:The node that has been hit.
Return type:vrdNode
vrdRayIntersection.getNormal()

The hit normal.

Returns:The hit normal. This is 0, 0, 0 if no hit occured.
Return type:QVector3D
vrdRayIntersection.getOrigin()

Gets the origin of the ray that has used for the intersection test.

Returns:The origin of the ray.
Return type:QVector3D
vrdRayIntersection.getPoint()

Gets the point that has been hit.

Returns:The point that has been hit. This is 0, 0, 0 if no hit occured.
Return type:QVector3D
vrdRayIntersection.getUV()

Gets the uv coordinates of the texture where the hit occured.

Returns:The uv coordinates.
Return type:QVector2D
vrdRayIntersection.hasHit()

Returns if an actual hit occured.

Returns:true if a hit occured, false otherwise.
Return type:bool
vrdRayIntersection.setHit(value)

Sets if a hit occured.

Parameters:value (bool) – true if a hit occured, false otherwise.
vrdRayIntersection.setNode(value)

Sets the node that has been hit.

Parameters:value (vrdNode) – The node that has been hit. This is invalid, when not hit occured.
vrdRayIntersection.setNormal(value)

Sets the hit normal.

Parameters:value (QVector3D) – The hit normal.
vrdRayIntersection.setOrigin(value)

Sets the origin of the ray that has been used for the intersection test.

Parameters:value (QVector3D) – The origin of the ray.
vrdRayIntersection.setPoint(value)

Sets the point that has been hit.

Parameters:value (QVector3D) – The point that has been hit.
vrdRayIntersection.setUV(value)

Sets the uv coordinates of the texture where the hit occured.

Parameters:value (QVector2D) – The uv coordinates.
vrdRayIntersection.vrdRayIntersection()

Default constructor.

vrdRayIntersection.vrdRayIntersection(hasHit, node, origin, point, normal=QVector3D(1, 0, 0), uv=QVector2D(0, 0))

Constructor.

Parameters:
  • hasHit (bool) – Set to true, if a hit occured
  • node (vrdNode) – The node that has been hit by the ray.
  • origin (QVector3D) – The origin of the ray.
  • point (QVector3D) – The actual point that has been hit by the ray.
  • normal (QVector3D) – The hit normal.
  • uv (QVector2D) – The uv coordinates of the texture where the hit occured.