Table of Contents

Class SphereProximity

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

Defines a proximity in the shape of a sphere.

public class SphereProximity : ISphereProximity, INearestPointProximity, IAttachableProximity<IAttachedSphereProximity>, IProximity, IShapeVolume, ICloneable, IFormattable
Inheritance
SphereProximity
Implements
IShapeVolume
Inherited Members
Extension Methods

Constructors

SphereProximity(ISphereProximity)

Create a sphere from another ISphereProximity.

public SphereProximity(ISphereProximity other)

Parameters

other ISphereProximity

Exceptions

ArgumentException

Position or radius isn't finite (not NaN or Infinity).

SphereProximity(in BoundingSphere)

Create a sphere from a UnityEngine.BoundingSphere.

public SphereProximity(in BoundingSphere sphere)

Parameters

sphere BoundingSphere

Exceptions

ArgumentException

Position or radius isn't finite (not NaN or Infinity).

SphereProximity(in Vector3, float)

Create a sphere from a position and radius.

public SphereProximity(in Vector3 position, float radius)

Parameters

position Vector3
radius float

Exceptions

ArgumentException

Position or radius isn't finite (not NaN or Infinity).

Properties

Sphere

Sphere used for detection.

public BoundingSphere Sphere { get; }

Property Value

BoundingSphere

worldBounds

Axis-aligned bounds of the sphere.

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.