Constructors
Raycaster
#public Raycaster(int width, int height, ColourShader background, IEnumerable<ShapeShaderPair> objects)
Create a new raycaster.
Parameters:
| width (int) | Target image width. |
| height (int) | Target image height. |
| background (ColourShader) | Background shader. If null, a transparent background will be used. |
| objects (IEnumerable<ShapeShaderPair>) | Ordered collection of objects. |
Raycaster
#Create a new raycaster with a transparent background.
Parameters:
| width (int) | Target image width. |
| height (int) | Target image height. |
| objects (IEnumerable<ShapeShaderPair>) | Ordered collection of objects. |
Fields
Properties
Background
#Gets the background shader. This shader may be null, in which case a fully transparent background is implied.
CurrentSamplingLevel
#Gets the current sampling level. Not all pixels are necessarily being sampled at this level though, only at least one of them is. Negative sampling levels indicate a coarse sampling, every (-N)th pixels.
Indexers
Methods
ComputeImage
#Start a new raycasting process.
Parameters:
| settings (RaycasterSettings) | Settings. |
| token (CancellationToken) | Cancellation token. |
ComputeImageAsync
#Start the image computation asynchronously.
Parameters:
| settings (RaycasterSettings) | Settings. |
| token (CancellationToken) | Cancellation token. |
ContinueAndSample
#Continue an existing ray.
Parameters:
| ray (Ray) | Ray to continue. |
Returns: Colour at continued ray location.
Implements: ContinueAndSample
ContinueImage
#Continue a finished raycasting process. This method cannot be called while a process is already running.
Parameters:
| settings (RaycasterSettings) | Settings to use. |
| token (CancellationToken) | Cancellation token. |
ContinueImageAsync
#Continue a finished raycasting process asynchronously. This method cannot be called while a process is already running.
Parameters:
| settings (RaycasterSettings) | Settings to use. |
| token (CancellationToken) | Cancellation token. |
FirstObjectAbove
#Find the index of the first object at the (u,v) location at or above the given layer index.
Parameters:
| x (double) | U coordinate. |
| y (double) | V coordinate. |
| startAt (int) | Start layer. Objects on this layer are taken into account. |
Returns: The index of the first object coincident with (u,v) at or above the start layer. Or, if no object was found, -1.
Implements: FirstObjectAbove
FirstObjectBelow
#Find the index of the first object at the (u,v) location at or below the given layer index.
Parameters:
| x (double) | U coordinate. |
| y (double) | V coordinate. |
| startAt (int) | Start layer. Objects on this layer are taken into account. |
Returns: The index of the first object coincident with (u,v) at or below the start layer. Or, if no object was found, -1.
Implements: FirstObjectBelow
ResurrectAllPixels
#Move all dead pixels back onto the alive list.
ToBitmap
#public void ToBitmap(Bitmap bitmap)
Blit this raycaster into an existing bitmap. The bitmap will be locked for this procedure.
Parameters:
| bitmap (Bitmap) | Lockable bitmap with the correct dimensions. |
ToBucketMap
#public Bitmap ToBucketMap()
Create a bitmap showing the bucket occupancy.
Returns: Bucket map.
ToCompletionMap
#Blit the raycaster live-pixel data into an existing bitmap. The bitmap will be locked for this procedure.