CrystalSpace

Public API Reference

cstool/rviewclipper.h

00001 /*
00002   Copyright (C) 2007 by Jorrit Tyberghein
00003 
00004   This library is free software; you can redistribute it and/or
00005   modify it under the terms of the GNU Library General Public
00006   License as published by the Free Software Foundation; either
00007   version 2 of the License, or (at your option) any later version.
00008 
00009   This library is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012   Library General Public License for more details.
00013 
00014   You should have received a copy of the GNU Library General Public
00015   License along with this library; if not, write to the Free
00016   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CSTOOL_RVIEW_CLIPPER_H__
00020 #define __CSTOOL_RVIEW_CLIPPER_H__
00021 
00022 #include "csextern.h"
00023 #include "csutil/csstring.h"
00024 #include "csgeom/transfrm.h"
00025 
00026 class csRenderContext;
00027 class csBox3;
00028 
00029 namespace CS
00030 {
00035   class CS_CRYSTALSPACE_EXPORT RenderViewClipper
00036   {
00037   private:
00043     static void TestSphereFrustumWorld (csRenderContext* frust,
00044       const csVector3& center, float radius, bool& inside, bool& outside);
00045 
00046   public:
00050     static void CalculateClipSettings (csRenderContext* ctxt,
00051         uint32 frustum_mask, int &clip_portal, int &clip_plane,
00052         int &clip_z_plane);
00053 
00059     static bool TestBSphere (
00060       csRenderContext* ctxt,
00061       const csReversibleTransform &w2c,
00062       const csSphere &sphere);
00063 
00070     static bool CullBSphere (
00071       csRenderContext* ctxt,
00072       const csSphere &cam_sphere,
00073       const csSphere &world_sphere,
00074       int& clip_portal, int& clip_plane, int& clip_z_plane);
00075 
00087     static bool CullBBox (
00088       const csRenderContext* ctxt,
00089       const csPlane3* planes, uint32& frustum_mask,
00090       const csBox3& obox,
00091       int& clip_portal, int& clip_plane, int& clip_z_plane);
00092 
00099     static void SetupClipPlanes (
00100       csRenderContext* ctxt,
00101       const csReversibleTransform& tr_o2c,
00102       csPlane3* planes, uint32& frustum_mask);
00103 
00107     static void SetupClipPlanes (csRenderContext* ctxt);
00108   };
00109 }
00110 
00111 #endif // __CSTOOL_RVIEW_CLIPPER_H__
00112 

Generated for Crystal Space 1.2.1 by doxygen 1.5.3