C# Class MilkShakeFramework.Tools.Maths.RotatedRectangle

Afficher le fichier Open project: lucas-jones/MilkShake-old Class Usage Examples

Méthodes publiques

Свойство Type Description
CollisionRectangle Microsoft.Xna.Framework.Rectangle
Origin Vector2
Rotation float

Méthodes publiques

Méthode Description
ChangePosition ( int theXPositionAdjustment, int theYPositionAdjustment ) : void

Used for changing the X and Y position of the RotatedRectangle

Intersects ( Rectangle theRectangle ) : bool

This intersects method can be used to check a standard XNA framework Rectangle object and see if it collides with a Rotated Rectangle object

Intersects ( RotatedRectangle theRectangle ) : bool

Check to see if two Rotated Rectangls have collided

LowerLeftCorner ( ) : Vector2
LowerRightCorner ( ) : Vector2
RotatedRectangle ( Rectangle theRectangle, float theInitialRotation ) : System
RotatedRectangle ( int X, int Y, int Width, int Height ) : System
UpperLeftCorner ( ) : Vector2
UpperRightCorner ( ) : Vector2

Private Methods

Méthode Description
GenerateScalar ( Vector2 theRectangleCorner, Vector2 theAxis ) : int

Generates a scalar value that can be used to compare where corners of a rectangle have been projected onto a particular axis.

IsAxisCollision ( RotatedRectangle theRectangle, Vector2 aAxis ) : bool

Determines if a collision has occurred on an Axis of one of the planes parallel to the Rectangle

RotatePoint ( Vector2 thePoint, Vector2 theOrigin, float theRotation ) : Vector2

Rotate a point from a given location and adjust using the Origin we are rotating around

Method Details

ChangePosition() public méthode

Used for changing the X and Y position of the RotatedRectangle
public ChangePosition ( int theXPositionAdjustment, int theYPositionAdjustment ) : void
theXPositionAdjustment int
theYPositionAdjustment int
Résultat void

Intersects() public méthode

This intersects method can be used to check a standard XNA framework Rectangle object and see if it collides with a Rotated Rectangle object
public Intersects ( Rectangle theRectangle ) : bool
theRectangle Microsoft.Xna.Framework.Rectangle
Résultat bool

Intersects() public méthode

Check to see if two Rotated Rectangls have collided
public Intersects ( RotatedRectangle theRectangle ) : bool
theRectangle RotatedRectangle
Résultat bool

LowerLeftCorner() public méthode

public LowerLeftCorner ( ) : Vector2
Résultat Vector2

LowerRightCorner() public méthode

public LowerRightCorner ( ) : Vector2
Résultat Vector2

RotatedRectangle() public méthode

public RotatedRectangle ( Rectangle theRectangle, float theInitialRotation ) : System
theRectangle Microsoft.Xna.Framework.Rectangle
theInitialRotation float
Résultat System

RotatedRectangle() public méthode

public RotatedRectangle ( int X, int Y, int Width, int Height ) : System
X int
Y int
Width int
Height int
Résultat System

UpperLeftCorner() public méthode

public UpperLeftCorner ( ) : Vector2
Résultat Vector2

UpperRightCorner() public méthode

public UpperRightCorner ( ) : Vector2
Résultat Vector2

Property Details

CollisionRectangle public_oe property

public Rectangle,Microsoft.Xna.Framework CollisionRectangle
Résultat Microsoft.Xna.Framework.Rectangle

Origin public_oe property

public Vector2 Origin
Résultat Vector2

Rotation public_oe property

public float Rotation
Résultat float