Свойство | Тип | Описание | |
---|---|---|---|
gridBounds |
Метод | Описание | |
---|---|---|
SpatialHash ( int cellSize = 100 ) : System | ||
aabbBroadphase ( RectangleF &bounds, Collider excludeCollider, int layerMask ) : HashSet |
returns all objects in cells that the bounding box intersects
|
|
clear ( ) : void | ||
debugDraw ( float secondsToDisplay, float textScale = 1f ) : void |
debug draws the contents of the spatial hash. Note that Core.debugRenderEnabled must be true or nothing will be displayed.
|
|
debugDrawCellDetails ( int x, int y, int cellCount, float secondsToDisplay = 0.5f, float textScale = 1f ) : void | ||
getAllObjects ( ) : HashSet |
returns all the Colliders in the SpatialHash
|
|
linecast ( Vector2 start, Vector2 end, RaycastHit hits, int layerMask ) : int |
casts a line through the spatial hash and fills the hits array up with any colliders that the line hits
|
|
overlapCircle ( Vector2 circleCenter, float radius, Collider results, int layerMask ) : int |
gets all the colliders that fall within the specified circle
|
|
overlapRectangle ( RectangleF &rect, Collider results, int layerMask ) : int |
gets all the colliders that fall within the specified rect
|
|
register ( Collider collider ) : void |
adds the object to the SpatialHash
|
|
remove ( Collider collider ) : void |
removes the object from the SpatialHash
|
|
removeWithBruteForce ( Collider obj ) : void |
removes the object from the SpatialHash using a brute force approach
|
Метод | Описание | |
---|---|---|
cellAtPosition ( int x, int y, bool createCellIfEmpty = false ) : List |
||
cellCoords ( float x, float y ) : Point | ||
cellCoords ( int x, int y ) : Point |
public SpatialHash ( int cellSize = 100 ) : System | ||
cellSize | int | |
Результат | System |
public aabbBroadphase ( RectangleF &bounds, Collider excludeCollider, int layerMask ) : HashSet |
||
bounds | RectangleF | Bounds. |
excludeCollider | Collider | |
layerMask | int | Layer mask. |
Результат | HashSet |
public debugDraw ( float secondsToDisplay, float textScale = 1f ) : void | ||
secondsToDisplay | float | Seconds to display. |
textScale | float | Text scale. |
Результат | void |
public debugDrawCellDetails ( int x, int y, int cellCount, float secondsToDisplay = 0.5f, float textScale = 1f ) : void | ||
x | int | |
y | int | |
cellCount | int | |
secondsToDisplay | float | |
textScale | float | |
Результат | void |
public linecast ( Vector2 start, Vector2 end, RaycastHit hits, int layerMask ) : int | ||
start | Vector2 | Start. |
end | Vector2 | End. |
hits | RaycastHit | Hits. |
layerMask | int | Layer mask. |
Результат | int |
public overlapCircle ( Vector2 circleCenter, float radius, Collider results, int layerMask ) : int | ||
circleCenter | Vector2 | Circle center. |
radius | float | Radius. |
results | Collider | Results. |
layerMask | int | Layer mask. |
Результат | int |
public overlapRectangle ( RectangleF &rect, Collider results, int layerMask ) : int | ||
rect | RectangleF | Rect. |
results | Collider | Results. |
layerMask | int | Layer mask. |
Результат | int |
public register ( Collider collider ) : void | ||
collider | Collider | Object. |
Результат | void |
public remove ( Collider collider ) : void | ||
collider | Collider | Collider. |
Результат | void |
public removeWithBruteForce ( Collider obj ) : void | ||
obj | Collider | Object. |
Результат | void |