/////////////////////////////////////////////////////////////////////////////// // // ## ###### // ###### ### // ## ############### Shark 3D Engine (www.shark3d.com) // ########## # # # // ######## Copyright (c) 1996-2006 Spinor GmbH. // ######### # # # All rights reserved. // ## ########## // ## // /////////////////////////////////////////////////////////////////////////////// //@cpp #ifndef S3D_ENG_SPECIALSHADER_OPTICS_UTIL_H #define S3D_ENG_SPECIALSHADER_OPTICS_UTIL_H #include "../../interf/eng_gfxstruct.h" #include "../../interf/eng_shader.h" /////////////////////////////////////////////////////////////////////////////// //@ class gtp_ShaderOpticsUtil { public: static bool CalcViewNormalDist( s3d_CUtilVec3f &ViewNormal, float &ViewDist, s3d_CUtilTranslQuatf_cr ViewTransf); static bool CalcChildCamFull( s3d_CEngGfxCam &ChildCam, void *Exclude, int MaxRecursion, float Coeff, float Precision, bool UseCompactFrustum, s3d_CEngShaderScope *Scope, s3d_CUtilTranslQuatf_cr ViewTransf, s3d_CUtilVec3f_cr ViewNormal, float ViewDist); static bool CalcChildRange( s3d_CUtilVec3f &SubNeg, s3d_CUtilVec3f &SubPos, s3d_CUtilTranslQuatf_cr ViewTransf, s3d_CUtilVec3f_cr BoundCen, s3d_CUtilVec3f_cr BoundExt, s3d_CEngShaderScope *Scope); static void SnapChildRange( s3d_CUtilVec3f &SubNeg, s3d_CUtilVec3f &SubPos, int SnapWidth, int SnapHeight); static void ApplyRangeToChildCam( s3d_CEngGfxCam &ChildCam, s3d_CUtilMat4x4f &BaseProj, s3d_CUtilVec3f_cr SubNeg, s3d_CUtilVec3f_cr SubPos); static int RoundToPowerOfTwoDown(int x); static int RoundToPowerOfTwoUp(int x); }; /////////////////////////////////////////////////////////////////////////////// #endif