Exemple #1
0
 /// <inheritdoc/>
 public override Projection GetProjection(Vector2 axis)
 {
     return(Projection.CreatePolygonProjection(axis, this.WorldPoints));
 }
Exemple #2
0
 /// <summary>
 /// Gets the overlap between the two projections.
 /// </summary>
 /// <param name="other">The other projection.</param>
 /// <returns>The overlap.</returns>
 public float GetOverlap(Projection other)
 {
     return(Math.Max(0f, Math.Min(this.Maximum, other.Maximum) - Math.Max(this.Minimum, other.Minimum)));
 }
Exemple #3
0
 /// <summary>
 /// Checks whether this overlaps with the other projection.
 /// </summary>
 /// <param name="other">The other projection.</param>
 /// <returns>A value indicating whether or not this overlaps with the other projection.</returns>
 public bool OverlapsWith(Projection other)
 {
     return(!(this.Maximum <= other.Minimum || other.Maximum <= this.Minimum));
 }
Exemple #4
0
 /// <summary>
 /// Determines whether this projection contains the other projection.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns>
 /// <c>true</c> if this projection contains the other projection; otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(Projection other)
 {
     return(this.Maximum > other.Maximum && this.Minimum < other.Minimum);
 }