#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2009 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
using System;
using Microsoft.Xna.Framework;
namespace Nuclex.Geometry.Areas {
/// Informations about the point of first contact between two bodies
public struct ImpactPoint {
/// Whether a contact could be found at all
public bool Found;
/// The absolute location where the contact occurs
public Vector2 AbsoluteLocation;
/// The time at which the contact occurs
public float Time;
}
/// Two-dimensional geometric body in 2D space
///
/// An area by definition and of course also in the context of this library is a
/// two-dimensional region. This region could a either be located in actual
/// 2D space (like drawn on a piece of paper) or be located in as a flat object
/// in 3D space (like the piece of paper located in the real world). This
/// class represents the first case, a 2D object in 2D space.
///
public interface IArea2 {
/*
/// Accepts a visitor to access the concrete area implementation
/// Visitor to be accepted
void Accept(IArea2Visitor visitor);
*/
/// Surface area that the shape contains
float Area { get; }
/// The total length of the area's circumference
float CircumferenceLength { get; }
/// The center of mass within the shape
Vector2 CenterOfMass { get; }
/// Smallest rectangle that encloses the shape in its entirety
AxisAlignedRectangle2 BoundingBox { get; }
/// Locates the nearest point in the shape to some arbitrary location
/// Location to which the closest point is determined
/// The closest point in the shape to the specified location
Vector2 ClosestPointTo(Vector2 location);
/// Returns a random point on the area's perimeter
/// Random number generator that will be used
/// A random point on the area's perimeter
Vector2 RandomPointOnPerimeter(IRandom randomNumberGenerator);
/// Returns a random point inside the area
/// Random number generator that will be used
/// A random point inside the area
Vector2 RandomPointWithin(IRandom randomNumberGenerator);
}
} // namespace Nuclex.Geometry.Areas