blob: 416497784be621d2d6435e08af9f8bab0fae6d24 (
plain) (
blame)
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
74
75
76
77
78
79
80
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef GROUND_LINE_H
#define GROUND_LINE_H
#ifdef _WIN32
#pragma once
#endif
#include "mathlib/vector.h"
#include "hud_minimap.h"
class IMaterial;
#define MAX_GROUNDLINE_SEGMENTS 100
// This class will lay out a line of a specified width along the ground. It follows
// the contour of the ground as well as it can.
class CGroundLine : public vgui::Panel
{
typedef vgui::Panel BaseClass;
public:
CGroundLine();
~CGroundLine();
// One-time initialization.
bool Init(const char *pMaterialName);
// Setup the line's rendering parameters.
void SetParameters(
const Vector &vStart,
const Vector &vEnd,
const Vector &vStartColor, // Color values 0-1
const Vector &vEndColor, // Color values 0-1
float alpha,
float lineWidth
);
// Called by the renderer when it's time to render the ground lines.
static void DrawAllGroundLines();
// Set the visibility
void SetVisible( bool bVisible );
bool IsVisible( void );
private:
// Draw a line along the ground.
void Draw();
void Paint();
private:
// Rendering parameters.
IMaterial *m_pMaterial;
Vector m_vStartColor;
Vector m_vEndColor;
float m_Alpha;
Vector m_vStart;
Vector m_vEnd;
float m_LineWidth;
bool m_bVisible;
// Points along the line.
Vector m_Points[MAX_GROUNDLINE_SEGMENTS];
unsigned int m_nPoints;
unsigned short m_ListHandle;
};
#endif // GROUND_LINE_H
|