Skip to main content

CircleCollider

Namespace: MonineEngine.Physics

A collider component, that uses a circle as the collision bounding.

public class CircleCollider : MonineEngine.Core.Collider

Inheritance Object → Component → Collider → CircleCollider

Fields

Radius

The radius of the of this collider.

public float Radius;

Offset

public Vector2 Offset;

IsTrigger

public bool IsTrigger;

Properties

Enabled

public bool Enabled { get; set; }

Property Value

Boolean

Entity

public Entity Entity { get; internal set; }

Property Value

Entity

Parent

public Entity Parent { get; }

Property Value

Entity

Transform

public Transform Transform { get; }

Property Value

Transform

Camera

public Camera2D Camera { get; }

Property Value

Camera2D

Constructors

CircleCollider(Single)

Constructs a new CircleCollider.

public CircleCollider(float radius)

Parameters

radius Single
The radius of the circle.

Methods

GetBounds()

Gets a that surrounds the bounds of this

public Rectangle GetBounds()

Returns

Rectangle
A Rectangle that surrounds the bounds of this Collider in world space.

GetCircle()

Gets a representing this collider.

public Circle GetCircle()

Returns

Circle
A new Circle with the world position and radius of this collider.

Intersects(Collider)

public bool Intersects(Collider other)

Parameters

other Collider

Returns

Boolean

Events

OnCollisionEnter

public event Action<CollisionEventArgs> OnCollisionEnter;

OnCollisionStay

public event Action<CollisionEventArgs> OnCollisionStay;

OnCollisionExit

public event Action<CollisionEventArgs> OnCollisionExit;

OnTriggerEnter

public event Action<CollisionEventArgs> OnTriggerEnter;

OnTriggerStay

public event Action<CollisionEventArgs> OnTriggerStay;

OnTriggerExit

public event Action<CollisionEventArgs> OnTriggerExit;