Dart Documentationbox2dSimplexCache

SimplexCache class

class SimplexCache {
 /** length or area */
 num metric;

 int count;

 /** vertices on shape A */
 final List<int> indexA;

 /** vertices on shape B */
 final List<int> indexB;

 /**
  * Constructs a new SimplexCache.
  */
 SimplexCache() :
   metric = 0,
   count = 0,
   indexA = new List<int>.generate(3, (i) => Settings.MAX_INTEGER),
   indexB = new List<int>.generate(3, (i) => Settings.MAX_INTEGER);

 /**
  * Sets this cache equal to the given cache.
  */
 void setFrom(SimplexCache sc) {
   indexA.setRange(0, indexA.length, sc.indexA);
   indexB.setRange(0, indexB.length, sc.indexB);
   metric = sc.metric;
   count = sc.count;
 }
}

Constructors

new SimplexCache() #

Constructs a new SimplexCache.

SimplexCache() :
 metric = 0,
 count = 0,
 indexA = new List<int>.generate(3, (i) => Settings.MAX_INTEGER),
 indexB = new List<int>.generate(3, (i) => Settings.MAX_INTEGER);

Properties

int count #

int count

final List<int> indexA #

vertices on shape A

final List<int> indexA

final List<int> indexB #

vertices on shape B

final List<int> indexB

num metric #

length or area

num metric

Methods

void setFrom(SimplexCache sc) #

Sets this cache equal to the given cache.

void setFrom(SimplexCache sc) {
 indexA.setRange(0, indexA.length, sc.indexA);
 indexB.setRange(0, indexB.length, sc.indexB);
 metric = sc.metric;
 count = sc.count;
}