00001 #ifndef SPHERECOLLIDER_H_INCLUDED
00002 #define SPHERECOLLIDER_H_INCLUDED
00003
00004 #include "Collider.h"
00005 #include "CGLA/Vec3f.h"
00006
00007 class SphereCollider: public Collider{
00008 public :
00009 static const RTTI TYPE;
00010 virtual const RTTI& getType() const{ return TYPE; }
00011
00012 protected:
00013 Vec3f center;
00014 float radius;
00015
00016 public:
00017 SphereCollider();
00018 ~SphereCollider();
00019
00020 void renderGuizmo()const;
00021
00022 void setRadius(float rad);
00023 float getRadius()const{ return radius; }
00024 Vec3f getCenter()const{ return center; }
00025
00026 bool rayCast(const Ray& ray, RayCastHit& hit)const;
00027 };
00028
00029 #endif