Navigation
API > API/Runtime > API/Runtime/Chaos
Iterates over the FCollidingData objects for a set of proxies
Usage: for (FCollisionEventDataIterator It(MyProxyList, CollisionData); It; ++It) { Chaos::FCollidingDataIndex CollidingDataIndex = It.GetCurrentCollidingDataIndex(); if (CollidingDataIndex.IsValid()) { // CollidingData is between one ot the proxies in MyProxyList and another (which in general may also be in MyProxyList!) const Chaos::FCollidingData& CollidingData = CollisionEventData.CollisionData.AllCollisionsArray[CollidingDataIndex.GetIndex()];
Chaos::FVec3 Normal = (CollidingDataIndex.GetProxyIndex() == 0) ? CollidingData.Normal : -CollidingData.Normal float Mass = (CollidingDataIndex.GetProxyIndex() == 0) ? CollidingData.Mass1 : CollidingData.Mass2; // ... }} }
| Name | FCollisionEventDataIterator |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/EventsData.h |
| Include Path | #include "EventsData.h" |
Syntax
class FCollisionEventDataIterator
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FCollisionEventDataIterator
(
const TArrayView< const IPhysicsProxyBase* >& InProxies, |
EventsData.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CollisionEventData | const Chaos::FCollisionEventData & | Collision data from the whole scene. | EventsData.h | |
| Proxies | TArrayView< const IPhysicsProxyBase * > | Set of proxies we care about. | EventsData.h | |
| ProxyCollisionIndex | int32 | EventsData.h | ||
| ProxyCollisionIndices | const TArray< int32 > * | EventsData.h | ||
| ProxyIndex | int32 | Current Iteration state. | EventsData.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FCollidingDataIndex GetCurrentCollidingDataIndex() |
Get the index of the current collision in the CollisionEventData's CollidingData array or INDEX_NONE if we have reached the end of the collisions for all proxies. | EventsData.h | |
const IPhysicsProxyBase * GetCurrentProxy() |
Get the Proxy that the iterator is currently pointing to or null if we have reached the end of the collisions for all proxies. | EventsData.h | |
bool IsFinished() |
Have we reached the end of the collisions for all proxies? | EventsData.h | |
void Next () |
Move to the next collision. | EventsData.h | |
void Reset() |
Reset the iterator to point at the first FCollidingData for the first proxy that has any collisions. | EventsData.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
operator bool() |
Returns true if we are still iterating (have not reached the end) | EventsData.h | |
FCollisionEventDataIterator & operator++() |
Move to the next non-empty collision/proxy. | EventsData.h | |
FCollisionEventDataIterator operator++
(
int |
NOTE: Deliberately not providing a post-increment operator because it is more expensive to copy than users might expect (although not that bad really, so feel free to add one if you really need it!) | EventsData.h |