diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
| commit | c068f22329d5cc722622a2183bbb22eef2093df7 (patch) | |
| tree | 12d56c1aede67988a55e241364606bfbb4dba933 /tool_src/BspLib/Vertex.cpp | |
| download | openparsec-main.tar.xz openparsec-main.zip | |
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 + +//----------------------------------------------------------------------------- |
