CollisionGrid2d Class

A fast geometry collission detection class. Note that the extents of the to-be-added obstacle geometry must be known in advance to use this structure.
Public Class CollisionGrid2d
This language is not supported or no code example is available.
public class CollisionGrid2d
This language is not supported or no code example is available.
public ref class CollisionGrid2d 
This language is not supported or no code example is available.
public class CollisionGrid2d
This language is not supported or no code example is available.
Name Description
Public constructor CollisionGrid2d(Extents2d, int) Create an acceleration grid given an estimation of the number of adds to be performed. If size ~= the square root of the estimation, the number of rows and columns is distributed according to the aspect ratio of the grid extents, using the value of 'size' (multiplied by a magic number).
Public constructor CollisionGrid2d(Extents2d, int, int) Create an acceleration grid with specified number of rows and columns.
Top
Name Description
Public property AddedPolys The polys added so far.
Public property PolyCount The number of successfully added polygons. Note that empty polygons are ignored, but single-point-polygons are added.
Top
Methods
 
Name Description
Public method Add(Poly2d) Add a reference to a poly to the grid. The poly may be open or closed, or a single point. Empty polys are ignored. Open polys are treated as thin walls. Closed CCW polys are treated as obstacles (filled contours). Closed CW polys are treated as holes. Note: modifying the added poly results in undefined behaviour! That is: to maximize performance, polys are NOT copied!
Public method Static FromPolys(IEnumerable<Poly2d>) Skapar en CollisionGrid2d utifrån givna polysar. Notera att polysarna tolkas som "solider" om de är CCW, och hål om de är CW! Även öppna polys stöds. Men indata får ju vara lite snygg annars går det inte!
Public method Overlaps(Poly2d) Determines whether a given test poly overlaps any of the so-far added polys. Add() and Overlaps() calls may be interleaved. Overlaps() assumes that a) the test poly is CCW if it is closed b) the added hole polys lie inside contour polys.
Top
Fields
 
Name Description
Public field Static DrawArc
Public field Static DrawPoint
Top
IGS.Genamo.CollisionGrid2d

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

In this article

Definition