00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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