Nez.Portable/Physics/SpatialHash.cs
/// <summary>
/// gets the cell at the world-space x,y value. If the cell is empty and createCellIfEmpty is true a new cell will be created.
/// </summary>
/// <returns>The at position.</returns>
/// <param name="x">The x coordinate.</param>
/// <param name="y">The y coordinate.</param>
/// <param name="createCellIfEmpty">If set to <c>true</c> create cell if empty.</param>
gets the cell at the world-space x,y value. If the cell is empty and createCellIfEmpty is true a new cell will be created.
gets the cell at the world - space x y value . If the cell is empty and createCellIfEmpty is true a new cell will be created .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        List<Collider> cellAtPosition(int x, int y, bool createCellIfEmpty = false)
        {
            List<Collider> cell = null;
            if (!_cellDict.tryGetValue(x, y, out cell))
            {
                if (createCellIfEmpty)
                {
                    cell = new List<Collider>();
                    _cellDict.add(x, y, cell);
                }
            }
            return cell;
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] List < Collider > cellAtPosition ( int x , int y , bool createCellIfEmpty = false ) { List < Collider > cell = null ; if ( ! _cellDict . tryGetValue ( x , y , out cell ) ) { if ( createCellIfEmpty ) { cell = new List < Collider > ( ) ; _cellDict . add ( x , y , cell ) ; } } return cell ; }
gets the cell at the world-space x,y value.
gets the cell at the world - space x y value .
The at position.
The at position .
x
int
The x coordinate.
The x coordinate .
y
int
The y coordinate.
The y coordinate .
createCellIfEmpty
bool
If set to true
If set to true