Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Common - Geometry 3D - Triangle [Space].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_ST_Is_Point_Culled) -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Is_Point_Culled)( V(CPCU_TgSTRI) psST1, const TYPE fT0, const TYPE fT1 )
{
    return (V(tgGM_CT_Is_Point_Culled)( &psST1->m_sCT, fT0, fT1 ));
}


/* ---- V(tgGM_ST_Reset_Flags) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Reset_Flags)( V(PCU_TgSTRI) psST0 )
{
    psST0->m_sCT.m_bfFlags = ~0u;
}


/* ---- V(tgGM_ST_Calc_Space) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Calc_Space)( V(PCU_TgSTRI) psST0 )
{
    V(C_TgVEC) vN0 = V(F_UCX)( &psST0->m_sCT.m_sET.m_sPT.m_vNormal, psST0->m_sCT.m_sET.m_avEdge + 0 );
    V(C_TgVEC) vN1 = V(F_UCX)( &psST0->m_sCT.m_sET.m_sPT.m_vNormal, psST0->m_sCT.m_sET.m_avEdge + 1 );
    V(C_TgVEC) vN2 = V(F_UCX)( &psST0->m_sCT.m_sET.m_sPT.m_vNormal, psST0->m_sCT.m_sET.m_avEdge + 2 );

    V(tgGM_PN_Init_NP)( psST0->m_avPlane + 0, &vN0, psST0->m_sCT.m_sET.m_sPT.m_avPoint + 0 );
    V(tgGM_PN_Init_NP)( psST0->m_avPlane + 1, &vN1, psST0->m_sCT.m_sET.m_sPT.m_avPoint + 1 );
    V(tgGM_PN_Init_NP)( psST0->m_avPlane + 2, &vN2, psST0->m_sCT.m_sET.m_sPT.m_avPoint + 2 );
}


/* ---- V(tgGM_ST_Calc_Normal) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Calc_Normal)( V(PCU_TgSTRI) psST0 )
{
    V(tgGM_CT_Calc_Normal)( &psST0->m_sCT );
}


/* ---- V(tgGM_ST_Calc_Point) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Calc_Point)( V(P_TgVEC) pvRT, V(CPCU_TgSTRI) psST1, const TYPE fT0, const TYPE fT1 )
{
    V(tgGM_CT_Calc_Point)( pvRT, &psST1->m_sCT, fT0, fT1);
}


/* ---- V(tgGM_ST_Reset) ------------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Reset)( V(PCU_TgSTRI) psST0 )
{
    V(tgGM_CT_Reset)( &psST0->m_sCT );
    V(tgGM_PN_Reset)( psST0->m_avPlane + 0 );
    V(tgGM_PN_Reset)( psST0->m_avPlane + 1 );
    V(tgGM_PN_Reset)( psST0->m_avPlane + 2 );
}


/* ---- V(tgGM_ST_Is_Valid) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Is_Valid)( V(CPCU_TgSTRI) psST1 )
{
    if (TgTRUE != V(tgGM_CT_Is_Valid)( &psST1->m_sCT) )
    {
        return (TgFALSE);
    };

    return (TgTRUE);
}


/* ---- V(tgGM_ST_Support_Point) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Support_Point)( V(P_TgVEC) pvRT, V(CPCU_TgSTRI) psST1, V(CPCU_TgVEC) pvDN )
{
    V(tgGM_CT_Support_Point)( pvRT, &psST1->m_sCT, pvDN );
}


/* ---- V(tgGM_ST_Area) ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TYPE V(tgGM_ST_Area)( V(CPCU_TgSTRI) psST1 )
{
    return (V(tgGM_CT_Area)( &psST1->m_sCT) );
}


/* ---- V(tgGM_ST_BA) --------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_BA)( V(PCU_TgBOXAA) psBA0, V(CPCU_TgSTRI) psST1 )
{
    V(tgGM_CT_BA)( psBA0, &psST1->m_sCT );
}


/* ---- V(tgGM_ST_Sweep_BA) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Sweep_BA)( V(PCU_TgBOXAA) psBA0, V(CPCU_TgSTRI) psST1, V(CPCU_TgVEC) pvDT )
{
    V(tgGM_ST_BA)( psBA0, psST1 );
    V(tgGM_BA_Sweep)( psBA0, pvDT );
}


/* ---- V(tgGM_ST_Project) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Project)( PCU_TYPE ptyMin, PCU_TYPE ptyMax, V(CPCU_TgSTRI) psST1, V(CPCU_TgVEC) pvDN )
{
    V(tgGM_CT_Project)( ptyMin, ptyMax, &psST1->m_sCT, pvDN );
}


/* ---- V(tgGM_ST_Is_Contained) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Is_Contained)( V(CPCU_TgSTRI) psST1, V(CPCU_TgVEC) pvS0 )
{
    return (
        V(tgGM_F_Dist_PN_VT)(psST1->m_avPlane + 0, pvS0) >= MKL(0.0) &&
        V(tgGM_F_Dist_PN_VT)(psST1->m_avPlane + 1, pvS0) >= MKL(0.0) &&
        V(tgGM_F_Dist_PN_VT)( psST1->m_avPlane + 2, pvS0) >= MKL(0.0 ) ? TgTRUE : TgFALSE
    );
}


/* ---- V(tgGM_ST_TX) --------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_TX)( V(PCU_TgSTRI) psST0, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_CT_TX)( &psST0->m_sCT, pxM0 );
    V(tgGM_PN_TX)( psST0->m_avPlane + 0, pxM0 );
    V(tgGM_PN_TX)( psST0->m_avPlane + 1, pxM0 );
    V(tgGM_PN_TX)( psST0->m_avPlane + 2, pxM0 );
}


/* ---- V(tgGM_ST_Copy_TX) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Copy_TX)( V(PCU_TgSTRI) psST0, V(CPCU_TgSTRI) psST1, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_CT_Copy_TX)( &psST0->m_sCT, &psST1->m_sCT, pxM0 );
    V(tgGM_PN_Copy_TX)( psST0->m_avPlane + 0, psST1->m_avPlane + 0, pxM0 );
    V(tgGM_PN_Copy_TX)( psST0->m_avPlane + 1, psST1->m_avPlane + 1, pxM0 );
    V(tgGM_PN_Copy_TX)( psST0->m_avPlane + 2, psST1->m_avPlane + 2, pxM0 );
}


/* ---- V(tgGM_ST_Init_PN) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Init_PN)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvS1, V(CPCU_TgVEC) pvS2, V(CPCU_TgVEC) pvN )
{
    V(tgGM_CT_Init_PN)( &psST0->m_sCT, pvS0, pvS1, pvS2, pvN );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Init_P) ----------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Init_P)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvS1, V(CPCU_TgVEC) pvS2 )
{
    V(tgGM_CT_Init_P)( &psST0->m_sCT, pvS0, pvS1, pvS2 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Init_EN) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Init_EN)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvE0, V(CPCU_TgVEC) pvE1, V(CPCU_TgVEC) pvN)
{
    V(tgGM_CT_Init_EN)( &psST0->m_sCT, pvS0, pvE0, pvE1, pvN );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Init_E) ----------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Init_E)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS0, V(CPCU_TgVEC) pvE0, V(CPCU_TgVEC) pvE1 )
{
    V(tgGM_CT_Init_E)( &psST0->m_sCT, pvS0, pvE0, pvE1 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Init_PT) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Init_PT)( V(PCU_TgSTRI) psST0, V(CPCU_TgPTRI) psPT1 )
{
    V(tgGM_PT_CT_Init)( &psST0->m_sCT, psPT1 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Init_ET) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Init_ET)( V(PCU_TgSTRI) psST0, V(CPCU_TgETRI) psET1 )
{
    V(tgGM_ET_CT_Init)( &psST0->m_sCT, psET1 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Init_CT) ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Init_CT)( V(PCU_TgSTRI) psST0, V(CPCU_TgCTRI) psCT1 )
{
    V(tgGM_CT_Copy)( &psST0->m_sCT, psCT1 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Copy) ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Copy)( V(PCU_TgSTRI) psST0, V(CPCU_TgSTRI) psST1 )
{
    TgGEOM_ASSERT_PARAM(TgTRUE == V(tgGM_ST_Is_Valid)(psST1));

    V(tgGM_CT_Copy)( &psST0->m_sCT, &psST1->m_sCT );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Origin) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Origin)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS0 )
{
    V(tgGM_CT_Set_Origin)( &psST0->m_sCT, pvS0 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Point_0) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Point_0)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS0 )
{
    V(tgGM_CT_Set_Point_0)( &psST0->m_sCT, pvS0 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Point_1) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Point_1)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS1 )
{
    V(tgGM_CT_Set_Point_1)( &psST0->m_sCT, pvS1 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Point_2) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Point_2)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvS2 )
{
    V(tgGM_CT_Set_Point_2)( &psST0->m_sCT, pvS2 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Edge_0) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Edge_0)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvE0 )
{
    V(tgGM_CT_Set_Edge_0)( &psST0->m_sCT, pvE0 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Edge_1) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Edge_1)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvE1 )
{
    V(tgGM_CT_Set_Edge_1)( &psST0->m_sCT, pvE1 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Edge_2) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Edge_2)( V(PCU_TgSTRI) psST0, V(CPCU_TgVEC) pvE2 )
{
    V(tgGM_CT_Set_Edge_2)( &psST0->m_sCT, pvE2 );
    V(tgGM_ST_Calc_Space)( psST0 );
}


/* ---- V(tgGM_ST_Set_Flags) -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Flags)( V(PCU_TgSTRI) psST0, C_TgUINT32 uiFlags )
{
    psST0->m_sCT.m_bfFlags = uiFlags;
}


/* ---- V(tgGM_ST_Query_Origin) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Origin)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_sET.m_sPT.m_avPoint + 0);
}


/* ---- V(tgGM_ST_Query_Normal) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Normal)( V(CPCU_TgSTRI) psST0 )
{
    return (&psST0->m_sCT.m_sET.m_sPT.m_vNormal);
}


/* ---- V(tgGM_ST_Query_Point_0) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Point_0)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_sET.m_sPT.m_avPoint + 0);
}


/* ---- V(tgGM_ST_Query_Point_1) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Point_1)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_sET.m_sPT.m_avPoint + 1);
}


/* ---- V(tgGM_ST_Query_Point_2) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Point_2)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_sET.m_sPT.m_avPoint + 2);
}


/* ---- V(tgGM_ST_Query_Point) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Point)( V(CPCU_TgSTRI) psST0, C_TgSINT32 iIndex )
{
    TgGEOM_ASSERT_PARAM(iIndex >= 0 && iIndex <= 2);
    return (psST0->m_sCT.m_sET.m_sPT.m_avPoint + iIndex);
}


/* ---- V(tgGM_ST_Query_Edge_0) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Edge_0)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_sET.m_avEdge + 0);
}


/* ---- V(tgGM_ST_Query_Edge_1) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Edge_1)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_sET.m_avEdge + 1);
}


/* ---- V(tgGM_ST_Query_Edge_2) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Edge_2)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_sET.m_avEdge + 2);
}


/* ---- V(tgGM_ST_Query_Edge) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgVEC) V(tgGM_ST_Query_Edge)( V(CPCU_TgSTRI) psST0, C_TgSINT32 iIndex )
{
    TgGEOM_ASSERT_PARAM(iIndex >= 0 && iIndex <= 2);
    return (psST0->m_sCT.m_sET.m_avEdge + iIndex);
}


/* ---- V(tgGM_ST_Query_Edge_Plane_0) ----------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgPLANE) V(tgGM_ST_Query_Edge_Plane_0)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_avPlane + 0);
}


/* ---- V(tgGM_ST_Query_Edge_Plane_1) ----------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgPLANE) V(tgGM_ST_Query_Edge_Plane_1)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_avPlane + 1);
}


/* ---- V(tgGM_ST_Query_Edge_Plane_2) ----------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgPLANE) V(tgGM_ST_Query_Edge_Plane_2)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_avPlane + 2);
}


/* ---- V(tgGM_ST_Query_Edge_Plane) ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgPLANE) V(tgGM_ST_Query_Edge_Plane)( V(CPCU_TgSTRI) psST0, C_TgSINT32 iIndex )
{
    TgGEOM_ASSERT_PARAM(iIndex >= 0 && iIndex <= 2);
    return (psST0->m_avPlane + iIndex);
}


/* ---- V(tgGM_ST_Query_PT) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgPTRI) V(tgGM_ST_Query_PT)( V(CPCU_TgSTRI) psST0 )
{
    return (&psST0->m_sCT.m_sET.m_sPT);
}


/* ---- V(tgGM_ST_Query_ET) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgETRI) V(tgGM_ST_Query_ET)( V(CPCU_TgSTRI) psST0 )
{
    return (&psST0->m_sCT.m_sET);
}


/* ---- V(tgGM_ST_Query_CT) --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE V(CP_TgCTRI) V(tgGM_ST_Query_CT)( V(CPCU_TgSTRI) psST0 )
{
    return (&psST0->m_sCT);
}


/* ---- V(tgGM_ST_Query_Flags) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgUINT32 V(tgGM_ST_Query_Flags)( V(CPCU_TgSTRI) psST0 )
{
    return (psST0->m_sCT.m_bfFlags);
}


/* ---- V(tgGM_ST_Set_Test_Point) --------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Point)( V(PCU_TgSTRI) psST0, C_TgSINT32 iIndex, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, (TgUINT32)iIndex, bFlag );
}


/* ---- V(tgGM_ST_Set_Test_Point_0) ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Point_0)( V(PCU_TgSTRI) psST0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, 0, bFlag );
}


/* ---- V(tgGM_ST_Set_Test_Point_1) ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Point_1)( V(PCU_TgSTRI) psST0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, 1, bFlag );
}


/* ---- V(tgGM_ST_Set_Test_Point_2) ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Point_2)( V(PCU_TgSTRI) psST0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, 2, bFlag );
}


/* ---- V(tgGM_ST_Set_Test_Edge) ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Edge)( V(PCU_TgSTRI) psST0, C_TgSINT32 iIndex, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, (TgUINT32)(iIndex + 3), bFlag );
}


/* ---- V(tgGM_ST_Set_Test_Edge_0) -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Edge_0)( V(PCU_TgSTRI) psST0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, 3, bFlag );
}


/* ---- V(tgGM_ST_Set_Test_Edge_1) -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Edge_1)( V(PCU_TgSTRI) psST0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, 4, bFlag );
}


/* ---- V(tgGM_ST_Set_Test_Edge_2) -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Set_Test_Edge_2)( V(PCU_TgSTRI) psST0, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psST0->m_sCT.m_bfFlags, 5, bFlag );
}


/* ---- V(tgGM_ST_Test_Point) ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Point)( V(CPCU_TgSTRI) psST0, C_TgSINT32 iIndex )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, (TgUINT32)iIndex ));
}


/* ---- V(tgGM_ST_Test_Point_0) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Point_0)( V(CPCU_TgSTRI) psST0 )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, 0 ));
}


/* ---- V(tgGM_ST_Test_Point_1) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Point_1)( V(CPCU_TgSTRI) psST0 )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, 1 ));
}


/* ---- V(tgGM_ST_Test_Point_2) ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Point_2)( V(CPCU_TgSTRI) psST0 )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, 2 ));
}


/* ---- V(tgGM_ST_Test_Edge) -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Edge)( V(CPCU_TgSTRI) psST0, C_TgSINT32 iIndex )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, (TgUINT32)(iIndex + 3) ));
}


/* ---- V(tgGM_ST_Test_Edge_0) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Edge_0)( V(CPCU_TgSTRI) psST0 )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, 3 ));
}


/* ---- V(tgGM_ST_Test_Edge_1) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Edge_1)( V(CPCU_TgSTRI) psST0 )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, 4 ));
}


/* ---- V(tgGM_ST_Test_Edge_2) ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgBOOL V(tgGM_ST_Test_Edge_2)( V(CPCU_TgSTRI) psST0 )
{
    return (tgBF_Query_Flag_U32( &psST0->m_sCT.m_bfFlags, 5 ));
}


#if defined(TgCOMPILE_NATIVE_VECTOR)

/* ---- V(tgGM_ST_M_TX) ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_M_TX)( V(PCU_TgSTRI) psST0, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_CT_M_TX)( &psST0->m_sCT, pxM0 );
    V(tgGM_PN_M_TX)( psST0->m_avPlane + 0, pxM0 );
    V(tgGM_PN_M_TX)( psST0->m_avPlane + 1, pxM0 );
    V(tgGM_PN_M_TX)( psST0->m_avPlane + 2, pxM0 );
}


/* ---- V(tgGM_ST_Copy_M_TX) -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgINLINE TgVOID V(tgGM_ST_Copy_M_TX)( V(PCU_TgSTRI) psST0, V(CPCU_TgSTRI) psST1, M34(CPCU_TgMAT) pxM0 )
{
    V(tgGM_CT_Copy_M_TX)( &psST0->m_sCT, &psST1->m_sCT, pxM0 );
    V(tgGM_PN_Copy_M_TX)( psST0->m_avPlane + 0, psST1->m_avPlane + 0, pxM0 );
    V(tgGM_PN_Copy_M_TX)( psST0->m_avPlane + 1, psST1->m_avPlane + 1, pxM0 );
    V(tgGM_PN_Copy_M_TX)( psST0->m_avPlane + 2, psST1->m_avPlane + 2, pxM0 );
}

/*# defined(TgCOMPILE_NATIVE_VECTOR) */
#endif