#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 {
/// Sides of a plane in 3D space
public enum Side {
/// Negative half space (away from the plane's normal vector)
Negative = -1,
/// Positive half space (same side as the plane's normal vector)
Positive = +1,
}
/// Targetted specifications of the library
internal static class Specifications {
/// Maximum allowed deviation from perfect accuracy
///
/// This value indicates the maximum error that may be introduced with any given
/// calculation. If it is exceeded, the algorithm that produced the result should
/// be checked for numerical stability.
///
//public const float MaximumDeviation = 0.00025f;
public const int MaximumDeviation = 2; // representable floating point numbers
/// Distance where intersection tests do not give stable results
///
/// If two geometrical objects are very close to each other, floating point
/// inaccuracies can lead to unstable results for intersection tests. This value
/// indicates how close two objects need to be for this to occur.
///
public const float HullAccuracy = MaximumDeviation;
/// Number of samples used to unit-test probabilistic functions
///
/// Some functions are intended to return randomness, like all variants of the
/// RandomPointOnSurface() method for geometric volumes. To unit-test these
/// functions, the best way is to generate a large number of random samples and
/// then see if certain criteria of these points are met (containment, average
/// value and more).
///
public const int ProbabilisticFunctionSamples = 1024;
/// Deviation allowed for probabilistic function unit tests
///
/// Acceptable deviation of the averaged samples from the perfect median value.
/// The more samples you run, the less deviation occurs.
///
public const float ProbabilisticFunctionDeviation = 0.1f;
}
} // namespace Nuclex.Geometry