C# Класс MilkShakeFramework.Tools.Maths.RotatedRectangle

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
CollisionRectangle Microsoft.Xna.Framework.Rectangle
Origin Vector2
Rotation float

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

ChangePosition() публичный Метод

Used for changing the X and Y position of the RotatedRectangle
public ChangePosition ( int theXPositionAdjustment, int theYPositionAdjustment ) : void
theXPositionAdjustment int
theYPositionAdjustment int
Результат void

Intersects() публичный Метод

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
Результат bool

Intersects() публичный Метод

Check to see if two Rotated Rectangls have collided
public Intersects ( RotatedRectangle theRectangle ) : bool
theRectangle RotatedRectangle
Результат bool

LowerLeftCorner() публичный Метод

public LowerLeftCorner ( ) : Vector2
Результат Vector2

LowerRightCorner() публичный Метод

public LowerRightCorner ( ) : Vector2
Результат Vector2

RotatedRectangle() публичный Метод

public RotatedRectangle ( Rectangle theRectangle, float theInitialRotation ) : System
theRectangle Microsoft.Xna.Framework.Rectangle
theInitialRotation float
Результат System

RotatedRectangle() публичный Метод

public RotatedRectangle ( int X, int Y, int Width, int Height ) : System
X int
Y int
Width int
Height int
Результат System

UpperLeftCorner() публичный Метод

public UpperLeftCorner ( ) : Vector2
Результат Vector2

UpperRightCorner() публичный Метод

public UpperRightCorner ( ) : Vector2
Результат Vector2

Описание свойств

CollisionRectangle публичное свойство

public Rectangle,Microsoft.Xna.Framework CollisionRectangle
Результат Microsoft.Xna.Framework.Rectangle

Origin публичное свойство

public Vector2 Origin
Результат Vector2

Rotation публичное свойство

public float Rotation
Результат float