diff options
Diffstat (limited to 'tool_src/BspLib/Vertex.cpp')
| -rw-r--r-- | tool_src/BspLib/Vertex.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tool_src/BspLib/Vertex.cpp b/tool_src/BspLib/Vertex.cpp new file mode 100644 index 0000000..f46b038 --- /dev/null +++ b/tool_src/BspLib/Vertex.cpp @@ -0,0 +1,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 + +//----------------------------------------------------------------------------- |
