Method | Description | |
---|---|---|
AddCollisionUnit ( |
Add a new CollisionUnit to the CollisionChief.
|
|
DrawCollisionGrid ( |
Helper function for debugging. Draws the collision units in the location of a collision cell on the collision grid.
|
|
GetInstance ( ) : |
Get the CollisionChief singleton.
|
|
Initialize ( Vector2 worldSize, Vector2 cellSize ) : void |
Initialize the CollisionChief.
|
|
RemoveCollisionUnit ( |
Remove a CollisionUnit from the CollisionChief.
|
|
RotateCollisionUnit ( |
Rotate a CollisionUnit by the given amount.
|
|
ScaleCollisionUnit ( |
Scale a CollisionUnit by the given amount.
|
|
TranslateCollisionUnit ( |
Translate a CollisionUnit by the given amount.
|
|
Update ( ) : void |
Update the CollisionChief.
|
|
UpdateUnit ( |
Add a specific CollisionUnit to a queue of units to update.
|
Method | Description | |
---|---|---|
CalculateCellPosition ( Vector2 position ) : Point | ||
CalculateCircleBottomRightCell ( Vector2 circleCenter, int circleRadius ) : Point | ||
CalculateCircleTopLeftCell ( Vector2 circleCenter, int circleRadius ) : Point | ||
CollisionChief ( ) : System | ||
NotifyEntities ( List |
||
UpdateCollisions ( List |
public AddCollisionUnit ( |
||
unit | The CollisionUnit to add to the CollisionChief. | |
return | void |
public DrawCollisionGrid ( |
||
spriteBatch | The SpriteBatch used to draw the grid. | |
gridTexture | Microsoft.Xna.Framework.Graphics.Texture2D | A texture representing one cell in the collision grid. |
return | void |
public static GetInstance ( ) : |
||
return |
public Initialize ( Vector2 worldSize, Vector2 cellSize ) : void | ||
worldSize | Vector2 | The size, in pixels, of the map. This defines the size of the collision grid. |
cellSize | Vector2 | The size, in pixels, of a single cell in the collision grid. |
return | void |
public RemoveCollisionUnit ( |
||
unit | The CollisionUnit to remove. | |
return | void |
public RotateCollisionUnit ( |
||
unit | The CollisionUnit to rotate. | |
rotation | float | The delta rotation to perform on the CollisionUnit (in radians). |
return | void |
public ScaleCollisionUnit ( |
||
unit | The CollisionUnit to scale. | |
scale | Vector2 | The delta scale to perform on the CollisionUnit. |
return | void |
public TranslateCollisionUnit ( |
||
unit | The CollisionUnit to translate. | |
translation | Vector2 | The delta translation to perform on the CollisionUnit. |
return | void |
public UpdateUnit ( |
||
unit | The CollisionUnit to get updated. | |
return | void |