CircleCollider
namespace Griff.Scenes;
public sealed class CircleCollider : ColliderA circle for collisions, centered on the entity (plus Offset). Its radius grows with the larger of the transform’s X and Y scale, so it stays round. Good for balls, coins, bullets and round enemies.
Circle bodies don’t roll unless their BodyRotates: one resting on a corner stays balanced there. One that rotates rolls: along the ground, down slopes and over tile floors without slipping, slowed by its RollingResistance until it rests, with its spin carried into its bounces and its sprite turning as it goes.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”IgnoreLayers
Section titled “IgnoreLayers”public override string? IgnoreLayers { get; set; }IsTrigger
Section titled “IsTrigger”public override bool IsTrigger { get; set; }public override string? Layer { get; set; }Offset
Section titled “Offset”public override Vector2 Offset { get; set; }Radius
Section titled “Radius”public float Radius { get; set; }World units before the transform’s scale. 0.5 fits a 1×1 sprite.
WorldBounds
Section titled “WorldBounds”public override Box WorldBounds { get; }WorldCircle
Section titled “WorldCircle”public Circle WorldCircle { get; }The circle it covers in the world. Its radius scales with the larger of the entity’s X and Y scale.
Methods
Section titled “Methods”Contains
Section titled “Contains”public override bool Contains(Vector2 point)