Quantum 3 3.0.11

Public Member Functions | Properties | List of all members
Quantum.CollisionInfo2D.ContactPointIterator2D Struct Reference

A helper for safety interaction through the contact point buffer. More...

Public Member Functions

bool Next (out FPVector2 contactPoint)
 Iterates through the contact points of a collision. More...
 
bool Next (out FPVector2 contactPoint, out FPVector2 contactNormal)
 Iterates through the contact points of a collision, also accessing the contact normal. More...
 
bool NextUnsafe (out FPVector2 *contactPoint, out FPVector2 *contactNormal, out bool invertedNormal)
 Iterates through the contact points of a collision, also accessing the contact normal. The pointers access the fields directly in the collision manifold structure and modifications done to it will affect the collision resolution. More...
 
void ResetIterator ()
 Resets the iterator. More...
 

Properties

readonly FPVector2 Average [get]
 The average contact point on this collision. More...
 
FPVector2 ContactNormal [get, set]
 The collision normal of the manifold. More...
 
readonly int Count [get]
 The number of contact points on this collision. More...
 
FPVector2 Current [get, set]
 The current contact point iterated. Next(out Photon.Deterministic.FPVector2) must have been called at least once and must have returned true in the latest call. More...
 
FPVector2 First [get, set]
 The first contact point computed on this collision. More...
 

Detailed Description

A helper for safety interaction through the contact point buffer.

Member Function Documentation

◆ Next() [1/2]

bool Quantum.CollisionInfo2D.ContactPointIterator2D.Next ( out FPVector2  contactPoint)
inline

Iterates through the contact points of a collision.

Parameters
contactPointThe current contact point. Default if the iteration is over.
Returns
true if there is still a contactPoint .
while(info.ContactPoints.Next(out var cp) {
Draw.Circle(cp, FP._0_10);
}

◆ Next() [2/2]

bool Quantum.CollisionInfo2D.ContactPointIterator2D.Next ( out FPVector2  contactPoint,
out FPVector2  contactNormal 
)
inline

Iterates through the contact points of a collision, also accessing the contact normal.

Parameters
contactPointThe current contact point. Default if the iteration is over.
contactNormalThe contact normal. Default if the iteration is over.
Returns
true if there is still a contactPoint and contactNormal .
while(info.ContactPoints.Next(out var contactPoint, out var contactNormal) {
Draw.Circle(contactPoint, FP._0_10);
Draw.Ray(contactPoint, contactNormal);
}

◆ NextUnsafe()

bool Quantum.CollisionInfo2D.ContactPointIterator2D.NextUnsafe ( out FPVector2 contactPoint,
out FPVector2 contactNormal,
out bool  invertedNormal 
)
inline

Iterates through the contact points of a collision, also accessing the contact normal. The pointers access the fields directly in the collision manifold structure and modifications done to it will affect the collision resolution.

Parameters
contactPointThe current contact point. Default if the iteration is over.
contactNormalThe contact normal. Default if the iteration is over.
invertedNormalIf the contact normal is inverted from the perspective of the main entity in the callback.
Returns
true if there is still a contactPoint and contactNormal .
while(info.ContactPoints.NextUnsafe(out var contactPoint, out var contactNormal, out var invertedNormal) {
Draw.Circle(*contactPoint, FP._0_10);
Draw.Ray(*contactPoint, invertedNormal ? -(*contactNormal) : *contactNormal);
}

◆ ResetIterator()

void Quantum.CollisionInfo2D.ContactPointIterator2D.ResetIterator ( )
inline

Resets the iterator.

Property Documentation

◆ Count

readonly int Quantum.CollisionInfo2D.ContactPointIterator2D.Count
get

The number of contact points on this collision.

◆ Average

readonly FPVector2 Quantum.CollisionInfo2D.ContactPointIterator2D.Average
get

The average contact point on this collision.

◆ First

FPVector2 Quantum.CollisionInfo2D.ContactPointIterator2D.First
getset

The first contact point computed on this collision.

Contact points are computed in NO particular order.

◆ Current

FPVector2 Quantum.CollisionInfo2D.ContactPointIterator2D.Current
getset

The current contact point iterated. Next(out Photon.Deterministic.FPVector2) must have been called at least once and must have returned true in the latest call.

Contact points are computed in NO particular order.

◆ ContactNormal

FPVector2 Quantum.CollisionInfo2D.ContactPointIterator2D.ContactNormal
getset

The collision normal of the manifold.