Photon Quantum 3.0.0

Public Member Functions | Properties | List of all members
Quantum.Physics2D.HitCollection Struct Reference

Collection of hits returned from a physics query. More...

Public Member Functions

void Add (Hit hit, FrameContext context)
 Adds a hit to the list collection. More...
 
void ExpandCapacity (int newCapacity, FrameContext context)
 Expands the hit collection capacity. More...
 
void Free (Native.Allocator allocator)
 Frees the values and resets the hit collection metadata. More...
 
void Reset ()
 Resets the HitCollection. More...
 
void Sort (FPVector2 point)
 Sort all hits in the collection, in ascending order, based on the distance from the Hit.Point to the target point . More...
 
void SortCastDistance ()
 Sort all hits in the collection, in ascending order, based on the Hit.CastDistanceNormalized. More...
 
Hit[] ToArray ()
 Converts the hit collection to a managed array of hits. More...
 

Properties

int Count [get]
 The amount of hits in the collection. More...
 
HitHitsBuffer [get]
 Returns the Hit pointer to the buffer of hits. More...
 
Hit this[int index] [get]
 Returns a Hit in collection by the index . More...
 

Detailed Description

Collection of hits returned from a physics query.

Member Function Documentation

◆ ToArray()

Hit [] Quantum.Physics2D.HitCollection.ToArray ( )
inline

Converts the hit collection to a managed array of hits.

Returns
An array of hits.

◆ Sort()

void Quantum.Physics2D.HitCollection.Sort ( FPVector2  point)
inline

Sort all hits in the collection, in ascending order, based on the distance from the Hit.Point to the target point .

◆ SortCastDistance()

void Quantum.Physics2D.HitCollection.SortCastDistance ( )
inline

Sort all hits in the collection, in ascending order, based on the Hit.CastDistanceNormalized.

◆ Free()

void Quantum.Physics2D.HitCollection.Free ( Native.Allocator  allocator)
inline

Frees the values and resets the hit collection metadata.

Parameters
allocatorThe native memory allocator.

◆ Reset()

void Quantum.Physics2D.HitCollection.Reset ( )
inline

Resets the HitCollection.

◆ Add()

void Quantum.Physics2D.HitCollection.Add ( Hit  hit,
FrameContext  context 
)
inline

Adds a hit to the list collection.

Parameters
hitThe Hit instance to be added to the collection.
contextThe FrameContext.

◆ ExpandCapacity()

void Quantum.Physics2D.HitCollection.ExpandCapacity ( int  newCapacity,
FrameContext  context 
)
inline

Expands the hit collection capacity.

Parameters
newCapacityThe amount of new capacity.
contextThe FrameContext.

Property Documentation

◆ Count

int Quantum.Physics2D.HitCollection.Count
get

The amount of hits in the collection.

◆ this[int index]

Hit Quantum.Physics2D.HitCollection.this[int index]
get

Returns a Hit in collection by the index .

Exceptions
IndexOutOfRangeExceptionWhen the specified index is out of the collection boundaries.

◆ HitsBuffer

Hit* Quantum.Physics2D.HitCollection.HitsBuffer
get

Returns the Hit pointer to the buffer of hits.