Quantum 3 3.0.14

Public Member Functions | Properties | List of all members
Quantum.CollisionInfo3D.ContactPointIterator3D Struct Reference

An iterator over multiple triangles collisions with a given mesh. More...

Public Member Functions

bool Next (out FPVector3 contactPoint)
 Iterates through the contact points of a collision. More...
 
bool Next (out FPVector3 contactPoint, out FPVector3 contactNormal)
 Iterates through the contact points of a collision, also accessing the contact normal. More...
 
bool NextUnsafe (out FPVector3 *contactPoint, out FPVector3 *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 FPVector3 Average [get]
 The average contact point on this collision. More...
 
FPVector3 ContactNormal [get, set]
 The collision normal of the manifold. More...
 
readonly int Count [get]
 The number of contact points on this collision. More...
 
FPVector3 Current [get, set]
 The current contact point iterated. Next(out Photon.Deterministic.FPVector3) must have been called at least once and must have returned true in the latest call. More...
 
FPVector3 First [get, set]
 The first contact point computed on this collision. More...
 

Detailed Description

An iterator over multiple triangles collisions with a given mesh.

Member Function Documentation

◆ Next() [1/2]

bool Quantum.CollisionInfo3D.ContactPointIterator3D.Next ( out FPVector3  contactPoint)
inline

Iterates through the contact points of a collision.

If the entity is colliding with a mesh, this will iterate through all contact points in all colliding triangles.

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.Sphere(cp, FP._0_10);
}

◆ Next() [2/2]

bool Quantum.CollisionInfo3D.ContactPointIterator3D.Next ( out FPVector3  contactPoint,
out FPVector3  contactNormal 
)
inline

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

If the entity is colliding with a mesh, this will iterate through all contact points and normals in all colliding triangles.

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.Sphere(contactPoint, FP._0_10);
Draw.Ray(contactPoint, contactNormal);
}

◆ NextUnsafe()

bool Quantum.CollisionInfo3D.ContactPointIterator3D.NextUnsafe ( out FPVector3 contactPoint,
out FPVector3 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.

If the entity is colliding with a mesh, this will iterate through all contact points and normals in all colliding triangles.

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.Sphere(*contactPoint, FP._0_10);
Draw.Ray(contactPoint, invertedNormal ? -(*contactNormal) : *contactNormal);
}

◆ ResetIterator()

void Quantum.CollisionInfo3D.ContactPointIterator3D.ResetIterator ( )
inline

Resets the iterator.

Property Documentation

◆ Count

readonly int Quantum.CollisionInfo3D.ContactPointIterator3D.Count
get

The number of contact points on this collision.

If the entity is colliding with a mesh, this is the sum of all contact points with the triangles of the mesh. To access each specific triangle collision, check CollisionInfo3D.MeshTriangleCollisions.

◆ Average

readonly FPVector3 Quantum.CollisionInfo3D.ContactPointIterator3D.Average
get

The average contact point on this collision.

If the entity is colliding with a mesh, this is the average of all contact points with the triangles of the mesh. To access each specific triangle collision, check CollisionInfo3D.MeshTriangleCollisions.

◆ First

FPVector3 Quantum.CollisionInfo3D.ContactPointIterator3D.First
getset

The first contact point computed on this collision.

Contact points are computed in NO particular order.

If the entity is colliding with a mesh, this is the first contact point with the first triangle.

◆ Current

FPVector3 Quantum.CollisionInfo3D.ContactPointIterator3D.Current
getset

The current contact point iterated. Next(out Photon.Deterministic.FPVector3) 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

FPVector3 Quantum.CollisionInfo3D.ContactPointIterator3D.ContactNormal
getset

The collision normal of the manifold.