new SkyPatchIterator()
A class for iterating shading data and sky subdivisions.
Members
-
:number
altCenter
-
The altitude angle at the center of the band.
Type
- number
-
:number
altStart
-
The altitude angle at the start of the band.
Type
- number
-
:number
altStop
-
The altitude angle at the end of the band.
Type
- number
-
:number
aziCenter
-
The azimuth angle at the center of the segment.
Type
- number
-
:number
aziStart
-
The azimuth angle at the start of the segment.
Type
- number
-
:number
aziStop
-
The azimuth angle at the end of the segment.
Type
- number
-
:number
bandAngle
-
The altitude angle of this altitude band, in degrees.
Type
- number
-
:number
bandIndex
-
The ordinal index of the current band.
Type
- number
-
:boolean
cancelled
-
Whether or not the iteration has been cancelled.
Type
- boolean
-
:number
cosZen
-
The cosine of the angle between segment and the sky zenith.
Type
- number
-
:boolean
jitter
-
Whether or not to slightly randomise patch center positions.
When true, the center angles and direction vectors of each sky patch are slightly offset pseudo-randomly from the actual center point to avoid issues where vertical and horizontal edges produce sudden jumps in value.
Type
- boolean
-
patchVector
-
Stores the normalised direction vector to the segment center as an [x,y,z] vector array.
-
:number
segmentAngle
-
The number of degrees per azimuth segment.
Type
- number
-
:number
segmentArea
-
The fractional area of the sky dome this segment represents.
Type
- number
-
:number
segmentCount
-
The number of azimuth segments in this band.
Type
- number
-
:number
segmentIndex
-
The ordinal index of the segment within this altitude band.
Type
- number
-
:number
shadingIndex
-
The ordinal index of the segment within the whole shading dome array.
Type
- number
Methods
-
next()
-
Iterate forward through the shading cells.
This method returns an object with the following properties.
Property Description shadingIndex The index of this segment in the corresponding shading mask data. segmentArea The relative fraction of the sky hemisphere this segment represents. segmentCount The number of horizontal segments in this altitude band. segmentAngle The horizontal angle represented by this segment, in decimal degrees. aziStart The horizontal azimuth angle of the very bottom of this segment, in decimal degrees. aziCenter The horizontal azimuth angle of the center of this segment, in decimal degrees. aziStop The horizontal azimuth angle at the vert top of this segment, in decimal degrees. altStart The vertical altitude angle of the very bottom of this segment, in decimal degrees. altCenter The vertical altitude angle of the center of this segment, in decimal degrees. altStop The vertical altitude angle at the vert top of this segment, in decimal degrees. cosZen The cosine of the angle of the centre of this band and the sky zenith. Returns:
Returns an iterator object or null if complete.
- Type
- object
-
prev()
-
Iterate backward through the shading cells.
This method returns an object with the following properties.
Property Description shadingIndex The index of this segment in the corresponding shading mask data. segmentArea The relative fraction of the sky hemisphere this segment represents. segmentCount The number of horizontal segments in this altitude band. segmentAngle The horizontal angle represented by this segment, in decimal degrees. aziStart The horizontal azimuth angle of the very bottom of this segment, in decimal degrees. aziCenter The horizontal azimuth angle of the center of this segment, in decimal degrees. aziStop The horizontal azimuth angle at the vert top of this segment, in decimal degrees. altStart The vertical altitude angle of the very bottom of this segment, in decimal degrees. altCenter The vertical altitude angle of the center of this segment, in decimal degrees. altStop The vertical altitude angle at the vert top of this segment, in decimal degrees. cosZen The cosine of the angle of the centre of this band and the sky zenith. Returns:
Returns an iterator object or null if complete.
- Type
- object
-
reset()
-
Resets the iterator to its indeterminate starting value.
Returns:
Returns this iterator object to support method chaining.
- Type
- object
-
set(band, segment)
-
Sets the current iterator position.
Parameters:
Name Type Description bandnumber The ordinal index of the current altitude band.
segmentnumber The ordinal index of the current azimuth segment.
Returns:
Returns this iterator object to support method chaining.
- Type
- object
-
setRayDirection(vector)
-
Calculates the direction vector for current patch.
Parameters:
Name Type Description vectorPD.Utils.VectorObject The vector to set.
Returns:
Returns the given vector.
- Type
- PD.Utils.VectorObject
-
setRayDirectionBySubSample(vector, samples, index)
-
Calculates the vector based on an NxN grid in current patch.
Parameters:
Name Type Description vectorPD.Utils.VectorObject The vector to set.
samplesnumber The number of samples (2, 3, 4 or 5).
indexnumber The index of the sample (0 to ((samples * samples) - 1)).
Returns:
Returns the given vector.
- Type
- PD.Utils.VectorObject