Struct ArenaRect
- Namespace
- SurvivorsMaker.Simulation
- Assembly
- SurvivorsMaker.Simulation.dll
Axis-aligned arena rectangle, centered on the origin unless built otherwise.
public struct ArenaRect
- Inherited Members
Constructors
ArenaRect(Vec2, Vec2)
public ArenaRect(Vec2 min, Vec2 max)
Parameters
Fields
Max
public Vec2 Max
Field Value
Min
public Vec2 Min
Field Value
Properties
Center
public Vec2 Center { get; }
Property Value
Height
public float Height { get; }
Property Value
Width
public float Width { get; }
Property Value
Methods
Centered(float, float)
public static ArenaRect Centered(float width, float height)
Parameters
Returns
Clamp(Vec2, float)
Keeps a circle of radius inside. If the arena is too small on an axis, uses its center.
public Vec2 Clamp(Vec2 p, float radius = 0)
Parameters
Returns
Contains(Vec2)
Inclusive containment test.
public bool Contains(Vec2 p)
Parameters
pVec2
Returns
Inset(float)
Rectangle shrunk by margin on every side (never inverted).
public ArenaRect Inset(float margin)
Parameters
marginfloat
Returns
RandomPoint(SimRandom)
public Vec2 RandomPoint(SimRandom random)
Parameters
randomSimRandom