Method | Description | |
---|---|---|
AddCollision ( |
Add a collision to with another unit.
|
|
ClearCheckedUnits ( ) : void |
Clear the list of checked units.
|
|
ClearCollisions ( ) : void |
Clear any collisions, whether they occured or not.
|
|
CollidesWith ( |
Determine if this CollisionUnit collides with another.
|
|
CollisionUnit ( System.Entity owner, Vector2 location, Microsoft.Xna.Framework.Graphics.Texture2D collisionMask, bool bUsePixelCollision ) : System |
Instantiate a new CollisionUnit. This constructor is for circle based collisions.
|
|
CollisionUnit ( System.Entity owner, Vector2 point1, Vector2 point2, CollisionType collisionType, Microsoft.Xna.Framework.Graphics.Texture2D collisionMask, bool bUsePixelCollision ) : System |
Instantiate a new CollisionUnit. This constructor is for line and box based collisions.
|
|
CollisionUnit ( System.Entity owner, Vector2 center, int radius, Microsoft.Xna.Framework.Graphics.Texture2D collisionMask, bool bUsePixelCollision ) : System |
Instantiate a new CollisionUnit. This constructor is for circle based collisions.
|
|
CollisionsChanged ( int timeStamp ) : bool |
Get if collisions changed since the last time checked.
|
|
CollisionsChanged ( bool bChanged ) : void |
Set if collisions changed on this unit.
|
|
GetCheckTimeStamp ( ) : int |
Get the last time that the collision unit was checked.
|
|
GetCheckedUnits ( ) : List |
Get the last CollisionUnits that this collision unit was checked with.
|
|
GetCircleCenter ( ) : Vector2 |
For circle based collisions, get the circle center.
|
|
GetCircleRadius ( ) : int |
For circle based collisions, get the circle radius.
|
|
GetCollisionPoint ( |
Get the point of collision with the other CollisionUnit. This does not do any real collision checks so the returned value might not be the actual collision point.
|
|
GetCollisionType ( ) : CollisionType |
Get the CollisionUnit type.
|
|
GetCollisions ( ) : List |
Get a list of all collisions.
|
|
GetFullCheckTimeStamp ( ) : int |
Get the last time the collision unit was updated.
|
|
GetHeight ( ) : int |
For box based collisions, get the height of the box. For circle based collisions, get the circle diameter.
|
|
GetLastCheckedBy ( ) : |
Get the last collision unit that was checked with this collision unit.
|
|
GetLineEnd ( ) : Vector2 |
For line based collisions, get the line end.
|
|
GetLineStart ( ) : Vector2 |
For line based collisions, get the line start.
|
|
GetLowerRight ( ) : Vector2 |
For box based collisions, get the lower-right corner of the box. For circle based collisions, get the lower-right bound of the circle.
|
|
GetOwner ( ) : System.Entity |
Get the "owner" Entity of this CollisionUnit.
|
|
GetUpperLeft ( ) : Vector2 |
For box based collisions, get the upper-left corner of the box. For circle based collisions, get the upper-left bound of the circle.
|
|
GetWidth ( ) : int |
For box based collisions, get the width of the box. For circle based collisions, get the circle diameter.
|
|
HasCollisions ( ) : bool |
Get if the CollisionUnit has collisions.
|
|
IsSolid ( ) : bool |
Get if the collision unit is solid.
|
|
NeedsCollisionUpdate ( ) : bool |
Get if the CollisionUnit needs to be updated.
|
|
NeedsCollisionUpdate ( bool needsUpdate ) : void |
Set if the CollisionUnit needs to be updated.
|
|
RemoveCollision ( |
Remove a collision with another unit.
|
|
Rotate ( float rotation ) : void |
Rotate the CollisionUnit a specified amount.
|
|
Scale ( Vector2 scale ) : void |
Scale the CollisionUnit a specified amount.
|
|
SetCheckTimeStamp ( int timeStamp ) : void |
Set the last time the collision unit was checked.
|
|
SetFullCheckTimeStamp ( int timeStamp ) : void |
Set the last time the collision unit was updated.
|
|
SetLastCheckedBy ( |
Set the last collision unit to be checked with this collision unit.
|
|
SetSolid ( bool blockOthers ) : void |
Set if the collision unit is solid.
|
|
Translate ( Vector2 translation ) : void |
Translate the CollisionUnit a specified amount.
|
|
UpdateCollisionsWith ( |
Update the collision status between this and the other CollisionUnit.
|
|
UsesPixelCollision ( ) : bool |
Get is pixel-perfect collisions are enabled.
|
Method | Description | |
---|---|---|
CalculateCircle ( Vector2 location ) : void | ||
CircleBoxCollision ( Vector2 circleCenter, int circleRadius, Vector2 boxUpperLeft, Vector2 boxLowerRight ) : bool | ||
InitializeCommonStuff ( System.Entity owner, Microsoft.Xna.Framework.Graphics.Texture2D collisionMask, bool bUsePixelCollision ) : void |
public AddCollision ( |
||
other | The CollisionUnit that was collided with. | |
return | void |
public CollidesWith ( |
||
other | The CollisionUnit to check for collision. | |
return | bool |
public CollisionUnit ( System.Entity owner, Vector2 location, Microsoft.Xna.Framework.Graphics.Texture2D collisionMask, bool bUsePixelCollision ) : System | ||
owner | System.Entity | The "owner" Entity that this CollisionUnit will be for. |
location | Vector2 | The top-left corner of the |
collisionMask | Microsoft.Xna.Framework.Graphics.Texture2D | Collision mask for the object. |
bUsePixelCollision | bool | Is pixel-perfect collisions should be used. |
return | System |
public CollisionUnit ( System.Entity owner, Vector2 point1, Vector2 point2, CollisionType collisionType, Microsoft.Xna.Framework.Graphics.Texture2D collisionMask, bool bUsePixelCollision ) : System | ||
owner | System.Entity | The "owner" Entity that this COllisionUnit will be for. |
point1 | Vector2 | A point on the line or a corner of the box. For line, this is the start. For box, this is the upper-left corner. |
point2 | Vector2 | A point on the line or a corner of the box. For line, this is the end. For box, this is the lower-right corner. |
collisionType | CollisionType |
/// The collision type to use. The only accepted value is |
collisionMask | Microsoft.Xna.Framework.Graphics.Texture2D | Collision mask for the object. |
bUsePixelCollision | bool | Is pixel-perfect collisions should be used. |
return | System |
public CollisionUnit ( System.Entity owner, Vector2 center, int radius, Microsoft.Xna.Framework.Graphics.Texture2D collisionMask, bool bUsePixelCollision ) : System | ||
owner | System.Entity | The "owner" Entity that this CollisionUnit will be for. |
center | Vector2 | The location of the circle center. |
radius | int | The radius of the circle. |
collisionMask | Microsoft.Xna.Framework.Graphics.Texture2D | Collision mask for the object. |
bUsePixelCollision | bool | Is pixel-perfect collisions should be used. |
return | System |
public CollisionsChanged ( int timeStamp ) : bool | ||
timeStamp | int | The current timestamp. |
return | bool |
public CollisionsChanged ( bool bChanged ) : void | ||
bChanged | bool | true if the collisions changed, false if otherwise. |
return | void |
public GetCollisionPoint ( |
||
other | The CollisionUnit to get the collision point from. | |
return | Vector2 |
public NeedsCollisionUpdate ( bool needsUpdate ) : void | ||
needsUpdate | bool | true if the unit needs to be updated, false if otherwise. |
return | void |
public RemoveCollision ( |
||
other | The CollisionUnit to remove the collision from. | |
return | void |
public Rotate ( float rotation ) : void | ||
rotation | float | The delta rotation of the CollisionUnit, in radians. |
return | void |
public Scale ( Vector2 scale ) : void | ||
scale | Vector2 | The delta scale of the CollisionUnit. |
return | void |
public SetCheckTimeStamp ( int timeStamp ) : void | ||
timeStamp | int | The last time the collision unit was checked. |
return | void |
public SetFullCheckTimeStamp ( int timeStamp ) : void | ||
timeStamp | int | The last time the collision unit was updated. |
return | void |
public SetLastCheckedBy ( |
||
unit | The last checked collision unit. | |
return | void |
public SetSolid ( bool blockOthers ) : void | ||
blockOthers | bool | true if the collision unit is solid, false if otherwise. |
return | void |
public Translate ( Vector2 translation ) : void | ||
translation | Vector2 | The delta translation to move the unit. |
return | void |
public UpdateCollisionsWith ( |
||
other | The CollisionUnit to update. | |
return | void |