Dart Documentationbox2d_consoleFeatures

Features class

The features that intersect to form the contact point

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;

final Type runtimeType #

inherited from Object

A representation of the runtime type of the object.

external Type get runtimeType;

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

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

int hashCode() #

inherited from Object

Get a hash code for this object.

All objects have hash codes. Hash codes are guaranteed to be the same for objects that are equal when compared using the equality operator ==. Other than that there are no guarantees about the hash codes. They will not be consistent between runs and there are no distribution guarantees.

If a subclass overrides hashCode it should override the equality operator as well to maintain consistency.

external int hashCode();

noSuchMethod(String name, List args) #

inherited from Object

noSuchMethod is invoked when users invoke a non-existant method on an object. The name of the method and the arguments of the invocation are passed to noSuchMethod. If noSuchMethod returns a value, that value becomes the result of the original invocation.

The default behavior of noSuchMethod is to throw a noSuchMethodError.

external Dynamic noSuchMethod(String name, List args);

const Object() #

inherited from Object

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

const Object();

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

zero() #

Sets all features to 0.

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