frustum.h
上传用户:qccn516
上传日期:2013-05-02
资源大小:3382k
文件大小:1k
- /* Frustum
- *
- * Copyright (C) 2003-2004, Alexander Zaprjagaev <frustum@frustum.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
- #ifndef __FRUSTUM_H__
- #define __FRUSTUM_H__
- #include "mathlib.h"
- class Portal;
- class Frustum {
- public:
- Frustum();
- ~Frustum();
-
- void get();
- void set(const mat4 &m);
-
- void addPortal(const vec3 &point,const vec3 *points);
- void removePortal();
-
- int inside(const vec3 &min,const vec3 &max);
- int inside(const vec3 ¢er,float radius);
- int inside(const vec3 *points,int num);
- int inside(const vec3 &light,float light_radius,const vec3 ¢er,float radius);
- int inside_all(const vec3 &min,const vec3 &max);
- int inside_all(const vec3 ¢er,float radius);
-
- protected:
-
- enum {
- DEPTH = 16,
- };
-
- int num_planes;
- vec4 *planes;
- int depth;
- };
- #endif /* __FRUSTUM_H__ */