X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FSphere.hh;h=d6903564eac5309c59f6f793eef60e8ea0c0844b;hp=8a9d5e6e0008418ccc9e4885a87d5ad38ffd27e3;hb=64bd443538f57ad1bdff6c6b35953e72141129b2;hpb=fe9614821670d9affcb68fb3e45723b9d40d0b7e diff --git a/src/Moof/Sphere.hh b/src/Moof/Sphere.hh index 8a9d5e6..d690356 100644 --- a/src/Moof/Sphere.hh +++ b/src/Moof/Sphere.hh @@ -56,16 +56,22 @@ struct Sphere : public Cullable, public Drawable point(x, y, z), radius(r) {} - inline void init(const Vector3& p, Scalar r) + void init(const Vector3& p, Scalar r) { point = p; radius = r; } + void init(const Vector3& p, const Vector3& o) + { + point = p; + radius = (o - p).length(); + } + void encloseVertices(const Vector3 vertices[], unsigned count); void draw(Scalar alpha = 0.0) const; - bool isVisible(const Camera& cam) const; + bool isVisible(const Frustum& frustum) const; };