Home

Resume

Blog

Teikitu


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

/* ---- V(tgGM_CT_Reset_Flags) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Reset_Flags)( V(PCU_TgCTRI) psCT0 )
{
    psCT0->m_bfFlags = ~0u;
}


/* ---- V(tgGM_CT_Calc_Normal) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Calc_Normal)( V(PCU_TgCTRI) psCT0 )
{
    V(tgGM_ET_Calc_Normal)( &psCT0->m_sET );
}


/* ---- V(tgGM_CT_Calc_Point) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Calc_Point)( V(P_TgVEC) pvRT, V(CPCU_TgCTRI) psCT1, const TYPE fT0, const TYPE fT1 )
{
    V(tgGM_ET_Calc_Point)( pvRT, &psCT1->m_sET, fT0, fT1 );
}


/* ---- V(tgGM_CT_Reset) ------------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Reset)( V(PCU_TgCTRI) psCT0 )
{
    V(tgGM_ET_Reset)( &psCT0->m_sET );
    tgBF_Reset_U32( &psCT0->m_bfFlags );
}


/* ---- V(tgGM_CT_Is_Valid) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Is_Valid)( V(CPCU_TgCTRI) psCT1 )
{
    if (TgTRUE != V(tgGM_ET_Is_Valid)( &psCT1->m_sET) )
    {
        return (TgFALSE);
    };

    return (TgTRUE);
}


/* ---- V(tgGM_CT_Support_Point) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Support_Point)( V(P_TgVEC) pvRT, V(CPCU_TgCTRI) psCT1, V(CPCU_TgVEC) pvDN )
{
    V(tgGM_ET_Support_Point)( pvRT, &psCT1->m_sET, pvDN );
}


/* ---- V(tgGM_CT_Area) ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TYPE V(tgGM_CT_Area)( V(CPCU_TgCTRI) psCT1 )
{
    return (V(tgGM_ET_Area)( &psCT1->m_sET) );
}


/* ---- V(tgGM_CT_BA) --------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_BA)( V(PCU_TgBOXAA) psBA0, V(CPCU_TgCTRI) psCT1 )
{
    V(tgGM_ET_BA)( psBA0, &psCT1->m_sET );
}


/* ---- V(tgGM_CT_Sweep_BA) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Sweep_BA)( V(PCU_TgBOXAA) psBA0, V(CPCU_TgCTRI) psCT1, V(CPCU_TgVEC) pvDT )
{
    V(tgGM_CT_BA)( psBA0, psCT1 );
    V(tgGM_BA_Sweep)( psBA0, pvDT );
}


/* ---- V(tgGM_CT_Project) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Project)( PCU_TYPE ptyMin, PCU_TYPE ptyMax, V(CPCU_TgCTRI) psCT1, V(CPCU_TgVEC) pvDN )
{
    V(tgGM_ET_Project)( ptyMin, ptyMax, &psCT1->m_sET, pvDN );
}


/* ---- V(tgGM_CT_Is_Contained) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Is_Contained)( V(CPCU_TgCTRI) psCT1, V(CPCU_TgVEC) pvS0 )
{
    return (V(tgGM_ET_Is_Contained)( &psCT1->m_sET, pvS0 ));
}


/* ---- V(tgGM_CT_TX) --------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_TX)( V(PCU_TgCTRI) psCT0, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_ET_TX)( &psCT0->m_sET, pxM0 );
}


/* ---- V(tgGM_CT_Copy_TX) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Copy_TX)( V(PCU_TgCTRI) psCT0, V(CPCU_TgCTRI) psCT1, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_ET_Copy_TX)( &psCT0->m_sET, &psCT1->m_sET, pxM0 );
    psCT0->m_bfFlags = psCT1->m_bfFlags;
}


/* ---- V(tgGM_CT_Init_PN) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Init_PN)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvS1, V(CPCU_TgVEC) pvS2, V(CPCU_TgVEC) pvN)
{
    V(tgGM_ET_Init_PN)( &psCT0->m_sET, pvS0, pvS1, pvS2, pvN );
    V(tgGM_CT_Reset_Flags)( psCT0 );
}


/* ---- V(tgGM_CT_Init_P) ----------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Init_P)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvS1, V(CPCU_TgVEC) pvS2 )
{
    V(tgGM_ET_Init_P)( &psCT0->m_sET, pvS0, pvS1, pvS2 );
    V(tgGM_CT_Reset_Flags)( psCT0 );
}


/* ---- V(tgGM_CT_Init_EN) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Init_EN)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvE0, V(CPCU_TgVEC) pvE1, V(CPCU_TgVEC) pvN)
{
    V(tgGM_ET_Init_EN)( &psCT0->m_sET, pvS0, pvE0, pvE1, pvN );
    V(tgGM_CT_Reset_Flags)( psCT0 );
}


/* ---- V(tgGM_CT_Init_E) ----------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Init_E)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvE0, V(CPCU_TgVEC) pvE1 )
{
    V(tgGM_ET_Init_E)( &psCT0->m_sET, pvS0, pvE0, pvE1 );
    V(tgGM_CT_Reset_Flags)( psCT0 );
}


/* ---- V(tgGM_PT_CT_Init) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_PT_CT_Init)( V(PCU_TgCTRI) psCT0, V(CPCU_TgPTRI) psPT1 )
{
    V(tgGM_CT_Init_PN)( psCT0, psPT1->m_avPoint + 0, psPT1->m_avPoint + 1, psPT1->m_avPoint + 2, &psPT1->m_vNormal );
    V(tgGM_CT_Reset_Flags)( psCT0 );
}


/* ---- V(tgGM_ET_CT_Init) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ET_CT_Init)( V(PCU_TgCTRI) psCT0, V(CPCU_TgETRI) psET1 )
{
    V(tgGM_ET_Copy)( &psCT0->m_sET, psET1 );
    V(tgGM_CT_Reset_Flags)( psCT0 );
}


/* ---- V(tgGM_CT_Copy) ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Copy)( V(PCU_TgCTRI) psCT0, V(CPCU_TgCTRI) psCT1 )
{
    TgGEOM_ASSERT_PARAM(TgTRUE == V(tgGM_CT_Is_Valid)(psCT1));

    V(tgGM_ET_Copy)( &psCT0->m_sET, &psCT1->m_sET );
    psCT0->m_bfFlags = psCT1->m_bfFlags;
}


/* ---- V(tgGM_CT_Set_Origin) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Origin)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS0 )
{
    V(tgGM_ET_Set_Origin)( &psCT0->m_sET, pvS0 );
}


/* ---- V(tgGM_CT_Set_Point_0) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Point_0)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS0 )
{
    V(tgGM_ET_Set_Point_0)( &psCT0->m_sET, pvS0 );
}


/* ---- V(tgGM_CT_Set_Point_1) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Point_1)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS1 )
{
    V(tgGM_ET_Set_Point_1)( &psCT0->m_sET, pvS1 );
}


/* ---- V(tgGM_CT_Set_Point_2) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Point_2)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvS2 )
{
    V(tgGM_ET_Set_Point_2)( &psCT0->m_sET, pvS2 );
}


/* ---- V(tgGM_CT_Set_Edge_0) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Edge_0)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvE0 )
{
    V(tgGM_ET_Set_Edge_0)( &psCT0->m_sET, pvE0 );
}


/* ---- V(tgGM_CT_Set_Edge_1) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Edge_1)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvE1 )
{
    V(tgGM_ET_Set_Edge_1)( &psCT0->m_sET, pvE1 );
}


/* ---- V(tgGM_CT_Set_Edge_2) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Edge_2)( V(PCU_TgCTRI) psCT0, V(CPCU_TgVEC) pvE2 )
{
    V(tgGM_ET_Set_Edge_2)( &psCT0->m_sET, pvE2 );
}


/* ---- V(tgGM_CT_Set_Flags) -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Flags)( V(PCU_TgCTRI) psCT0, C_TgUINT32 uiFlags )
{
    psCT0->m_bfFlags = uiFlags;
}


/* ---- V(tgGM_CT_Query_Origin) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Origin)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_sET.m_sPT.m_avPoint + 0);
}


/* ---- V(tgGM_CT_Query_Normal) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Normal)( V(CPCU_TgCTRI) psCT0 )
{
    return (&psCT0->m_sET.m_sPT.m_vNormal);
}


/* ---- V(tgGM_CT_Query_Point_0) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Point_0)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_sET.m_sPT.m_avPoint + 0);
}


/* ---- V(tgGM_CT_Query_Point_1) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Point_1)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_sET.m_sPT.m_avPoint + 1);
}


/* ---- V(tgGM_CT_Query_Point_2) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Point_2)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_sET.m_sPT.m_avPoint + 2);
}


/* ---- V(tgGM_CT_Query_Point) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Point)( V(CPCU_TgCTRI) psCT0, C_TgSINT32 iIndex )
{
    TgGEOM_ASSERT_PARAM(iIndex >= 0 && iIndex <= 2);
    return (psCT0->m_sET.m_sPT.m_avPoint + iIndex);
}


/* ---- V(tgGM_CT_Query_Edge_0) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Edge_0)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_sET.m_avEdge + 0);
}


/* ---- V(tgGM_CT_Query_Edge_1) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Edge_1)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_sET.m_avEdge + 1);
}


/* ---- V(tgGM_CT_Query_Edge_2) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Edge_2)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_sET.m_avEdge + 2);
}


/* ---- V(tgGM_CT_Query_Edge) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_CT_Query_Edge)( V(CPCU_TgCTRI) psCT0, C_TgSINT32 iIndex )
{
    TgGEOM_ASSERT_PARAM(iIndex >= 0 && iIndex <= 2);
    return (psCT0->m_sET.m_avEdge + iIndex);
}


/* ---- V(tgGM_PT_CT_Query) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgPTRI) V(tgGM_PT_CT_Query)( V(CPCU_TgCTRI) psCT0 )
{
    return (&psCT0->m_sET.m_sPT);
}


/* ---- V(tgGM_ET_CT_Query) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgETRI) V(tgGM_ET_CT_Query)( V(CPCU_TgCTRI) psCT0 )
{
    return (&psCT0->m_sET);
}


/* ---- V(tgGM_CT_Query_Flags) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgUINT32 V(tgGM_CT_Query_Flags)( V(CPCU_TgCTRI) psCT0 )
{
    return (psCT0->m_bfFlags);
}


/* ---- V(tgGM_CT_Set_Test_Point) --------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Point)( V(PCU_TgCTRI) psCT0, C_TgSINT32 iIndex, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, (TgUINT32)iIndex, bFlag );
}


/* ---- V(tgGM_CT_Set_Test_Point_0) ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Point_0)( V(PCU_TgCTRI) psCT0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, 0, bFlag );
}


/* ---- V(tgGM_CT_Set_Test_Point_1) ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Point_1)( V(PCU_TgCTRI) psCT0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, 1, bFlag );
}


/* ---- V(tgGM_CT_Set_Test_Point_2) ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Point_2)( V(PCU_TgCTRI) psCT0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, 2, bFlag );
}


/* ---- V(tgGM_CT_Set_Test_Edge) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Edge)( V(PCU_TgCTRI) psCT0, C_TgSINT32 iIndex, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, (TgUINT32)(iIndex + 3), bFlag );
}


/* ---- V(tgGM_CT_Set_Test_Edge_0) -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Edge_0)( V(PCU_TgCTRI) psCT0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, 3, bFlag );
}


/* ---- V(tgGM_CT_Set_Test_Edge_1) -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Edge_1)( V(PCU_TgCTRI) psCT0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, 4, bFlag );
}


/* ---- V(tgGM_CT_Set_Test_Edge_2) -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Set_Test_Edge_2)( V(PCU_TgCTRI) psCT0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psCT0->m_bfFlags, 5, bFlag );
}


/* ---- V(tgGM_CT_Test_Point) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Point)( V(CPCU_TgCTRI) psCT1, C_TgSINT32 iIndex )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, (TgUINT32)iIndex ));
}


/* ---- V(tgGM_CT_Test_Point_0) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Point_0)( V(CPCU_TgCTRI) psCT1 )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, 0 ));
}


/* ---- V(tgGM_CT_Test_Point_1) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Point_1)( V(CPCU_TgCTRI) psCT1 )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, 1 ));
}


/* ---- V(tgGM_CT_Test_Point_2) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Point_2)( V(CPCU_TgCTRI) psCT1 )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, 2 ));
}


/* ---- V(tgGM_CT_Test_Edge) -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Edge)( V(CPCU_TgCTRI) psCT1, C_TgSINT32 iIndex )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, (TgUINT32)(iIndex + 3) ));
}


/* ---- V(tgGM_CT_Test_Edge_0) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Edge_0)( V(CPCU_TgCTRI) psCT1 )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, 3 ));
}


/* ---- V(tgGM_CT_Test_Edge_1) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Edge_1)( V(CPCU_TgCTRI) psCT1 )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, 4 ));
}


/* ---- V(tgGM_CT_Test_Edge_2) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_CT_Test_Edge_2)( V(CPCU_TgCTRI) psCT1 )
{
    return (tgBF_Query_Flag_U32( &psCT1->m_bfFlags, 5 ));
}


#if defined(TgCOMPILE_NATIVE_VECTOR)

/* ---- V(tgGM_CT_M_TX) ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_M_TX)( V(PCU_TgCTRI) psCT0, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_ET_M_TX)( &psCT0->m_sET, pxM0 );
}


/* ---- V(tgGM_CT_Copy_M_TX) -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_CT_Copy_M_TX)( V(PCU_TgCTRI) psCT0, V(CPCU_TgCTRI) psCT1, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_ET_Copy_M_TX)( &psCT0->m_sET, &psCT1->m_sET, pxM0 );
    psCT0->m_bfFlags = psCT1->m_bfFlags;
}

/*# defined(TgCOMPILE_NATIVE_VECTOR) */
#endif