RaycasterBuckets

public sealed class RaycasterBuckets
Raycasting speed-up for quickly rejecting the bulk of objects.

Constructors

RaycasterBuckets

#
public RaycasterBuckets(int width, int height, int size, ShapeShaderPair[] shapes)
Create a new blank bucket grid.
width (int)Minimum width (in pixels) this grid must cover.
height (int)Minimum height (in pixels) this grid must cover.
size (int)Desired size for each bucket.
shapes (ShapeShaderPair[])shape collection to bucket.

Properties

Buckets

#
public IEnumerable<Bucket> Buckets { get; }
Enumerate over all buckets.

Size

#
public int Size { get; }
Gets the size of each bucket.

X0

#
public int X0 { get; }
Gets the minimum x coordinate still covered by the grid.

X1

#
public int X1 { get; }
Gets the maximum x coordinate still covered by the grid.

XCount

#
public int XCount { get; }
Gets the number of buckets along the X direction.

Y0

#
public int Y0 { get; }
Gets the minimum y coordinate still covered by the grid.

Y1

#
public int Y1 { get; }
Gets the maximum y coordinate still covered by the grid.

YCount

#
public int YCount { get; }
Gets the number of buckets along the Y direction.

Methods

BucketAt

#
public Bucket BucketAt(double x, double y)
Gets the bucket, if any, at the given location.
x (double)X coordinate.
y (double)Y coordinate.
Bucket at (x,y).