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>(3),
   indexB = new List<int>(3) {
   for (int i = 0; i < 3; ++i) {
     indexA[i] = Settings.MAX_INTEGER;
     indexB[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>(3),
 indexB = new List<int>(3) {
 for (int i = 0; i < 3; ++i) {
   indexA[i] = Settings.MAX_INTEGER;
   indexB[i] = Settings.MAX_INTEGER;
 }
}

Properties

int count #

count

final List<int> indexA #

indexA

final List<int> indexB #

indexB

num metric #

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;
}