Table of Contents

Class BoxCollider

Namespace
MonoEight.Core.Physics
Assembly
MonoEight.Template.dll

An axis aligned rectangular Collider.

public class BoxCollider : Collider, IDisposable
Inheritance
BoxCollider
Implements
Inherited Members

Constructors

BoxCollider(Point)

Initializes a new instance of the BoxCollider with the given size.

public BoxCollider(Point size)

Parameters

size Point

The size of the collider.

BoxCollider(int)

public BoxCollider(int size)

Parameters

size int

BoxCollider(int, int)

public BoxCollider(int width, int height)

Parameters

width int

The width of the collider.

height int

The height of the collider.

Properties

Max

Gets the bottom right corner of the box.

public Vector2 Max { get; }

Property Value

Vector2

Min

Gets the top left corner of the box.

public Vector2 Min { get; }

Property Value

Vector2

Size

Gets or sets the width and height.

public Point Size { get; set; }

Property Value

Point

Methods

Draw(SpriteBatch)

Called once per frame to render the component.

protected override void Draw(SpriteBatch spriteBatch)

Parameters

spriteBatch SpriteBatch

Microsoft.Xna.Framework.Graphics.SpriteBatch

Intersects(Point)

Whether this collider intersects with the given Microsoft.Xna.Framework.Point.

public override bool Intersects(Point point)

Parameters

point Point

The Microsoft.Xna.Framework.Point to check against.

Returns

bool

true if the collider intersect with the given Microsoft.Xna.Framework.Point.

Intersects(BoxCollider)

Whether this collider intersects with the given BoxCollider.

public override bool Intersects(BoxCollider other)

Parameters

other BoxCollider

The BoxCollider to check against.

Returns

bool

true if the collider intersect with the given BoxCollider.

Intersects(CircleCollider)

Whether this collider intersects with the given CircleCollider.

public override bool Intersects(CircleCollider other)

Parameters

other CircleCollider

The CircleCollider to check against.

Returns

bool

true if the collider intersect with the given CircleCollider.

Intersects(Collider)

Whether this collider intersects with the other given collider.

public override bool Intersects(Collider other)

Parameters

other Collider

The other collider used to check intersection.

Returns

bool

true if the colliders intersect.