aboutsummaryrefslogtreecommitdiff
path: root/tool_src/BspLib/LineSeg2.h
blob: 96cdbb81a2c9bc8b362e6894434fbf8e85251793 (plain)
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
//-----------------------------------------------------------------------------
//	BSPLIB HEADER: LineSeg2.h
//
//  Copyright (c) 1997 by Markus Hadwiger
//  All Rights Reserved.
//-----------------------------------------------------------------------------

#ifndef _LINESEG2_H_
#define _LINESEG2_H_

// bsplib header files
#include "BspLibDefs.h"
#include "Vector2.h"


BSPLIB_NAMESPACE_BEGIN


// line segment in 2-space ----------------------------------------------------
//
class LineSeg2 {

public:
	LineSeg2( const Vertex2& basevtx, const Vector2& dirvec );
	~LineSeg2() { }

	int PointOnLineSeg( const Vertex2& vertex ) const;

private:
	Vertex2	m_basevtx;
	Vector2 m_dirvec;
};

// construct a LineSeg2 using a basevertex and a direction vector -------------
inline LineSeg2::LineSeg2( const Vertex2& basevtx, const Vector2& dirvec )
{
	m_basevtx = basevtx;
	m_dirvec  = dirvec;
}


BSPLIB_NAMESPACE_END


#endif // _LINESEG2_H_