HPB (Heading, Pitch and Bank) are rotations. Translated to ray direction vector (dx,dy,dz).
No need to have ray-origin to have ray-direction.
Raytracer is backward ray-tracer.
i.e. it does not cast ray from light source toward object,
it does it reverse, i.e. from surface which spot renderer is evaluating (Spot Info > World Position, in LW 2018+ Input > World Position), there is casted ray in -dx,-dy,-dz (which is reverse light sample direction from Light plugin class).
In lights which have limits like point light, any ray-lengths further than Distance(SpotInfo>WorldPosition,LightItem>WorldPosition) are discarded.
Falloff is calculated later (multiplication of light sample color multiplied by scalar etc).
Anyway, you have it on your disk
LWSDK/html/classes/light.html
You can read.. or not..
Code:
num = sample( instance, memory, ray, p, maxSamples, samples[], lightsamples[] )
Given a position p in space, compute light samples.
typedef struct st_LWLightSample {
LWDVector direction;
LWDVector color;
double distance;
double pdf;
} LWLightSample;
The light plugin fills in the samples information in the lightsamples array. Up to maxSamples samples can be stored in the array. This number is related to the maxilluminations value set by newFrame().
direction
The direction of the sample in world coordinates. It must be normalized.
color
The color of the sample.
distance
The distance between the spot being illuminated, and the light sample. A value of DBL_MAX indicates the source is infinitely far away, such as for Distant lights and other 'infinite' lights.
pdf
The probability distribution function of the sample.