diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/utils/vrad/vrad_dispcoll.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/utils/vrad/vrad_dispcoll.h')
| -rw-r--r-- | mp/src/utils/vrad/vrad_dispcoll.h | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/mp/src/utils/vrad/vrad_dispcoll.h b/mp/src/utils/vrad/vrad_dispcoll.h index 668d3118..787c3137 100644 --- a/mp/src/utils/vrad/vrad_dispcoll.h +++ b/mp/src/utils/vrad/vrad_dispcoll.h @@ -1,80 +1,80 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#ifndef VRAD_DISPCOLL_H
-#define VRAD_DISPCOLL_H
-#pragma once
-
-#include <assert.h>
-#include "DispColl_Common.h"
-
-//=============================================================================
-//
-// VRAD specific collision
-//
-#define VRAD_QUAD_SIZE 4
-
-struct CPatch;
-
-class CVRADDispColl : public CDispCollTree
-{
-public:
-
- // Creation/Destruction Functions
- CVRADDispColl();
- ~CVRADDispColl();
- bool Create( CCoreDispInfo *pDisp );
-
- // Patches.
- bool InitPatch( int iPatch, int iParentPatch, int iChild, Vector *pPoints, int *pIndices, float &flArea );
- bool InitParentPatch( int iPatch, Vector *pPoints, float &flArea );
- float CreateParentPatches( void );
- void CreateChildPatches( int iParentPatch, int nLevel );
- void CreateChildPatchesFromRoot( int iParentPatch, int *pChildPatch );
- void CreateChildPatchesSub( int iParentPatch );
-
- // Operations Functions
- void BaseFacePlaneToDispUV( Vector const &vecPlanePt, Vector2D &dispUV );
- void DispUVToSurfPoint( Vector2D const &dispUV, Vector &vecPoint, float flPushEps );
- void DispUVToSurfNormal( Vector2D const &dispUV, Vector &vecNormal );
-
- // Data.
- inline float GetSampleRadius2( void ) { return m_flSampleRadius2; }
- inline float GetPatchSampleRadius2( void ) { return m_flPatchSampleRadius2; }
-
- inline int GetParentIndex( void ) { return m_iParent; }
- inline void GetParentFaceNormal( Vector &vecNormal ) { vecNormal = m_vecStabDir; }
-
- inline void GetVert( int iVert, Vector &vecVert ) { Assert( ( iVert >= 0 ) && ( iVert < GetSize() ) ); vecVert = m_aVerts[iVert]; }
- inline void GetVertNormal( int iVert, Vector &vecNormal ) { Assert( ( iVert >= 0 ) && ( iVert < GetSize() ) ); vecNormal = m_aVertNormals[iVert]; }
- inline Vector2D const& GetLuxelCoord( int iLuxel ) { Assert( ( iLuxel >= 0 ) && ( iLuxel < GetSize() ) ); return m_aLuxelCoords[iLuxel]; }
-
- // Raytracing
- void AddPolysForRayTrace( void );
-
-protected:
-
- void CalcSampleRadius2AndBox( dface_t *pFace );
-
- // Utility.
- void DispUVToSurf_TriTLToBR( Vector &vecPoint, float flPushEps, float flU, float flV, int nSnapU, int nSnapV, int nWidth, int nHeight );
- void DispUVToSurf_TriBLToTR( Vector &vecPoint, float flPushEps, float flU, float flV, int nSnapU, int nSnapV, int nWidth, int nHeight );
- void GetSurfaceMinMax( Vector &boxMin, Vector &boxMax );
- void GetMinorAxes( Vector const &vecNormal, int &nAxis0, int &nAxis1 );
-
-protected:
-
- int m_iParent; // Parent index
- float m_flSampleRadius2; // Sampling radius
- float m_flPatchSampleRadius2; // Patch sampling radius (max bound)
- float m_flSampleWidth;
- float m_flSampleHeight;
- CUtlVector<Vector2D> m_aLuxelCoords; // Lightmap coordinates.
- CUtlVector<Vector> m_aVertNormals; // Displacement vertex normals
-};
-
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef VRAD_DISPCOLL_H +#define VRAD_DISPCOLL_H +#pragma once + +#include <assert.h> +#include "DispColl_Common.h" + +//============================================================================= +// +// VRAD specific collision +// +#define VRAD_QUAD_SIZE 4 + +struct CPatch; + +class CVRADDispColl : public CDispCollTree +{ +public: + + // Creation/Destruction Functions + CVRADDispColl(); + ~CVRADDispColl(); + bool Create( CCoreDispInfo *pDisp ); + + // Patches. + bool InitPatch( int iPatch, int iParentPatch, int iChild, Vector *pPoints, int *pIndices, float &flArea ); + bool InitParentPatch( int iPatch, Vector *pPoints, float &flArea ); + float CreateParentPatches( void ); + void CreateChildPatches( int iParentPatch, int nLevel ); + void CreateChildPatchesFromRoot( int iParentPatch, int *pChildPatch ); + void CreateChildPatchesSub( int iParentPatch ); + + // Operations Functions + void BaseFacePlaneToDispUV( Vector const &vecPlanePt, Vector2D &dispUV ); + void DispUVToSurfPoint( Vector2D const &dispUV, Vector &vecPoint, float flPushEps ); + void DispUVToSurfNormal( Vector2D const &dispUV, Vector &vecNormal ); + + // Data. + inline float GetSampleRadius2( void ) { return m_flSampleRadius2; } + inline float GetPatchSampleRadius2( void ) { return m_flPatchSampleRadius2; } + + inline int GetParentIndex( void ) { return m_iParent; } + inline void GetParentFaceNormal( Vector &vecNormal ) { vecNormal = m_vecStabDir; } + + inline void GetVert( int iVert, Vector &vecVert ) { Assert( ( iVert >= 0 ) && ( iVert < GetSize() ) ); vecVert = m_aVerts[iVert]; } + inline void GetVertNormal( int iVert, Vector &vecNormal ) { Assert( ( iVert >= 0 ) && ( iVert < GetSize() ) ); vecNormal = m_aVertNormals[iVert]; } + inline Vector2D const& GetLuxelCoord( int iLuxel ) { Assert( ( iLuxel >= 0 ) && ( iLuxel < GetSize() ) ); return m_aLuxelCoords[iLuxel]; } + + // Raytracing + void AddPolysForRayTrace( void ); + +protected: + + void CalcSampleRadius2AndBox( dface_t *pFace ); + + // Utility. + void DispUVToSurf_TriTLToBR( Vector &vecPoint, float flPushEps, float flU, float flV, int nSnapU, int nSnapV, int nWidth, int nHeight ); + void DispUVToSurf_TriBLToTR( Vector &vecPoint, float flPushEps, float flU, float flV, int nSnapU, int nSnapV, int nWidth, int nHeight ); + void GetSurfaceMinMax( Vector &boxMin, Vector &boxMax ); + void GetMinorAxes( Vector const &vecNormal, int &nAxis0, int &nAxis1 ); + +protected: + + int m_iParent; // Parent index + float m_flSampleRadius2; // Sampling radius + float m_flPatchSampleRadius2; // Patch sampling radius (max bound) + float m_flSampleWidth; + float m_flSampleHeight; + CUtlVector<Vector2D> m_aLuxelCoords; // Lightmap coordinates. + CUtlVector<Vector> m_aVertNormals; // Displacement vertex normals +}; + #endif // VRAD_DISPCOLL_H
\ No newline at end of file |