58 typedef std::pair<Mezzanine::Real,Mezzanine::Real> SegmentPosPair;
73 if( NewStart > NewEnd )
74 std::swap(NewStart,NewEnd);
76 if( NewStart > PosPair.second || NewEnd < PosPair.first )
79 if( NewStart > PosPair.first )
80 PosPair.first = NewStart;
82 if( NewEnd < PosPair.second )
83 PosPair.second = NewEnd;
114 {
return QuarterPi; }
117 {
return RadToDegMult; }
120 {
return DegToRadMult; }
126 {
return std::ceil(Val); }
129 {
return std::floor(Val); }
132 {
return std::pow(Val,Power); }
135 {
return std::sqrt(Val); }
138 {
return std::fabs(Val); }
141 {
return std::fmod(Numerator,Denominator); }
150 {
return std::cos(Radians); }
153 {
return std::sin(Radians); }
156 {
return std::tan(Radians); }
159 {
return std::acos(Interval); }
162 {
return std::asin(Interval); }
165 {
return std::atan(Interval); }
171 {
return Degrees * DegToRadMult; }
174 {
return Radians * RadToDegMult; }
197 Real SquareVar, Dist = 0;
198 for(
Whole X = 0 ; X < 3 ; ++X )
202 Dist += SquareVar * SquareVar;
205 Dist += SquareVar * SquareVar;
246 Real Distance = -( Nom / Denom );
247 if( Distance > Cast.
Length() ) {
264 Whole MaxAxis = 0, MidAxis = 1, MinAxis = 2;
265 if( AbsoluteDir[0] < AbsoluteDir[2] ) {
268 }
else if( AbsoluteDir[1] < AbsoluteDir[MinAxis] ) {
271 }
else if( AbsoluteDir[1] > AbsoluteDir[MaxAxis] ) {
276 SegmentPosPair Distances(0,std::numeric_limits<Real>::infinity());
278 ::CalculateAxis(MaxAxis,Cast,Box,Distances);
279 if( AbsoluteDir[MidAxis] < std::numeric_limits<Real>::epsilon() ) {
286 ::CalculateAxis(MidAxis,Cast,Box,Distances);
287 if( AbsoluteDir[MinAxis] < std::numeric_limits<Real>::epsilon() ) {
292 ::CalculateAxis(MinAxis,Cast,Box,Distances);
296 Ray Ret( Cast.
Origin + (CastDir * Distances.first), Cast.
Origin + (CastDir * Distances.second) );
311 Real CCoEff = CastOrigin.
DotProduct(CastOrigin) - ( Radius * Radius );
314 Real Determinate = ( BCoEff * BCoEff ) - ( 4 * ACoEff * CCoEff );
315 if( Determinate < 0 ) {
321 Ray Ret( Cast.
Origin + (CastDir * NearDist), Cast.
Origin + (CastDir * FarDist) );