1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef DECAL_CLIP_H
#define DECAL_CLIP_H
#ifdef _WIN32
#pragma once
#endif
#include "mathlib/vector.h"
#include "mathlib/vector2d.h"
#include "mathlib/compressed_vector.h"
#include "materialsystem/imaterialsystem.h"
#include "materialsystem/imaterial.h"
#include "filesystem.h"
#include "decal_private.h"
#include "gl_model_private.h"
#define MAX_DECALCLIPVERT 48
class CDecalVert
{
public:
Vector m_vPos;
int m_decalIndex; // used by the cache code
// These are the texcoords for the decal itself
Vector2D m_ctCoords;
// Lightmap texcoords for the decal.
Vector2D m_cLMCoords;
};
// Clip pOutVerts/nStartVerts into the decal's texture space.
CDecalVert* R_DoDecalSHClip(
CDecalVert *pInVerts,
CDecalVert *pOutVerts,
decal_t *pDecal,
int nStartVerts,
const Vector &vecNormal );
// Generate clipped vertex list for decal pdecal projected onto polygon psurf
CDecalVert* R_DecalVertsClip(
CDecalVert *pOutVerts,
decal_t *pDecal,
SurfaceHandle_t surfID,
IMaterial *pMaterial );
// Compute the unscaled basis for the decal.
void R_DecalComputeBasis(
Vector const& surfaceNormal,
Vector const* pSAxis,
Vector* textureSpaceBasis );
// Compute the basis for the decal and scale the axes so the whole decal fits
// into the (0,0) - (1,1) range.
void R_SetupDecalTextureSpaceBasis(
decal_t *pDecal,
Vector &vSurfNormal,
IMaterial *pMaterial,
Vector textureSpaceBasis[3],
float decalWorldScale[2] );
extern ALIGN16 CDecalVert g_DecalClipVerts[MAX_DECALCLIPVERT] ALIGN16_POST;
#endif // DECAL_CLIP_H
|