Dart Documentationbox2dFeatures

Features class

class Features {
 /** The edge that defines the outward contact normal. */
 int referenceEdge;

 /** The edge most anti-parallel to the reference edge. */
 int incidentEdge;

 /** The vertex (0 or 1) on the incident edge that was clipped. */
 int incidentVertex;

 /** A value of 1 indicates that the reference edge is on shape2. */
 int flip;

 /**
  * Constructs a new features with zero values for all fields.
  */
 Features() :
   referenceEdge = 0,
   incidentEdge = 0,
   incidentVertex = 0,
   flip = 0 { }

 // Constructs a new Features that is a copy of the given features.
 Features.copy(Features f) :
   referenceEdge = f.referenceEdge,
   incidentEdge = f.incidentEdge,
   incidentVertex = f.incidentVertex,
   flip = f.flip { }

 // Set this feature to be a copy of the given feature.
 void setFrom(Features f) {
   referenceEdge = f.referenceEdge;
   incidentEdge = f.incidentEdge;
   incidentVertex = f.incidentVertex;
   flip = f.flip;
 }

 /**
  * Returns true if this Features object is equal to the given object.
  */
 bool operator ==(other) =>
   referenceEdge == other.referenceEdge &&
   incidentEdge == other.incidentEdge &&
   incidentVertex == other.incidentVertex && flip == other.flip;

 /**
  * Returns a String representation of this Features.
  */
 String toString() {
   return "Features: ($flip, $incidentEdge, $incidentVertex $referenceEdge)";
 }

 /**
  * Sets all features to 0.
  */
 zero() {
   referenceEdge = 0;
   incidentEdge = 0;
   incidentVertex = 0;
   flip = 0;
 }
}

Constructors

new Features() #

Constructs a new features with zero values for all fields.

Features() :
 referenceEdge = 0,
 incidentEdge = 0,
 incidentVertex = 0,
 flip = 0 { }

new Features.copy(Features f) #

Features.copy(Features f) :
 referenceEdge = f.referenceEdge,
 incidentEdge = f.incidentEdge,
 incidentVertex = f.incidentVertex,
 flip = f.flip { }

Properties

int flip #

A value of 1 indicates that the reference edge is on shape2.

int flip

int incidentEdge #

The edge most anti-parallel to the reference edge.

int incidentEdge

int incidentVertex #

The vertex (0 or 1) on the incident edge that was clipped.

int incidentVertex

int referenceEdge #

The edge that defines the outward contact normal.

int referenceEdge

Operators

bool operator ==(other) #

Returns true if this Features object is equal to the given object.

bool operator ==(other) =>
 referenceEdge == other.referenceEdge &&
 incidentEdge == other.incidentEdge &&
 incidentVertex == other.incidentVertex && flip == other.flip;

Methods

void setFrom(Features f) #

void setFrom(Features f) {
 referenceEdge = f.referenceEdge;
 incidentEdge = f.incidentEdge;
 incidentVertex = f.incidentVertex;
 flip = f.flip;
}

String toString() #

Returns a String representation of this Features.

String toString() {
 return "Features: ($flip, $incidentEdge, $incidentVertex $referenceEdge)";
}

dynamic zero() #

Sets all features to 0.

zero() {
 referenceEdge = 0;
 incidentEdge = 0;
 incidentVertex = 0;
 flip = 0;
}