Abbreviations
(1) Type Definitions
For the sake of brevity I created a simple naming convention (similar to Hungarian notation) to represent the most common collection of used modified types. This allows for a more succinct representation when writing code. For example [const float * __restrict const] becomes [PCU_TgFLOAT32]. The brevity makes the interface and code easier to understand once the nomenclature is understood.
|
Similarly the 3.1 files follow a similar pattern for the types used in templates and are as follows:
|
P: Pointer, C: Const, U: Restrict, R: Reference - Prefix is in order. Thus, for instance, CR•(VECTOR) is just a const reference template vector.
(2) File Conventions:
See Information for more details on the choice of language. Since I am using straight C I wanted a method to define the same interface and in some cases implementation for different combinations of variable types. In C++ this was done using template and template specialization. The method I used was to create a file convention for header, inline and sources files that would be included multiple times in the compilation with different pre-processor macro definitions. The macros are used for name mangling so that the functions can be generated for each of the types required. It is important that code itself is never written through macros as it is too troublesome when debugging. Since the code is only name mangled and included into the regular compilation this problem does not manifest.
(3) Geometry Nomenclature:
Each primitive type is assigned a simple two letter short form. The exception are points/vectors which sometimes has more definitions based on usage (point vs directions).
|
A point triangle is one described using only the three vertices and a normal to the plane. An edge triangle adds a clockwise edge definition. A collision triangle augments an edge triangle with feature reduction information (for instance if a particular edge should be considered during collision). Finally, a space triangle adds edge plane definition to a collision triangle.