Navigation: Scripting Reference Manual > Functions & Subroutines > InitGetNextRay

 

InitGetNextRay

 

Contact Us: fredsupport@photonengr.com

 

Description

Initializes index value such that a subsequent call to GetNextRay() retrieves ray data for the first live ray in the ray buffer.  This provides an alternate method to using GetFirstRay() although GetFirstRay() is preferred due to it's ability to detect when the ray buffer is empty.

 

Syntax

InitGetNextRay( id )

 

Parameters

 

id As Long (or Huge_)

Returns index number required for initialization.  After execution, this variable contains the index number before that of the first ray that in the buffer. E.g. if the first live ray is index = 0 then this function returns id = -1.

 

Example

The example below shows using this command in an alternative approach to the standard ray buffer looping construction.

 

Dim success As Boolean

Dim i As Long

Dim tRay as T_RAY

 

InitGetNextRay(i)

           While GetNextRay(i, ray)

 

                     Print i           'do something here

 

          Wend

 

See Also

GetFirstRay

GetPreviousRay

GetLastRay

GetNextRay

GetRay

SetRay

SetRayActive

Multi-Threaded Raytrace

 

 

 

 

 

 

Copyright © Photon Engineering, LLC