Obi  7.0.5
Unified particle physics for Unity
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Obi.GraphColoring Class Reference

Public Member Functions

 GraphColoring (int particleCount=0)
 
void Clear ()
 
void AddConstraint (int[] particles)
 
IEnumerator Colorize (string progressDescription, List< int > colors)
 

Public Attributes

IReadOnlyList< int > particleIndices => m_ParticleIndices.AsReadOnly()
 
IReadOnlyList< int > constraintIndices => m_ConstraintIndices.AsReadOnly()
 

Detailed Description

General greedy graph coloring algorithm for constraints. Input:

  • List of particle indices used by all constraints.
  • List of per-constraint offsets of the first constrained particle in the previous array, with the total amount of particle indices in the last position.

The output is a color for each constraint. Constraints of the same color are guaranteed to not share any partices.


The documentation for this class was generated from the following file: