Navigation: Scripting Reference Manual > Functions & Subroutines > GetPreviousRay

 

GetPreviousRay

 

Contact Us: fredsupport@photonengr.com

 

Description

Retrieves ray data for the previous "Live" ray.  Generally used after GetLastRay or GetLastFilteredRay.  Note that when used after GetLastFilteredRay the same filter that was applied to getting the last ray will apply to all previous rays until reset by calling the (unfiltered) GetFirstRay or GetLastRay command.

 

Depending on the number of rays traced, it may be necessary to dimension ray index and ray counter variables as data type Huge_ instead of Long.  Please see Multi-threaded Raytracing for more information.

 

Syntax

success = GetPreviousRay( id, tr )

 

Parameters

success (Boolean)

Returns True is successful and False if a problem is encountered.

 

id As Long (or Huge_)

Index into the ray buffer for the last ray that was retrieved prior to calling this function.  After execution, this variable contains the index into the ray buffer for the most recently retrieved ray.

 

tr As T_RAY

Structure to be loaded with ray data.

 

Example

The example below shows the standard ray buffer reverse looping construction.

 

Dim success As Boolean

Dim curRay As Long

Dim tRay as T_RAY

 

success = GetLastRay( curRay, tRay )

While success

          'Do something with tRay structure here...

          success = GetPreviousRay( curRay, tRay )

Wend

 

See Also

GetFirstRay

GetNextRay

Get LastRay

GetRay

SetRay

SetRayActive

Multi-Threaded Raytrace

 

 

 

 

 

 

Copyright © Photon Engineering, LLC