aboutsummaryrefslogtreecommitdiff
path: root/tool_src/BspLib/Vertex.cpp
blob: f46b038afebe9ed2796c0cfa971d76c06ca13095 (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
47
//-----------------------------------------------------------------------------
//	BSPLIB MODULE: Vertex.cpp
//
//  Copyright (c) 1996-1997 by Markus Hadwiger
//  All Rights Reserved.
//-----------------------------------------------------------------------------

// bsplib headers
#include "Vertex.h"


BSPLIB_NAMESPACE_BEGIN


// set specified coordinate to specified value --------------------------------
void Vertex3::ChangeAxis( const char xchar, const hprec_t src )
{
	switch ( xchar ) {
		case 'x':
			X = src;
			break;
		case 'y':
			Y = src;
			break;
		case 'z':
			Z = src;
			break;
		default:
			fflush( stdout );
			fprintf( stderr, "\n\n**ERROR** [illegal xchange parameters]\n" );
			exit( EXIT_FAILURE );
	}
}

// change all axes according to xchange-command -------------------------------
void Vertex3::ChangeAxes( const char *xchangecmd, const Vertex3& ads )
{
	Vertex3 temp = *this;
	ChangeAxis( xchangecmd[ 0 ], temp.X * ads.X );
	ChangeAxis( xchangecmd[ 1 ], temp.Y * ads.Y );
	ChangeAxis( xchangecmd[ 2 ], temp.Z * ads.Z );
}


BSPLIB_NAMESPACE_END

//-----------------------------------------------------------------------------