]> git.tdb.fi Git - libs/math.git/commitdiff
Miscellaneous fixes, mostly stylistic
authorMikko Rasa <tdb@tdb.fi>
Tue, 21 May 2013 13:40:04 +0000 (16:40 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 21 May 2013 13:40:04 +0000 (16:40 +0300)
source/geometry/dummy.cpp
source/geometry/hyperbox.h
source/geometry/hypersphere.h
source/geometry/transformedshape.h

index 885bc5afd6945faa41587d1f630854962cb1bde9..cc7e2baf1787d51af94f97c33a67ff73ecd41820 100644 (file)
@@ -4,6 +4,7 @@
 #include "circle.h"
 #include "hyperbox.h"
 #include "hypersphere.h"
+#include "ray.h"
 #include "rectangle.h"
 #include "shape.h"
 #include "transformedshape.h"
index 0e4efd81995508de416d37cffd6ad12e3bbf2184..42e4d61a75a49ce0824aaf231388013246c1413f 100644 (file)
@@ -72,7 +72,7 @@ inline bool HyperBox<T, D>::contains(const LinAl::Vector<T, D> &point) const
        using std::abs;
 
        for(unsigned i=0; i<D; ++i)
-               if(abs(point[i])>dimensions[i]/2)
+               if(abs(point[i])>dimensions[i]/T(2))
                        return false;
        return true;
 }
index de028fa580d627ed06d1cb811f43b104a450ed7a..35cddd1ac36461f4ee2a0e00122abda491ce3b0a 100644 (file)
@@ -23,7 +23,7 @@ private:
        T radius;
 
 public:
-       HyperSphere();
+       HyperSphere(): radius(1) { }
        explicit HyperSphere(T);
 
        virtual HyperSphere *clone() const;
@@ -37,11 +37,6 @@ public:
        virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
 };
 
-template<typename T, unsigned D>
-inline HyperSphere<T, D>::HyperSphere():
-       radius(1)
-{ }
-
 template<typename T, unsigned D>
 inline HyperSphere<T, D>::HyperSphere(T r):
        radius(r)
index bf508f9b1da31be6145fd972e350481b9502d74b..5a5cf11e8dab05ded01006b2d21189b7b97dc5c9 100644 (file)
@@ -48,7 +48,7 @@ inline TransformedShape<T, D>::TransformedShape(const Shape<T, D> &s, const Affi
 { }
 
 template<typename T, unsigned D>
-inline TransformedShape<T, D>::TransformedShape(const TransformedShape &other):
+inline TransformedShape<T, D>::TransformedShape(const TransformedShape<T, D> &other):
        shape(other.shape->clone()),
        transformation(other.transformation),
        inverse_trans(other.inverse_trans)