Build a graph of connected particles, and then a set of independent islands. 更多...
#include <PBDConstraintGraph.h>
类 | |
| struct | FConstraintData |
| Information required to map a graph edge back to its constraint 更多... | |
Public 成员函数 | |
| void | AddConstraint (const uint32 InContainerId, FConstraintHandle *InConstraintHandle, const TVector< TGeometryParticleHandle< FReal, 3 > *, 2 > &InConstrainedParticles) |
| Add a constraint to the graph for each constraint in the container. | |
| void | DisableParticle (TGeometryParticleHandle< FReal, 3 > *Particle) |
| Disable a particle and remove it from its island. 更多... | |
| void | DisableParticles (const TSet< TGeometryParticleHandle< FReal, 3 > * > &Particles) |
| Disable a set of particles and remove them from their island. 更多... | |
| void | EnableParticle (TGeometryParticleHandle< FReal, 3 > *ChildParticle, const TGeometryParticleHandle< FReal, 3 > *ParentParticle) |
Adds ChildParticle to the constraint graph. 更多... | |
| const FConstraintData & | GetConstraintData (int32 ConstraintDataIndex) const |
| Information mapping the edge back to a rule's constraint | |
| const TArray< int32 > & | GetIslandConstraintData (int32 Island) const |
| Ensure that the particles in each island have consistent sleep states - if any are awake, wake all. 更多... | |
| const TArray< TGeometryParticleHandle< FReal, 3 > * > & | GetIslandParticles (int32 Island) const |
| Get the list of Particle indices associated with the specified island. | |
| int32 | GetIslandSleepCount (int32 Island) const |
| Get the list of Particle indices associated with the specified island. | |
| void | InitializeGraph (const TParticleView< TGeometryParticles< FReal, 3 > > &Particles) |
| Clear the graph and set up the particle-to-graph-node mapping for the specified particles Should be called before AddConstraint. | |
| bool | IslandNeedsResim (const int32 Island) const |
| When resim is used, tells us whether we need to resolve island | |
| int32 | NumIslands () const |
| The number of islands in the graph. | |
| void | RemoveConstraint (const uint32 InContainerId, FConstraintHandle *InConstraintHandle, const TVector< TGeometryParticleHandle< FReal, 3 > *, 2 > &InConstrainedParticles) |
| Remove a constraint from the graph | |
| void | ReserveConstraints (const int32 NumConstraints) |
| Reserve space in the graph for NumConstraints additional constraints. | |
| int32 | ReserveParticles (const int32 Num) |
Preallocate buffers for Num particles. 更多... | |
| void | ResetIslands (const TParticleView< TPBDRigidParticles< FReal, 3 > > &PBDRigids) |
| Add particles/constraints to their particle's already-assigned islands (if applicable). | |
| bool | SleepInactive (const int32 Island, const TArrayCollectionArray< TSerializablePtr< FChaosPhysicsMaterial > > &PerParticleMaterialAttributes, const THandleArray< FChaosPhysicsMaterial > &SolverPhysicsMaterials) |
| Put particles in inactive islands to sleep. | |
| void | UpdateIslands (const TParticleView< TPBDRigidParticles< FReal, 3 > > &confusing, TPBDRigidsSOAs< FReal, 3 > &Particles) |
| Generate the simulation islands of connected particles (AddConstraints must have already been called). 更多... | |
| void | WakeIsland (TPBDRigidsSOAs< FReal, 3 > &Particles, const int32 Island) |
| Wake all particles in an Island. | |
Build a graph of connected particles, and then a set of independent islands.
Particles/constraints in different islands do not interact, so islands can be updated in parallel. This is also where particle sleeping is controlled. Note that at the moment this graph is rebuilt every frame. When this changes some of the underlying data will need to be changed. I.e. move from indices to pointers to handles
| void Chaos::FPBDConstraintGraph::DisableParticle | ( | TGeometryParticleHandle< FReal, 3 > * | Particle | ) |
Disable a particle and remove it from its island.
| void Chaos::FPBDConstraintGraph::DisableParticles | ( | const TSet< TGeometryParticleHandle< FReal, 3 > * > & | Particles | ) |
Disable a set of particles and remove them from their island.
| void Chaos::FPBDConstraintGraph::EnableParticle | ( | TGeometryParticleHandle< FReal, 3 > * | ChildParticle, |
| const TGeometryParticleHandle< FReal, 3 > * | ParentParticle | ||
| ) |
Adds ChildParticle to the constraint graph.
Copies the sleeping state and island of ParentParticle to ChildParticle. Does nothing if ParentParticle is not supplied.
|
inline |
Ensure that the particles in each island have consistent sleep states - if any are awake, wake all.
Get the list of ConstraintsData indices associated with the specified island. NOTE: ConstraintDataIndex is an internal index and not related to a constraint's index in its owning container. Indices are into the ConstraintData array in the ConstraintGraph to get to the Constraint Index and Container Id.
| int32 Chaos::FPBDConstraintGraph::ReserveParticles | ( | const int32 | Num | ) |
Preallocate buffers for Num particles.
Returns the number of new slots created.
| void Chaos::FPBDConstraintGraph::UpdateIslands | ( | const TParticleView< TPBDRigidParticles< FReal, 3 > > & | confusing, |
| TPBDRigidsSOAs< FReal, 3 > & | Particles | ||
| ) |
Generate the simulation islands of connected particles (AddConstraints must have already been called).
There are no constraints connecting particles in different islands.