Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Common -- GEOMETRY.h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_COMMON_GEOMETRY_H)
#define TGS_COMMON_GEOMETRY_H
#pragma once

#define TgGEOM_ASSERT_PARAM                 TgPARAM_CHECK


/* == Common ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Functions                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

TgEXTN C_TgFLOAT32                          KTgGM_CUBE_VERTEX[24];
TgEXTN C_TgUINT16                           KTgGM_CUBE_INDEX[36];

TgEXTN C_TgFLOAT32                          KTgGM_TETRAHEDRON_VERTEX[12];
TgEXTN C_TgUINT16                           KTgGM_TETRAHEDRON_INDEX[12];

TgEXTN C_TgFLOAT32                          KTgGM_OCTOGON_VERTEX[24];
TgEXTN C_TgUINT16                           KTgGM_OCTOGON_INDEX[24];

TgEXTN C_TgFLOAT32                          KTgGM_ICOSAHEDRON_VERTEX[96];
TgEXTN C_TgUINT16                           KTgGM_ICOSAHEDRON_INDEX[60];

TgEXTN C_TgFLOAT32                          KTgGM_ICOSAHEDRON_HEMI_VERTEX[160];
TgEXTN C_TgUINT16                           KTgGM_ICOSAHEDRON_HEMI_INDEX[108];


#include "TgS COMMON/TgS Common - Geometry - Constants.h"
#include "TgS COMMON/TgS Common - Geometry - Type.h"
#include "TgS COMMON/TgS Common - Geometry - API.h"

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define PAD32_3(A)
#define PAD32_4(A)
#define PAD64_3(A)
#define PAD64_4(A)

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define PCU_TYPE TgFLOAT32 * __restrict const
#define TYPE TgFLOAT32
#define V4(A) A##_F32_04
#define M34(A) A##_F32_34
#define M44(A) A##_F32_44

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#undef PAD32_4
#define V(A) A##_F32_04
#define PAD32_4(A) TgUINT32 iPad[A];
#define TgCOMPILE_NATIVE_VECTOR

#include "TgS COMMON/TgS Common - Geometry - Type.h_inc"
#include "TgS COMMON/TgS Common - Geometry 2D - Rectangle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Box - Axis Aligned.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Box.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Capsule.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Circle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Cylinder.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Disk.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Ellipse.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Line.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Mesh [BA].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Mesh [BVT].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Mesh [Simple].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Parallelogram.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Particle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Plane.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Ray.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Rectangle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Segment.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Sphere.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Torus.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Collision].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Edge].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Point].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Space].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Tube.h_inc"

#undef TgCOMPILE_NATIVE_VECTOR
#undef PAD32_4
#undef V
#define PAD32_4(A)

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#undef M44
#undef M34
#undef V4
#undef TYPE
#undef PCU_TYPE

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define PCU_TYPE TgFLOAT64 * __restrict const
#define TYPE TgFLOAT64
#define V4(A) A##_F64_04
#define M34(A) A##_F64_34
#define M44(A) A##_F64_44

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#undef PAD64_4
#define V(A) A##_F64_04
#define PAD64_4(A) TgUINT32 iPad[A];

#include "TgS COMMON/TgS Common - Geometry - Type.h_inc"
#include "TgS COMMON/TgS Common - Geometry 2D - Rectangle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Box - Axis Aligned.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Box.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Capsule.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Circle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Cylinder.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Disk.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Ellipse.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Line.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Mesh [BA].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Mesh [BVT].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Mesh [Simple].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Parallelogram.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Particle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Plane.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Ray.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Rectangle.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Segment.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Sphere.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Torus.h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Collision].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Edge].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Point].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Triangle [Space].h_inc"
#include "TgS COMMON/TgS Common - Geometry 3D - Tube.h_inc"

#undef PAD64_4
#undef V
#define PAD64_4(A)

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#undef M44
#undef M34
#undef V4
#undef TYPE
#undef PCU_TYPE

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#undef PAD32_3
#undef PAD32_4
#undef PAD64_3
#undef PAD64_4


/* ====================================================================================================================================================================== */
#endif