aboutsummaryrefslogtreecommitdiff
path: root/tool_src/BspLib/Vertex.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
commitc068f22329d5cc722622a2183bbb22eef2093df7 (patch)
tree12d56c1aede67988a55e241364606bfbb4dba933 /tool_src/BspLib/Vertex.cpp
downloadopenparsec-c068f22329d5cc722622a2183bbb22eef2093df7.tar.xz
openparsec-c068f22329d5cc722622a2183bbb22eef2093df7.zip
initial importHEADmain
Diffstat (limited to 'tool_src/BspLib/Vertex.cpp')
-rw-r--r--tool_src/BspLib/Vertex.cpp47
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
+
+//-----------------------------------------------------------------------------