Table of Contents

Class AACylinderProximity

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

Defines an 'axis-aligned' cylinder proximity.

public class AACylinderProximity : IAACylinderProximity, INearestPointProximity, IAttachableProximity<IAttachedAACylinderProximity>, IProximity, IShapeVolume, ICloneable, IFormattable
Inheritance
AACylinderProximity
Implements
IShapeVolume
Inherited Members
Extension Methods

Constructors

AACylinderProximity(in Vector2, float, float)

Create an axis-aligned cylinder on the Y axis.

public AACylinderProximity(in Vector2 center, float radius, float height = Infinity)

Parameters

center Vector2

Center of the cylinder as (X, Z). Components must be finite.

radius float

Radius of the cylinder. Must be finite.

height float

Height of the cylinder. Can be infinity or NaN (converts to infinity).

Exceptions

ArgumentOutOfRangeException

Axis is not X, Y, or Z.

ArgumentException

Radius or center is not finite.

AACylinderProximity(in Vector3, float, float, SnapAxis)

Create an axis-aligned cylinder.

public AACylinderProximity(in Vector3 center, float radius, float height, SnapAxis axis = SnapAxis.Y)

Parameters

center Vector3

Center of the cylinder. Depending on the axis one component will be discarded if height isn't finite. Other components must be finite.

radius float

Radius of the cylinder. Must be finite.

height float

Height of the cylinder. Can be infinity or NaN (converts to infinity).

axis SnapAxis

Axis to align to. Defaults to the Y axis. Must either be UnityEngine.SnapAxis.X, UnityEngine.SnapAxis.Y, or UnityEngine.SnapAxis.Z.

Exceptions

ArgumentOutOfRangeException

Axis is not X, Y, or Z.

ArgumentException

Radius or center is not finite.

Properties

Axis

The axis the cylinder is aligned to. Must be 'X', 'Y', or 'Z'.

public SnapAxis Axis { get; }

Property Value

SnapAxis

Remarks

Defaults to 'Y'.

Center

Center position of the cylinder.

public Vector3 Center { get; }

Property Value

Vector3

Height

Cylinder height.

public float Height { get; }

Property Value

float

Remarks

Radius

Radius of the cylinder.

public float Radius { get; }

Property Value

float

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.