00001
00002
00003
00004
00005
00006 #ifndef RC_SPHERE_H
00007 #define RC_SPHERE_H
00008
00009 class AABox;
00010
00011 class Sphere : public Volume {
00012
00013 public:
00014
00015 void setRadius(
00016 f32 nradius
00017 );
00018
00019 void combine(
00020 Sphere *sphere
00021 );
00022
00023
00024
00025 vec3f getCentrum();
00026
00027 f32 volume();
00028
00029 bool encloses(
00030 vec3f *point
00031 );
00032
00033 bool intersect(
00034 Ray *ray
00035 );
00036
00037 bool intersect(
00038 Ray *ray,
00039 f32 *dist
00040 );
00041
00042 bool intersect(
00043 AABox *aabox
00044 );
00045
00046 bool intersect(
00047 Sphere *sphere
00048 );
00049
00050 void calculateBounds(
00051 VertexArray *vertexArray,
00052 f32 overCompensate
00053 );
00054
00055 public:
00056
00057 vec3f origin;
00058 f32 radius;
00059 f32 radiusSquared;
00060
00061 };
00062
00063 #endif
00064