Table of Contents

Class AttachedPolygonProximity

Namespace
Uncreated.Warfare.Proximity
Assembly
Uncreated.Warfare.dll

A polygon attached to a transform. Scale, position, and rotation are applied.

public class AttachedPolygonProximity : IAttachedPolygonProximity, IPolygonProximity, INearestPointProximity, IAttachableProximity<IAttachedPolygonProximity>, IAttachedProximity, IProximity, IShapeVolume, ICloneable, IFormattable
Inheritance
AttachedPolygonProximity
Implements
IShapeVolume
Inherited Members
Extension Methods

Constructors

AttachedPolygonProximity(Transform, IEnumerable<Vector2>, float?, float?)

Create a polygon with a set of points attached to attachmentRoot.

public AttachedPolygonProximity(Transform attachmentRoot, IEnumerable<Vector2> points, float? minHeight, float? maxHeight)

Parameters

attachmentRoot Transform
points IEnumerable<Vector2>

A set of points with at least 3 elements.

minHeight float?

Optional minimum Y value.

maxHeight float?

Optional maximum Y value.

Exceptions

ArgumentException

points has less than 3 elements or one of the points isn't finite.

AttachedPolygonProximity(Transform, IPolygonProximity)

Create a polygon from another IAACylinderProximity attached to attachmentRoot.

public AttachedPolygonProximity(Transform attachmentRoot, IPolygonProximity polygon)

Parameters

attachmentRoot Transform
polygon IPolygonProximity

Properties

AttachmentRoot

The transform this proximity is attached to.

public Transform? AttachmentRoot { get; }

Property Value

Transform

MaxHeight

Maximum Y value of the polygon.

public float? MaxHeight { get; }

Property Value

float?

MinHeight

Minimum Y value of the polygon.

public float? MinHeight { get; }

Property Value

float?

Points

Ordered list of all points in the polygon.

public IReadOnlyList<Vector2> Points { get; }

Property Value

IReadOnlyList<Vector2>

worldBounds

Not necessarily cheap to calculate - probably best to cache.

public Bounds worldBounds { get; }

Property Value

Bounds

Methods

Clone()

Creates a new object that is a copy of the current instance.

public object Clone()

Returns

object

A new object that is a copy of this instance.

TestPoint(in Vector2)

Check if a position is within the proximity while ignoring Y position.

public bool TestPoint(in Vector2 position)

Parameters

position Vector2

Returns

bool

TestPoint(in Vector3)

Check if a position is within the proximity.

public bool TestPoint(in Vector3 position)

Parameters

position Vector3

Returns

bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToString(string, IFormatProvider)

Formats the value of the current instance using the specified format.

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The format to use.
-or-
A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.
-or-
A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

Returns

string

The value of the current instance in the specified format.