00001 00005 /* 00006 Copyright (C) 2001-2006, William Joseph. 00007 All Rights Reserved. 00008 00009 This file is part of GtkRadiant. 00010 00011 GtkRadiant is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 GtkRadiant is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with GtkRadiant; if not, write to the Free Software 00023 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 */ 00025 00026 #if !defined(INCLUDED_CULLABLE_H) 00027 #define INCLUDED_CULLABLE_H 00028 00029 #include "generic/constant.h" 00030 00031 template<typename Element> class BasicVector3; 00032 typedef BasicVector3<float> Vector3; 00033 class Plane3; 00034 class Matrix4; 00035 class AABB; 00036 class Segment; 00037 00038 template<typename Enumeration> class EnumeratedValue; 00039 struct VolumeIntersection; 00040 typedef EnumeratedValue<VolumeIntersection> VolumeIntersectionValue; 00041 00042 class VolumeTest { 00043 public: 00044 00045 virtual ~VolumeTest() {} 00046 00048 virtual bool TestPoint(const Vector3& point) const = 0; 00050 virtual bool TestLine(const Segment& segment) const = 0; 00052 virtual bool TestPlane(const Plane3& plane) const = 0; 00054 virtual bool TestPlane(const Plane3& plane, const Matrix4& localToWorld) const = 0; 00056 virtual VolumeIntersectionValue TestAABB(const AABB& aabb) const = 0; 00058 virtual VolumeIntersectionValue TestAABB(const AABB& aabb, const Matrix4& localToWorld) const = 0; 00059 00060 virtual bool fill() const = 0; 00061 00062 virtual const Matrix4& GetViewport() const = 0; 00063 virtual const Matrix4& GetProjection() const = 0; 00064 virtual const Matrix4& GetModelview() const = 0; 00065 }; 00066 00067 class Cullable { 00068 public: 00069 STRING_CONSTANT(Name, "Cullable"); 00070 00071 virtual ~Cullable() {} 00072 00073 virtual VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const = 0; 00074 }; 00075 00076 #endif