<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>HERETIC DEVELOPER</title>
 <link href="https://heretic-developer.com/atom.xml" rel="self"/>
 <link href="https://heretic-developer.com/"/>
 <updated>2026-09-20T16:29:57+02:00</updated>
 <id>https://heretic-developer.com</id>
 <author>
   <name>acacia</name>
   <email>doA@niggerflip.com</email>
 </author>

 
 <entry>
   <title>Dev setup 2026</title>
   <link href="https://heretic-developer.com/2026/04/30/dev-setup-2026"/>
   <updated>2026-04-30T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2026/04/30/Dev-Setup-2026</id>
   <content type="html">&lt;h2 id=&quot;my-use-case&quot;&gt;My use case&lt;/h2&gt;
&lt;p&gt;I mainly work on a cross platform game written in C++. &lt;br /&gt;
With this purpose in mind this is my current dev setup as of 2026.&lt;/p&gt;

&lt;h1 id=&quot;clients&quot;&gt;Clients&lt;/h1&gt;

&lt;h2 id=&quot;main-desktop-pc&quot;&gt;Main desktop PC&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;OS: Manjaro Linux x86_64&lt;/li&gt;
  &lt;li&gt;CPU: Intel i5-8400 (6) @ 4.000GHz&lt;/li&gt;
  &lt;li&gt;GPU: Intel CoffeeLake-S GT2 [UHD Graphics 630]&lt;/li&gt;
  &lt;li&gt;GPU: NVIDIA GeForce RTX 3060 12GB VRAM&lt;/li&gt;
  &lt;li&gt;RAM: 32GB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I do 90%+ of my computing on this machine.&lt;/p&gt;

&lt;h2 id=&quot;windows-pc&quot;&gt;Windows PC&lt;/h2&gt;
&lt;p&gt;I use this for debugging my game on Windows and for Photoshop. &lt;br /&gt;
It’s a Dell 7010 Thinclient.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;OS: Windows&lt;/li&gt;
  &lt;li&gt;CPU: Intel i5 13500 / up to 4.8 GHz&lt;/li&gt;
  &lt;li&gt;GPU: GIGABYTE GeForce GT 1030 Low Profile&lt;/li&gt;
  &lt;li&gt;RAM: 16 GB&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;laptop&quot;&gt;Laptop&lt;/h2&gt;
&lt;p&gt;When I travel or work not from home, I bring a MacBook Air M2.&lt;br /&gt;
I used to run a refurbished Thinkpad T495 (AMD Ryzen 3 PRO 3300U) running Linux.&lt;/p&gt;

&lt;p&gt;I switched around October 2024, because I need to have an Apple machine to be able to compile for macOS.
Also the overall quality of the MacBook is much better. Especially the trackpad and display.&lt;/p&gt;

&lt;h1 id=&quot;servers&quot;&gt;Servers&lt;/h1&gt;

&lt;h2 id=&quot;promox&quot;&gt;Promox&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Jenkins&lt;/li&gt;
  &lt;li&gt;Build nodes
    &lt;ul&gt;
      &lt;li&gt;Windows 10&lt;/li&gt;
      &lt;li&gt;Debian Linux (Linux and Emscripten builds)&lt;/li&gt;
      &lt;li&gt;macOS (eventually)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I run this on a Fujitsu Esprimo E920.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Intel Core i5-4590 CPU @ 3.30GHz&lt;/li&gt;
  &lt;li&gt;16GB RAM&lt;/li&gt;
  &lt;li&gt;1TB HDD&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;gitlab&quot;&gt;Gitlab&lt;/h2&gt;
&lt;p&gt;I selfhost Gitlab on a Veriton N4640G Thinclient to be able to access my repos across devices,
and to be able to build them using Jenkins.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;OS: Debian Linux&lt;/li&gt;
  &lt;li&gt;CPU: Intel®Celeron® 3900T 2x2.60GHz&lt;/li&gt;
  &lt;li&gt;RAM: 8GB DDR4&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;
&lt;p&gt;I utilize cheap hardware to create selfhosted services. Most of the hardware mentioned
I bought for about 100$ a piece off of Amazon. They’re not the latest and greatest,
but they’re good enough for my setup.&lt;/p&gt;

&lt;p&gt;In closing: To me infrastructure and data is more important than the machine I use to connect to it.
As long as I can access my data and services I’m fine.&lt;/p&gt;

&lt;p&gt;I plan on dowsizing my setup for future.&lt;br /&gt;
I haven’t fully figured out how to approach this, but I will do it eventually!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>idTech 4 coding style</title>
   <link href="https://heretic-developer.com/2025/11/14/idtech4-coding-style"/>
   <updated>2025-11-14T00:00:00+01:00</updated>
   <id>https://heretic-developer.com/2025/11/14/IdTech4-Coding-Style</id>
   <content type="html">&lt;h1 id=&quot;idsoftware-coding-style-idtech4&quot;&gt;idSoftware Coding Style (idTech4)&lt;/h1&gt;
&lt;p&gt;#programming #idsoftware #style&lt;/p&gt;

&lt;h2 id=&quot;general&quot;&gt;General&lt;/h2&gt;
&lt;hr /&gt;
&lt;p&gt;Use real &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tabs&lt;/code&gt; that equal 4 spaces.&lt;/p&gt;

