00001 #ifndef PLANECOLLIDER_H_INCLUDED 00002 #define PLANECOLLIDER_H_INCLUDED 00003 00004 #include "Collider.h" 00005 #include "CGLA/Vec2f.h" 00006 00007 using namespace CGLA; 00008 00009 class PlaneCollider: public Collider{ 00010 public : 00011 static const RTTI TYPE; 00012 virtual const RTTI& getType() const{ return TYPE; } 00013 00014 protected: 00015 Vec3f center; 00016 Vec3f normal; 00017 Vec2f size; 00018 00019 public: 00020 PlaneCollider(); 00021 PlaneCollider(const Vec3f& center, const Vec3f& normal, const Vec2f& size); 00022 ~PlaneCollider(); 00023 00024 void renderGuizmo()const; 00025 00026 Vec3f getNormal()const{ return normal; } 00027 Vec3f getWorldNormal()const; 00028 Vec3f getCenter()const{ return center; } 00029 Vec2f getSize()const{ return size; } 00030 00031 bool rayCast(const Ray& ray, RayCastHit& hit)const; 00032 }; 00033 00034 #endif