Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Common - Geometry 3D - Triangle [Edge].h_inc
    »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".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/* == Common ============================================================================================================================================================ */

TgINLINE TgVOID                                 V(tgGM_ET_Calc_Normal)( V(PCU_TgETRI) );
TgINLINE TgVOID                                 V(tgGM_ET_Calc_Point)( V(P_TgVEC), V(CPCU_TgETRI), const TYPE, const TYPE );

TgINLINE TgVOID                                 V(tgGM_ET_Reset)( V(PCU_TgETRI) );
TgEXTN TgBOOL                                   V(tgGM_ET_Is_Valid)( V(CPCU_TgETRI) );
TgEXTN TgVOID                                   V(tgGM_ET_Support_Point)( V(P_TgVEC), V(CPCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TYPE                                   V(tgGM_ET_Area)( V(CPCU_TgETRI) );
TgINLINE TgVOID                                 V(tgGM_ET_BA)( V(PCU_TgBOXAA), V(CPCU_TgETRI) );
TgINLINE TgVOID                                 V(tgGM_ET_Sweep_BA)( V(PCU_TgBOXAA), V(CPCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_Project)( PCU_TYPE, PCU_TYPE, V(CPCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TgBOOL                                 V(tgGM_ET_Is_Contained)( V(CPCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_TX)( V(PCU_TgETRI), M34(CPCU_TgMAT) );
TgINLINE TgVOID                                 V(tgGM_ET_Copy_TX)( V(PCU_TgETRI), V(CPCU_TgETRI), M34(CPCU_TgMAT) );

                                                /* V(tgGM_ET_Init_P(N)) */
                                                /* 1: Output */
                                                /* 2: Point 0 */
                                                /* 3: Point 1 */
                                                /* 4: Point 2 */
                                                /* 5: Normal */
TgINLINE TgVOID                                 V(tgGM_ET_Init_PN)( V(PCU_TgETRI), V(CPCU_TgVEC), V(CPCU_TgVEC), V(CPCU_TgVEC), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_Init_P)( V(PCU_TgETRI), V(CPCU_TgVEC), V(CPCU_TgVEC), V(CPCU_TgVEC) );

                                                /* V(tgGM_ET_Init_E(N)) */
                                                /* 1: Output */
                                                /* 2: Origin */
                                                /* 3: [0-1] Edge */
                                                /* 4: [0-2] Edge */
                                                /* 5: Normal */
TgINLINE TgVOID                                 V(tgGM_ET_Init_EN)( V(PCU_TgETRI), V(CPCU_TgVEC), V(CPCU_TgVEC), V(CPCU_TgVEC), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_Init_E)( V(PCU_TgETRI), V(CPCU_TgVEC), V(CPCU_TgVEC), V(CPCU_TgVEC) );

TgINLINE TgVOID                                 V(tgGM_PT_ET_Init)( V(PCU_TgETRI), V(CPCU_TgPTRI) );
TgINLINE TgVOID                                 V(tgGM_ET_Copy)( V(PCU_TgETRI), V(CPCU_TgETRI) );
TgINLINE TgVOID                                 V(tgGM_ET_Set_Origin)( V(PCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_Set_Point_0)( V(PCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_Set_Point_1)( V(PCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_Set_Point_2)( V(PCU_TgETRI), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_ET_Set_Edge_0)( V(PCU_TgETRI), V(CPCU_TgVEC) ); /*« Point 0 to Point 1; */
TgINLINE TgVOID                                 V(tgGM_ET_Set_Edge_1)( V(PCU_TgETRI), V(CPCU_TgVEC) ); /*« Point 1 to Point 2; */
TgINLINE TgVOID                                 V(tgGM_ET_Set_Edge_2)( V(PCU_TgETRI), V(CPCU_TgVEC) ); /*« Point 2 to Point 0; */

TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Origin)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Normal)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Point_0)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Point_1)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Point_2)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Point)( V(CPCU_TgETRI), C_TgSINT32 );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Edge_0)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Edge_1)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Edge_2)( V(CPCU_TgETRI) );
TgINLINE V(CP_TgVEC)                            V(tgGM_ET_Query_Edge)( V(CPCU_TgETRI), C_TgSINT32 );
TgINLINE V(CP_TgPTRI)                           V(tgGM_PT_ET_Query)( V(CPCU_TgETRI) );

                                                /*  If an edge has been feature reduced it is still possible for a valid contact point to be generated within a tolerance */
                                                /* value of the edge.  Thus, its necessary to make sure that contact points on the edge are created at least once, but only */
                                                /* once. This function uses a simple ordered sign test to achieve the requirements. */

TgEXTN TgBOOL                                   V(tgGM_ET_Is_Tri_Edge_Ignored)( V(CPCU_TgETRI), const TYPE, const TYPE );
TgEXTN TgBOOL                                   V(tgGM_ET_Is_Tri_Edge_Ignored_Code)( V(CPCU_TgETRI), C_TgSINT32 );

#if defined(TgCOMPILE_NATIVE_VECTOR)
TgINLINE TgVOID                                 V(tgGM_ET_M_TX)( V(PCU_TgETRI), M34(CPCU_TgMAT) );
TgINLINE TgVOID                                 V(tgGM_ET_Copy_M_TX)( V(PCU_TgETRI), V(CPCU_TgETRI), M34(CPCU_TgMAT) );
/*# defined(TgCOMPILE_NATIVE_VECTOR) */
#endif