&lt;p&gt;Use typically trailing braces everywhere (if, else, functions, structures, typedefs, class definitions, etc.)&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The else statement starts on the same line as the last closing brace.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Pad parenthesized expressions with spaces&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Instead of&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Instead of&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use precision specification for floating point values unless there is an explicit need for a double.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Instead of&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Instead of&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Function names start with an upper case:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In multi-word function names each word starts with an upper case:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ThisFunctionDoesSomething&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The standard header for functions is:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/*
====================
FunctionName
Description
====================
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Variable names start with a lower case character.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In multi-word variable names the first word starts with a lower case character and each successive word starts with an upper case.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maxDistanceFromPlane&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Typedef names use the same naming convention as variables, however they always end with “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_t&lt;/code&gt;”.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fileHandle_t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Struct names use the same naming convention as variables, however they always end with “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_t&lt;/code&gt;”.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;renderEntity_t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Enum names use the same naming convention as variables, however they always end with “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_t&lt;/code&gt;”. The enum constants use all upper case characters. Multiple words are separated with an underscore.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;enum&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contact_t&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;CONTACT_NONE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;CONTACT_EDGE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;CONTACT_MODELVERTEX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;CONTACT_TRMVERTEX&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Names of recursive functions end with “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_r&lt;/code&gt;”&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;WalkBSP_r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;node&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Defined names use all upper case characters. Multiple words are separated with an underscore.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;cp&quot;&gt;#define SIDE_FRONT 0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use ‘&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;const&lt;/code&gt;’ as much as possible.&lt;/p&gt;

&lt;p&gt;Use:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// pointer to const int&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// const pointer to int&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// const pointer to const int&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Don’t use:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;style&quot;&gt;Style&lt;/h2&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Doom&lt;/em&gt; almost always sticks to a “no in-out” parameter policy; meaning all parameters to a function are either input or output never both.&lt;/p&gt;

&lt;p&gt;Minimal Comments&lt;/p&gt;

&lt;p&gt;Do not waste vertical space nor horizontal space&lt;/p&gt;

&lt;p&gt;Minimal Templates&lt;/p&gt;

&lt;p&gt;Use Orthodox C++ style of coding (C flavored C++)&lt;/p&gt;

&lt;h2 id=&quot;classes&quot;&gt;Classes&lt;/h2&gt;
&lt;hr /&gt;

&lt;p&gt;The standard header for a class is:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/*
===============================================================================
Description
===============================================================================
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Class names start with “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt;” and each successive word starts with an upper case.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idVec3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Class variables have the same naming convention as variables.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idVec3&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Class methods have the same naming convention as functions.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idVec3&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Indent the names of class variables and class methods to make nice columns. The variable type or method return type is in the first column and the variable name or method name is in the second column.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idVec3&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt;         &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt;         &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt;         &lt;span class=&quot;n&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt;         &lt;span class=&quot;n&quot;&gt;Length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ToFloatPtr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*&lt;/code&gt; of the pointer is in the first column because it improves readability when considered part of the type.&lt;/p&gt;

&lt;p&gt;Ording of class variables and methods should be as follows:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;list of friend classes&lt;/li&gt;
  &lt;li&gt;public variables&lt;/li&gt;
  &lt;li&gt;public methods&lt;/li&gt;
  &lt;li&gt;protected variables&lt;/li&gt;
  &lt;li&gt;protected methods&lt;/li&gt;
  &lt;li&gt;private variables&lt;/li&gt;
  &lt;li&gt;private methods&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This allows the public interface to be easily found at the beginning of the class.&lt;/p&gt;

&lt;p&gt;Always make class methods ‘const’ when they do not modify any class variables.&lt;/p&gt;

&lt;p&gt;Avoid use of ‘&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;const_cast&lt;/code&gt;’. When object is needed to be modified, but only const versions are accessible, create a function that clearly gives an editable version of the object. This keeps the control of the ‘const-ness’ in the hands of the object and not the user.&lt;/p&gt;

&lt;p&gt;Return ‘&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;const&lt;/code&gt;’ objects unless the general usage of the object is to change its state. For example, media objects like idDecls should be const to a majority of the code, while idEntity objects tend to have their state modified by a variety of systems, and so are ok to leave non-const.&lt;/p&gt;

&lt;p&gt;Function overloading should be avoided in most cases. For example, instead of:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idAnim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idAnim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idAnim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;randomDiversity&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idAnim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnimByIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idAnim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnimByName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idAnim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetRandomAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;randomDiversity&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Explicitly named functions tend to be less prone to programmer error and inadvertent calls to functions due to wrong data types being passed in as arguments. Example:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Anim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This could be meant as a call to get a random animation, but the compiler would interpret it as a call to get one by index.&lt;/p&gt;

&lt;p&gt;Overloading functions for the sake of adding ‘&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;const&lt;/code&gt;’ accessible function is allowable:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idAnimatedEntity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idEntity&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;idAnimator&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;       &lt;span class=&quot;n&quot;&gt;GetAnimator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idAnimator&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnimator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this case, a const version of GetAnimator was provided in order to allow GetAnimator to be called from const functions. Since idAnimatedEntity is normally a non-const object, this is allowable. For a media type, which is normally const, operator overloading should be avoided:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idDeclMD5&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idDecl&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idMD5Anim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GetAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;animHandle_t&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;idMD5Anim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;       &lt;span class=&quot;n&quot;&gt;GetEditableAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;animHandle_t&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;id-studio-names&quot;&gt;id Studio Names&lt;/h2&gt;
&lt;hr /&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Dlg&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;err&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// dialog class&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Ctrl&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// dialog control class&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Frm&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;  &lt;/span&gt; &lt;span class=&quot;err&quot;&gt;  &lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// frame window&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;err&quot;&gt; &lt;/span&gt; &lt;span class=&quot;err&quot;&gt;  &lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// view window&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;         &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// any other class&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;file-names&quot;&gt;File names&lt;/h2&gt;
&lt;hr /&gt;

&lt;p&gt;Each class should be in a seperate source file unless it makes sense to group several smaller classes.&lt;/p&gt;

&lt;p&gt;The file name should be the same as the name of the class without the “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt;” prefix. (Upper/lower case is preserved.)&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idWinding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;files:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Winding.cpp
Winding.h
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When a class spans across multiple files these files have a name that starts with the name of the class without “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt;”, followed by an underscore and a subsection name.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idRenderWorld&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;files:&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;RenderWorld_load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cpp&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;RenderWorld_demo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cpp&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;RenderWorld_portals&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cpp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When a class is a public virtual interface to a subsystem the public interface is implemented in a header file with the name of the class without “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt;”. The definition of the class that implements the subsystem is placed in a header file with the name of the class without “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt;” and ends with “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_local.h&lt;/code&gt;”. The implementation of the subsystem is placed in a cpp file with the name of the class without “&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt;”.&lt;/p&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;idRenderWorld&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;RenderWorld&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// public virtual idRenderWorld interface&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;RenderWorld_local&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// definition of class idRenderWorldLocal&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;RenderWorld&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cpp&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// implementation of idRenderWorldLocal&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Prototype 0</title>
   <link href="https://heretic-developer.com/2025/10/25/prototype-0"/>
   <updated>2025-10-25T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2025/10/25/Prototype-0</id>
   <content type="html">&lt;p&gt;It’s more a tech test rather than a game. &lt;br /&gt;
The tech and infrastructure serves as the bones for everything to come.&lt;/p&gt;

&lt;h2 id=&quot;game-rules&quot;&gt;Game rules&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Kill enemies to gain score&lt;/li&gt;
  &lt;li&gt;Score ticks constantly down&lt;/li&gt;
  &lt;li&gt;Hitting enemies and collecting gems increases fire rate&lt;/li&gt;
  &lt;li&gt;Getting hit reduces HP and shrinks the game play area&lt;/li&gt;
  &lt;li&gt;Don’t get hit and don’t shoot for 5 seconds to gain HP&lt;/li&gt;
  &lt;li&gt;The higher the score, the more damage enemies deal&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;controls&quot;&gt;Controls&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;WASD - Movement&lt;/li&gt;
  &lt;li&gt;Space - Jump&lt;/li&gt;
  &lt;li&gt;ESC - Grab / release mouse&lt;/li&gt;
  &lt;li&gt;Mouse 1 / Primary fire&lt;/li&gt;
  &lt;li&gt;Mouse 2 / Secondary fire&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;V1.0 released on 25. October 2025&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Dot Product Tricks</title>
   <link href="https://heretic-developer.com/2025/10/25/dot-product-tricks"/>
   <updated>2025-10-25T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2025/10/25/Dot-Product-Tricks</id>
   <content type="html">&lt;p&gt;When I first started 3D programming and came across the dot product, I was confused about it. I couldn’t wrap my head around how it could be used.&lt;/p&gt;

&lt;p&gt;Here are some neat use cases I found throughout the years for it&lt;/p&gt;
&lt;h3 id=&quot;it-tells-you-how-similar-two-normalized-vectors-are&quot;&gt;It tells you how similar two normalized vectors are&lt;/h3&gt;
&lt;p&gt;The dot product returns a value in the range of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[-1, +1]&lt;/code&gt;.
&lt;br /&gt;
+1 means the vectors are 100% the same &lt;br /&gt;
0 means that the vectors are perpendicular/orthogonal to each other&lt;br /&gt;
-1 means the vectors are pointing 100% in the opposite direction&lt;br /&gt;&lt;/p&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;similarity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vec_a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vec_b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h1 id=&quot;vector-projection&quot;&gt;Vector Projection&lt;/h1&gt;

&lt;h3 id=&quot;remove-a-vector-from-another&quot;&gt;Remove a vector from another&lt;/h3&gt;

&lt;p&gt;In this example we cancel out the velocity in “gravity direction”.&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// cancel out gravity part from velocity&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vel&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;velocity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gravityNormal&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;velocity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gravityNormal&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This gives you the length of velocity in the gravity direction&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;velocity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gravityNormal&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2 id=&quot;angle-between-two-normalized-vectors&quot;&gt;Angle between two normalized vectors&lt;/h2&gt;
&lt;p&gt;This is useful when you want to get the angle between two vectors.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;float angle_rad = acosf(DotProduct(normalized_vec_a, normalized_vec_b));&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note that the range of angle will be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0° ≤ angle ≤ 180 degrees&lt;/code&gt; and the equivalent in radians &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0° ≤ angle ≤ PI radians&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;acos&lt;/code&gt; gives you only the magnitude of the angle between the vectors, it doesn’t give you the direction.&lt;/p&gt;

&lt;p&gt;If you use this to rotate an object using this angle, you’ll need to make adjustment to the result if you want to make it look at a target for example.&lt;/p&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Define a normal (usually something like vec3(0, 0, 1) for XY plane)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;vec3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normal&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;...;&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;angle&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;acos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;normalized_a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normalized_b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 0 to π&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;vec3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cross&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CrossProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;normalized_a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normalized_b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Use the direction of the cross product to determine sign&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cross&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;angle&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;M_PI&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;angle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h1 id=&quot;clip-vector-to-plane&quot;&gt;Clip vector to plane&lt;/h1&gt;

&lt;p&gt;I’m not sure what the proper terminology is to describe this, but you can use the dot product in the following way to change the length of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vectorToClip&lt;/code&gt; so that it ends up on the plane normal.&lt;/p&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;VectorClipToVectorPlane&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;planeNormal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vectorToClip&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;  
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vectorToClip&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;planeNormal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vectorToClip&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://heretic-developer.com/assets/images/blog/clip.jpg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This clips the red vector to the plane of the black vector.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h1 id=&quot;visibility-tests&quot;&gt;Visibility tests&lt;/h1&gt;
&lt;h2 id=&quot;back-face-culling&quot;&gt;Back face culling&lt;/h2&gt;
&lt;p&gt;If you want to check, you are viewing the front side of a triangle, you can use this.
This can be used for checking, if something is looking at something&lt;/p&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;backface_culled&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;plane_normal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;view_dir&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;backface_culled&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// not visible&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 

&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;is_looking_at&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enemy_view_dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorNormalize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;other_obj_pos&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enemy_pos&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;is_looking_at&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;c1&quot;&gt;// sees the front face of the other object&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2 id=&quot;view-cone-visibility&quot;&gt;View Cone Visibility&lt;/h2&gt;
&lt;p&gt;You can expand the above case to a view cone of a specified angle width&lt;/p&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;is_looking_at&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DotProduct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enemy_view_dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorNormalize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;other_obj_pos&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enemy_pos&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DEGREES_TO_RADIANS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static_cast&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;M_PI&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;180.0&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dot_angles&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cosf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;45.0&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DEGREES_TO_RADIANS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;is_looking_at&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dot_angles&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;c1&quot;&gt;// other object is in view cone of enemy&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h1 id=&quot;vector-rejection-coming-soon&quot;&gt;Vector Rejection (Coming soon)&lt;/h1&gt;
&lt;h2 id=&quot;project-onto-plane&quot;&gt;Project onto plane&lt;/h2&gt;

&lt;h2 id=&quot;wall-sliding&quot;&gt;Wall sliding&lt;/h2&gt;
</content>
 </entry>
 
 <entry>
   <title>Example book entry</title>
   <link href="https://heretic-developer.com/2025/06/01/example-reading-log"/>
   <updated>2025-06-01T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2025/06/01/Example-Reading-Log</id>
   <content type="html">&lt;p&gt;Use this post as a template: set &lt;strong&gt;cover&lt;/strong&gt; to your jacket image (paths are relative to the site root), &lt;strong&gt;subtitle&lt;/strong&gt; for a one-line summary, &lt;strong&gt;author&lt;/strong&gt;, optional &lt;strong&gt;booklink&lt;/strong&gt; for a store or reference URL, and &lt;strong&gt;category: [ books ]&lt;/strong&gt; so it appears on the books page.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Meritocracy</title>
   <link href="https://heretic-developer.com/2025/02/14/meritocracy"/>
   <updated>2025-02-14T00:00:00+01:00</updated>
   <id>https://heretic-developer.com/2025/02/14/Meritocracy</id>
   <content type="html">&lt;p&gt;Academia went to shit in the last couple of decades, due to an influx of political correctness and other woke mindviruses, and bred new generations of ““yes-people””, who never question what they’ve been taught in university and who aren’t able to have an original thought on anything which might contradict what they’ve been told by authority.&lt;/p&gt;

&lt;p&gt;These indoctrinated yes-man flood tech companies and produce slop by “design by committee”.
There should always be one person in charge with a clear vision instead of a room full of confused people who only follow best practices and don’t have an inner monologue.&lt;/p&gt;

&lt;h1 id=&quot;companies-dont-hire-for-skills-anymore&quot;&gt;Companies don’t hire for skills anymore&lt;/h1&gt;

&lt;p&gt;In a world where meritocracy is viewed as racist and unfair, soon performance metrics will be viewed in the same way, because “youths” can’t rub two brain cells together to produce a solution. Mark my words, this will happen. You can clearly see the evidence in the web development sphere, where nowadays every retard can get a job as long as they have the correct pronouns, skin color or political beliefs.&lt;/p&gt;

&lt;p&gt;If the tech sector doesn’t trim the fat, software development as a field is doomed.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Programming Philosophy</title>
   <link href="https://heretic-developer.com/2024/05/10/programming-philosophy"/>
   <updated>2024-05-10T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2024/05/10/Programming-Philosophy</id>
   <content type="html">&lt;p&gt;Here are some insights of wisdom I picked up over the years.&lt;/p&gt;

&lt;h1 id=&quot;simplicity&quot;&gt;Simplicity&lt;/h1&gt;
&lt;p&gt;Keeping it simple makes your code more robust, easier to debug, and allows you to come back to it and understand it quickly.&lt;/p&gt;

&lt;p&gt;Don’t try to be smarter than you are. This will only hurt you in the future.&lt;/p&gt;

&lt;p&gt;Like Terry Davis pointed out, the hardest question in programming is asking yourself&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Is this niggerlicious or is this divine intellect?
&lt;br /&gt;
Is this too much voodoo?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;focus-on-the-problem-not-the-programming&quot;&gt;Focus on the problem not the programming&lt;/h1&gt;
&lt;p&gt;Don’t get caught up implementing “neat” solutions, which won’t add progress towards finishing your product, but will just “make the code better”. 
At this point it becomes programming porn.&lt;/p&gt;

&lt;p&gt;Just because a solution is interesting to implement, does not mean that you need to implement it at all.
You don’t need to always find the most optimal solution for everything. 
Sometimes a naive and straightforward solution will be more than sufficient.&lt;/p&gt;

&lt;p&gt;You are building a product. 
Don’t fetishize code that much.&lt;/p&gt;

&lt;h1 id=&quot;generic-solutions-take-longer&quot;&gt;Generic solutions take longer&lt;/h1&gt;
&lt;p&gt;There is no need to try and think ahead into the future and generalize every little detail of your implementation to be more “flexible” in the future. 
There might not even be a need in the future for your use case.&lt;/p&gt;

&lt;p&gt;You are basing your assumptions of the future on the problem you are solving in the present. 
The truth is that your are just guessing what you might need in the future. 
Most likely you will guess wrong and you will need to rewrite it anyway when it comes to it.&lt;/p&gt;

&lt;h1 id=&quot;perfectionism-kills-productivity&quot;&gt;Perfectionism kills productivity&lt;/h1&gt;
&lt;p&gt;Trying to write perfect code is a waste of time.&lt;/p&gt;

&lt;p&gt;Know the value of “good enough” and continue to solve other issues. 
It’s never going to be perfect and a good solution today is better than a closer to perfect solution tomorrow. 
Being productive is more important than being perfect.&lt;/p&gt;

&lt;h1 id=&quot;own-your-dependencies&quot;&gt;Own your dependencies&lt;/h1&gt;
&lt;p&gt;You must not be dependend on binary distributions for libraries.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;You’ll have trouble compiling your project for other platforms&lt;/li&gt;
  &lt;li&gt;You won’t be able to extent, fix or debug your dependencies&lt;/li&gt;
  &lt;li&gt;You can’t take a look and check what the code actually does&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;hours-in-is-progress-out&quot;&gt;Hours in, is progress out&lt;/h1&gt;
&lt;p&gt;Keep grinding away on your project. 
&lt;br /&gt;
Each hour invested brings you closer to finishing your product.
&lt;br /&gt;
There is light at the end of the tunnel!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Learn A Build System</title>
   <link href="https://heretic-developer.com/2024/02/18/learn-a-build-system"/>
   <updated>2024-02-18T00:00:00+01:00</updated>
   <id>https://heretic-developer.com/2024/02/18/Learn-A-Build-System</id>
   <content type="html">&lt;p&gt;I had a colleague once, who suggested to me that I should learn CMake. This advice turned out to be golden, hence why I suggest to you the same. However you can chose to learn a different build system as well.&lt;/p&gt;

&lt;p&gt;Knowing a build system is a game changer in how you setup and structure your projects. All of a sudden all your code can be generated/build on various platforms. You no longer need to know the individual, platform specific IDE project setup configurations. You can just learn the build system and it will setup everything correctly for your target.&lt;/p&gt;

&lt;p&gt;This makes it easier for you to adopt the mindset that &lt;strong&gt;infrastructure is more important than the platform&lt;/strong&gt; you are using. It allows you to switch operating systems whenever you want.&lt;/p&gt;

&lt;p&gt;It makes adding external code easy! You can include other projects as part of your project.&lt;/p&gt;

&lt;p&gt;It enables you to build your own work flows, as you can script in CMake. This means you can automate certain things.
You can execute pre build steps and post build steps. Furthermore you can write code as part of the project and run it as a build step on your code base.&lt;/p&gt;

&lt;p&gt;So far learning CMake had one of the biggest impacts on me as a programmer.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Collision Detection Is Hard</title>
   <link href="https://heretic-developer.com/2024/02/13/collision-detection-is-hard"/>
   <updated>2024-02-13T00:00:00+01:00</updated>
   <id>https://heretic-developer.com/2024/02/13/Collision-Detection-Is-Hard</id>
   <content type="html">&lt;p&gt;I was always hesitant with rolling a custom solution for collision detection. This is why in the past I’ve tried to use 3rd party libraries for physics and such, but it always felt wrong to me. Most of the physics libraries I’ve used were big. They would increase my build times by a lot and they all come with their own math classes and other utilities, which I’ve had already implemented. I don’t want to have multiple classes for vectors, matrices, etc. in my codebase. And I don’t like glue code, to make it behave the way I want it to.&lt;/p&gt;

&lt;p&gt;I decided to roll my own physics code, however I have had zero experience in writing &lt;strong&gt;professional grade&lt;/strong&gt; collision code. This destinction here is important. If you are anything like me you learn through reading tutorials online and watching YouTube videos explaining things. However the stuff which is available on YouTube is not usable in a &lt;strong&gt;professional&lt;/strong&gt; game engine. Let me explain why. Most of the things you can find online are mearly scratching the surface of this topic, but are presented in a way that make you think that after finishing the tutorial that you can go and build your custom collision solution. Unfortunately this is not the case. There are so many developers who themselves don’t know what they don’t know about the topic. They will showcase their phyics systems and try to impress you with visuals.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Oh look, how many objects ““my”” code can handle&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most of them also just copy/paste code, and make it look like they came up with something great.&lt;/p&gt;

&lt;p&gt;If you are lucky you will come across more advanced stuff like &lt;strong&gt;GJK&lt;/strong&gt; or some derivative of it. However they will not mention, that &lt;strong&gt;GJK&lt;/strong&gt; is not a silver bullet and don’t present its weaknesses.&lt;/p&gt;

&lt;p&gt;All of the videos I’ve seen only attempt to solve a “static collision resolution”, meaning they just compare objects in fixed time intervals to check if any are stuck inside each other. They don’t solve for “dynamic collisions” or perform “continious collision detection”. The moment you realize that static collision detection is really not suitable for player movement, bullet movement, or any movement which does affect gameplay, you understand how screwed you are. 
People try &lt;strong&gt;cope&lt;/strong&gt; by increasing the physics update frequency by 2x, 4x, etc. in order to not miss collisions to the detriment of performance.
However, even if collisions are not missed they are not resolved properly. You don’t want to &lt;em&gt;JUST&lt;/em&gt; “uncollide” objects, but you want to prevent penetration. You want to slide along walls, you don’t want to get stuck on corners or geometry edges.&lt;/p&gt;

&lt;p&gt;And this is where the journey actually begins. Researching continious collision detection was a painful experience.&lt;/p&gt;

&lt;p&gt;I came across a variety of &lt;em&gt;potential&lt;/em&gt; solutions. Namely Sphere vs. Sphere CCD, Ellipsoid CCD, etc. Besides a &lt;em&gt;poorly performing&lt;/em&gt; GJK CCD derivative I didn’t find anything which did solve generic cases. I did manage to write a custom solution for AABB vs AABB, which actually works really great. It has wall sliding, doesn’t get stuck on geometry edges and performs acceptable.&lt;/p&gt;

&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// AABB vs. AABB only!&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;MOVEMENT_MoveSceneObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SceneObject&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scene_object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_move&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
								&lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SceneObject&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scene&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;eMoveType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;uint32&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorLengthSquared&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total_move&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.0&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

	&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_epsilon_sq&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Square&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.005&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;int32&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;max_recursions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

	&lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valid_move&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total_move&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

	&lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;recurse&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;int32&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;max_recursions&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;recurse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Bounds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bounds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scene_object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetBounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bounds_center&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetCenter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

		&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_dir&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorNormalizeOrZero&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valid_move&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_length&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;recurse&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

		&lt;span class=&quot;c1&quot;&gt;// hit and sort&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Collision&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;collisions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SceneObject&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scene&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Bounds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;other_bounds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetBounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;IntersectionInfo&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;info&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;MovingBoundsIntersectsBounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valid_move&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;other_bounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scene_object&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

			&lt;span class=&quot;c1&quot;&gt;// Don&apos;t clip since we want to detect seams&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;did_hit&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;collisions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;push_back&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;other_bounds&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

		&lt;span class=&quot;c1&quot;&gt;// Find closest hit to object&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Plane&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sorting_plane&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bounds_center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_dir&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;collisions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;begin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;collisions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
				   &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bounds_center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sorting_plane&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;](&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Collision&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Collision&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
					   &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
						   &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SignedDistanceToPlane&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ClosestPointInBounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bounds_center&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sorting_plane&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
								  &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SignedDistanceToPlane&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ClosestPointInBounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bounds_center&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sorting_plane&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
					   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

					   &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;distance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

		&lt;span class=&quot;c1&quot;&gt;// do collision in sorted order and resolve&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;collisions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IntersectionInfo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hit_info&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;collisions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;valid_move&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hit_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Clip movement&lt;/span&gt;

			&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;MOVE_SLIDE&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;Vec3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;slide_move&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorReject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hit_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;surf_norm&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hit_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;recurse&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VectorLengthSquared&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;slide_move&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;move_epsilon_sq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;valid_move&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;slide_move&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;scene_object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SetPosition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
						&lt;span class=&quot;n&quot;&gt;hit_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;final_position&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hit_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;surf_norm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.001&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Poor man&apos;s fix to avoid seams&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;recurse&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;scene_object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SetPosition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hit_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;final_position&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;recurse&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;scene_object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SetPosition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scene_object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetPosition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valid_move&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However I did not want to limit myself to just AABB collisions. So I had to come up with something more flexible.&lt;/p&gt;

&lt;p&gt;At this point I have started digging through the Quake 1 source code once again and started researching how they’ve solved it in the 90’s. I found some articles and random forum posts about the collision system Carmack wrote for Q1.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Collision detection was pretty hard,” he admitted. “There was a good period where we were making interesting pictures, but movement only worked smoothly as long as you were sliding along walls with obtuse angles—you would get ‘stuck’ on sharp corners.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Carmack refined code until he arrived at a solution, albeit not an optimal one. &lt;em&gt;Quake&lt;/em&gt;’s collision detection functions by expanding the size of every object on a map by half the player’s size, treating players as a point moving through terrain. “This was robust and extremely efficient, but it meant that each unique size of entity that moved through the world had to have a special version of the map automatically generated for it,” said Carmack. “This cost both memory and processing time during level building.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.shacknews.com/article/101156/rocket-jump-quake-and-the-golden-age-of-first-person-shooters?page=4&quot;&gt;Shack News&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I can’t speak for Quake 3, I heard somewhere they were using the brushes, but Q1 definitely uses axis-aligned bounding boxes for the objects and collides them with the BSP tree. The way they do this is that they store 4 different trees, one regular tree used for culling and three collision hull trees, used for 3 different sized objects (missiles, small things, people).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;The BSP trees are ‘expanded’ at compile time which means that the collision engine only needs to clip a single line segment into the BSP tree in order to determine whether it is in solid or in space (and also where the collision takes place). The actual technique is a little more involved (requires bevelling) so try searching the web&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.gamedev.net/forums/topic/99001-quake-unreal-terrain-collision-detection/&quot;&gt;GameDev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After reading all that I was a bit disappointed. I did not want to prebake BSP trees and I certainly did not want to limit myself to using only a handful of AABB sizes. I came across a paper by Stefan Melanx about dynamic collisions with BSP trees, where he introduced the concept of shifting planes.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://melax.github.io/bsp/melaxbsp.pdf&quot;&gt;Dynamic Plane Shifting BSP Traversal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.gamedeveloper.com/programming/bsp-collision-detection-as-used-in-mdk2-and-neverwinter-nights&quot;&gt;BSP Collision Detection As Used In MDK2 and NeverWinter Nights&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;BTW: I dont want to “push” BSP’s on anyone.
For example, if you can bang off a simple robust AABB implementation in a day,
and it does what you need, then why not just use that? BSP algorithms can
be harder to understand and implement. Every technology (BSP, aabb, obb, loose octtree, etc.) has advantages and disadvantages.
When deciding, ignore any religious based arguments in favor of technical analysis.- Stefan Melax&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://gdalgorithms-list.narkive.com/V1dw0njB/algorithms-bsp-bevelling&quot;&gt;[Algorithms] BSP bevelling&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After having seen my options, I felt super overwhelmed and tried to code &lt;em&gt;something&lt;/em&gt; up to just have a working solution.&lt;/p&gt;

&lt;p&gt;Having spent bunch of time on this, I found some more info on how to solve it for generic cases in this &lt;a href=&quot;https://gamedev.net/forums/topic/681165-moving-aabb-vs-triaabbsphere-code/5304944/&quot;&gt;thread&lt;/a&gt;.
There’s a reference to Doom3 and this &lt;a href=&quot;https://mrelusive.com/publications/papers/Robust-Continuous-Collision-Detection.pdf&quot;&gt;paper&lt;/a&gt;. TLDR; There are only two cases one must account for to solve CCD for generic triangle based shapes.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Vertex vs. Polygon Face&lt;/li&gt;
  &lt;li&gt;Edge vs. Edge&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In that paper a method is outlined using Plücker coordinates, which was used in Doom3. 
I copied the entire collision system from Doom3, only to find out that it’s not working 100%, because of my internal geometry structure
and that there are certain edge cases where collisions are missed and the player can walk through walls or gets stuck on corners.&lt;/p&gt;

&lt;p&gt;I tried coming up with custom functions to solve the above mentioned cases and it worked, but it didn’t work
well enough. I looked into modern CCD projects on github, which come
with implementations for those functions and found &lt;a href=&quot;https://github.com/Continuous-Collision-Detection/Tight-Inclusion&quot;&gt;Tight-Inclusion&lt;/a&gt; and some others in the same repos. I had troubles getting them to work properly and when I did manage
to get them semi working, the performance was too bad to be usable in a game.&lt;/p&gt;

&lt;p&gt;I could’ve lived with those edge cases, however when I started creating more detailed levels the solution would tank in performance. I did use the axis aligned BSP implementation provided by Doom3, but it still wasn’t fast enough. I assume I made mistakes copying it (In hindsight this is 100% the case, btw).
However I was too annoyed to bother even looking how to speed it up.&lt;/p&gt;

&lt;p&gt;So after more wasted time and effort on trying to fix these issues I had to bite the bullet and use a 3d physics library.
Seemingly randomly I discoverd &lt;a href=&quot;https://github.com/jrouwe/JoltPhysics&quot;&gt;Jolt&lt;/a&gt;, which on the surface looks like
everything I needed. After integrating it into my engine, I was left with disappointment.
The character controller was working quite well, but still it had a bunch of edge cases uncovered and there was
annoying jittering going on when moving up steep surfaces. At this point I was fed up with all of it.&lt;/p&gt;

&lt;p&gt;I decided to go with the most bloated lib I could find in the hopes that it would cover my needs.
I went with NVidia &lt;a href=&quot;https://github.com/NVIDIAGameWorks/PhysX&quot;&gt;physx&lt;/a&gt;. But not just any version of it, no. 
Of course these geniuses make it seemingly extra hard for people to compile their stupid library.
They do use CMake, however it is a clusterfuck to include it in your own project. I had to use &lt;a href=&quot;https://github.com/Dampfwalze/PhysX_CMakeTargets/tree/4.1&quot;&gt;this version&lt;/a&gt;. Fortunetly a guy already has suffered through this and has created a working CMake-fied
version of PhysX, which can be included as part of any CMake project to build from source.&lt;/p&gt;

&lt;p&gt;After compiling it and making it run, I had to do a lot of reading in their API / docs on how to set this thing up etc.
I spent some days on it, but at the end I had a moving character. Here again, the character controller they provide 
does not cover all edge cases and I had to patch ~3 bad behaviors in the PhysX code to make it work was intended.&lt;/p&gt;

&lt;p&gt;It still isn’t as perfect as I want it to be, but at least it performs well.&lt;/p&gt;

&lt;h2 id=&quot;what-i-am-trying-to-say-here-is&quot;&gt;What I am trying to say here is&lt;/h2&gt;

&lt;p&gt;This is by far the most painful topic I had to deal with.
So, maybe, you should consider using a premade library for collision detection after all.&lt;/p&gt;

&lt;p&gt;Besides giving you collision detection tools, they also come with
already implemented acceleration structures, and more stuff you don’t know, you need.&lt;/p&gt;

&lt;p&gt;PhysX and Jolt both have visual debugging built in. 
Try it out first, before you decide to roll your own.
See how fast you can get a working prototype ready to go. 
And then evaluate again, if you really need a custom solution.&lt;/p&gt;

&lt;p&gt;Keep in mind that none of the included character controllers are out of the box production ready.
You will need to implement functionalities for all sorts of things.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>On Noise Cancelling</title>
   <link href="https://heretic-developer.com/2023/08/06/on-noise-cancelling"/>
   <updated>2023-08-06T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2023/08/06/On-Noise-Cancelling</id>
   <content type="html">&lt;p&gt;When you want to program in complete silence without being disturbed by surrounding noise.&lt;/p&gt;

&lt;h2 id=&quot;brown-noise&quot;&gt;Brown Noise&lt;/h2&gt;
&lt;p&gt;Before you start looking into buying headphones, you should try listening to brown noise. 
Even, if you don’t have noise cancelling headphones, listening to low frequency brown noise blocks out a fair amount of ambient noise. 
Give it a try. It’s free.&lt;/p&gt;

&lt;h2 id=&quot;noise-cancelling&quot;&gt;Noise Cancelling&lt;/h2&gt;
&lt;p&gt;I don’t have any experience with active noise cancelling headphones, so I can’t talk about that.
But, &lt;strong&gt;Passive noise cancelling&lt;/strong&gt; works without batteries and doesn’t require an audio signal to block noise. 
However, there are passive ear muffs, which have an audio-jack, through which you can mix in brown noise to eliminate more sound from the surroundings.&lt;/p&gt;

&lt;h3 id=&quot;-hot-tip&quot;&gt;🔥 HOT TIP🔥&lt;/h3&gt;
&lt;blockquote&gt;
  &lt;p&gt;There are Bluetooth audio adapters, which you can plug into any audio jack to make it able to receive audio signals via Bluetooth.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I use passive noise cancelling ear muffs with an audio-jack. I like these, because they aren’t really designed for “office use” but rather for the real world like construction sides, shooting ranges and military applications. You can expect high build quality and reliability. Also they’re cheaper. At first they’re super uncomfortable as they fit really tight on the head and ears. You’ll get used to it however after some time.
I usually use mine with brown noise or some low frequency droning ambient music.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Improve Life Quality With A Rice Cooker</title>
   <link href="https://heretic-developer.com/2023/08/06/improve-life-quality-with-a-rice-cooker"/>
   <updated>2023-08-06T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2023/08/06/Improve-Life-Quality-With-A-Rice-Cooker</id>
   <content type="html">&lt;p&gt;If you are too lazy to cook for yourself, this is a MUST-HAVE. Rice cookers are underrated appliances, which in my opinion everybody should own. Not only can you cook rice in it, but all sorts of things like soups, potatoes, porridge, etc. You also can steam vegetables or dumplings at the same time. This reduces the effort to prepare a good meal to just a couple of steps.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Wash rice&lt;/li&gt;
  &lt;li&gt;Put washed rice into the rice cooker&lt;/li&gt;
  &lt;li&gt;Fill with water&lt;/li&gt;
  &lt;li&gt;Place dumplings into steaming compartment&lt;/li&gt;
  &lt;li&gt;While the rice is cooking, you can cut some fresh vegetables and prepare some meat&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Rice cookers are very affordable, ranging from 30$ to upward of 100$. It really depends on what “features” you need. You don’t need a fancy one to get good results.&lt;/p&gt;

&lt;p&gt;However when it comes to rice, I recommend buying high quality Japanese or Korean rice. They have a very pleasant consistency and in my opinion taste the best. It might cost more than the rice you can buy in your usual stores, but it’s worth to pay the premium.&lt;/p&gt;

&lt;p&gt;Besides that you can buy the following extra ingredients to further expand the amount of recipes you can cook with it.&lt;/p&gt;

&lt;p&gt;Get inspired by Japanese rice cooker recipes on YouTube.&lt;/p&gt;

&lt;h3 id=&quot;recommended-recipes&quot;&gt;Recommended Recipes&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/shorts/Fg5ajriEylw&quot;&gt;Takikomi Gohan (Japanese mixed rice)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/shorts/dV9reLH_t1c&quot;&gt;Tuna Onigiri&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Get Books Before AI Ruins Knowledge</title>
   <link href="https://heretic-developer.com/2023/08/06/get-books-before-ai-ruins-knowledge"/>
   <updated>2023-08-06T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2023/08/06/Get-Books-Before-AI-Ruins-Knowledge</id>
   <content type="html">&lt;p&gt;The internet is quickly becoming an informational wasteland full with regurgitated bullshit.&lt;/p&gt;

&lt;p&gt;It really doesn’t matter which topic you’re trying to look up. Usually you’ll find the same information phrased in a slightly different manner over and over again. It seems like that there is only one way of doing things in the modern era and everybody is just rephrasing it in their own words, presenting it as some sort of original work.&lt;/p&gt;

&lt;p&gt;The things you can read online about any topic are mostly incomplete and are only scratching the surface. If you want to dig deeper it becomes almost impossible. Everybody keeps rewriting the same blog post again and again. YouTube isn’t really better in that regard. People are re-recording the same video with their own personal spin without any added value for the viewer.&lt;/p&gt;

&lt;style&gt;img[alt=copy-of-copy] { display: block; margin: 0 auto; }&lt;/style&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/blog/copy-of-a-copy.gif&quot; alt=&quot;copy-of-copy&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With the advent of generative AI tools like ChatGPT, this problem will amplify itself times infinity. AI is becoming the single source of truth for the masses as it’s much easier for the bugmen to ask ChatGPT something, rather than coming to a conclusion of their own. Soon SEO optimized, AI generated content will flood the internet, drowning out, genuine knowledge and information even more.&lt;/p&gt;

&lt;p&gt;It will become increasingly harder to find deep knowledge. This is why you should get books, while their content is still valuable and not generated by AI. Personally I prefer physical books, but you can get the digital versions as well. It’s up to you. Getting them digitally usually doesn’t require a lot of money, if at all. A lot of great books are circulating online as PDFs, ready to be downloaded.&lt;/p&gt;

&lt;p&gt;Start building your library today.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Mouse Release For Debugging On Linux</title>
   <link href="https://heretic-developer.com/2023/08/01/mouse-release-for-debugging-on-linux"/>
   <updated>2023-08-01T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2023/08/01/Mouse-Release-For-Debugging-On-Linux</id>
   <content type="html">&lt;p&gt;Debugging an application which captures your mouse cursor on Linux, leads to a problem where when a break point is triggered, it doesn’t release your mouse cursor.&lt;/p&gt;

&lt;p&gt;For some people switching between windows with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALT + Tab&lt;/code&gt; makes the mouse reappear. However this doesn’t work for everybody and having to perform additional hand movements in order for the mouse to appear is annoying.&lt;/p&gt;

&lt;p&gt;To solve this issue, we can write a script which will release the mouse automatically when a break point is hit.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Keep in mind, that this will only work for debugging with GDB&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;how-to&quot;&gt;How to&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Create a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdbinit&lt;/code&gt; file, if it doesn’t exist&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/.config/gdb
nano ~/.config/gdb/gdbinit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Add the following content to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdbinit&lt;/code&gt; file&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;auto-load python-scripts on
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; ~/config/gdb/release-mouse-gdb.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Create the Python script&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nano ~/config/gdb/release-mouse-gdb.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Add the following content to script&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/python
&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;os&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;release_mouse&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;setxkbmap -option grab:break_actions&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;xdotool key XF86Ungrab&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;setxkbmap -option&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;gdb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;events&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;release_mouse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gdb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;GDB/X11: installed release mouse for X11&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;That’s it! Just make sure to actually use GDB when debugging&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/ocornut/imgui/issues/4197&quot;&gt;github&lt;/a&gt;
&lt;a href=&quot;https://github.com/ocornut/imgui/issues/3650&quot;&gt;github&lt;/a&gt;
&lt;a href=&quot;https://github.com/ocornut/imgui/issues/3650#issuecomment-1519003458&quot;&gt;github&lt;/a&gt;
&lt;a href=&quot;https://discourse.libsdl.org/t/debugging-with-sdl-capturemouse/31014/3&quot;&gt;libsdl&lt;/a&gt;
&lt;a href=&quot;https://stackoverflow.com/questions/72640670/how-to-automatically-load-pretty-printers-for-gdb-in-clion&quot;&gt;stackoverflow&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Arguments against using Unity/Unreal</title>
   <link href="https://heretic-developer.com/2023/07/01/arguments-against-using-unity-unreal"/>
   <updated>2023-07-01T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2023/07/01/Arguments-Against-Using-Unity-Unreal</id>
   <content type="html">&lt;p&gt;Here are some points to think about before using Unity/Unreal:&lt;/p&gt;

&lt;h2 id=&quot;long-term-support&quot;&gt;Long Term Support&lt;/h2&gt;
&lt;p&gt;Compiling your game in five years might become challenging. Finding and setting up the right Unity/Unreal version could be tricky. Older versions may not support newer platforms. In that case, you will need to update your project to a more recent Unity/Unreal version, which may break things.&lt;/p&gt;

&lt;h2 id=&quot;compatibility&quot;&gt;Compatibility&lt;/h2&gt;
&lt;p&gt;If you want to port your game to a platform that isn’t supported, you’ll run into a roadblock. Unity/Unreal needs to add support for it.You can’t do it yourself. This means your game’s compatibility and success ultimately depend on Unity/Unreal’s decisions.&lt;/p&gt;

&lt;h2 id=&quot;corporate-monopoly&quot;&gt;Corporate Monopoly&lt;/h2&gt;
&lt;p&gt;Don’t contribute to building dystopian monopolies. Unreal and Unity are just centralizing power for globohomo.&lt;/p&gt;

&lt;h2 id=&quot;build-knowledge&quot;&gt;Build Knowledge&lt;/h2&gt;
&lt;p&gt;Learn how game engines work. It’s fun writing stuff on your own and you learn how it works under the hood.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Start-Up</title>
   <link href="https://heretic-developer.com/2022/06/30/start-up"/>
   <updated>2022-06-30T00:00:00+02:00</updated>
   <id>https://heretic-developer.com/2022/06/30/Start-Up</id>
   <content type="html">&lt;p&gt;I want to share my views on programming, video game development and technology.
&lt;br /&gt;
I’ll publish code snippets and do write-ups on interesting topics.&lt;/p&gt;

&lt;p&gt;I am working on a video game, which I’ll shill from time to time.&lt;/p&gt;

&lt;p&gt;This blog is mainly for myself to keep track of my progress as some kind of journal.&lt;/p&gt;
</content>
 </entry>
 

</feed>
