+ //void encloseVertices(const Vector vertices[], unsigned count);
+
+ //void draw(Scalar alpha = 0.0) const;
+ //bool isVisible(const Frustum& frustum) const;
+
+ void encloseVertices(const Vector vertices[], unsigned count)
+ {
+ // TODO
+ }
+
+ void draw(Scalar alpha = 0.0) const;
+
+ bool isVisible(const Frustum& frustum) const
+ {
+ return true;
+ }
+
+
+ bool intersect(const Sphere<D>& sphere, Contact<D>& hit) const
+ {
+ Vector n = sphere.point - point;
+ Scalar distance = n.length();
+ Scalar limit = radius + sphere.radius;
+
+ if (distance > limit) return false;
+
+ hit.normal = n.normalize();
+ hit.distance = limit - distance;
+ hit.point = hit.normal * radius;
+
+ return true;
+ }
+
+ bool intersect(const Vector& point2, Contact<D>& hit) const
+ {
+ Vector n = point2 - point;
+ Scalar distance = n.length();
+
+ if (distance > radius) return false;
+
+ hit.normal = n.normalize();
+ hit.distance = radius - distance;
+ hit.point = point2;
+
+ return true;
+ }