C# Класс Nez.PhysicsShapes.Box

special case of a Polygon. When doing SAT collision checks we only need to check 2 axes instead of 8
Наследование: Polygon
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
height float
width float

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

Метод Описание
Box ( float width, float height ) : Microsoft.Xna.Framework
collidesWithShape ( Shape other, CollisionResult &result ) : bool
containsPoint ( Vector2 point ) : bool
overlaps ( Shape other ) : bool
pointCollidesWithShape ( Vector2 point, CollisionResult &result ) : bool
updateBox ( float width, float height ) : void

updates the Box points, recalculates the center and sets the width/height

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

Метод Описание
buildBox ( float width, float height ) : Vector2[]

helper that builds the points a Polygon needs in the shape of a box

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

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

public Box ( float width, float height ) : Microsoft.Xna.Framework
width float
height float
Результат Microsoft.Xna.Framework

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

public collidesWithShape ( Shape other, CollisionResult &result ) : bool
other Shape
result CollisionResult
Результат bool

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

public containsPoint ( Vector2 point ) : bool
point Vector2
Результат bool

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

public overlaps ( Shape other ) : bool
other Shape
Результат bool

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

public pointCollidesWithShape ( Vector2 point, CollisionResult &result ) : bool
point Vector2
result CollisionResult
Результат bool

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

updates the Box points, recalculates the center and sets the width/height
public updateBox ( float width, float height ) : void
width float Width.
height float Height.
Результат void

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

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

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

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

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