Home

Resume

Blog

Teikitu


// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //
//  »Project«   Teikitu Gaming System (TgS) (∂)
//  »File«      TgS Collision - F - System.i_inc
//  »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
//  »Version«   4.0
//  »Keywords«  Collision;Distance;Closest;
// ------------------------------------------------------------------------------------------------------------------------------ //
//  Copyright: © 2002-2010, 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: 
//    Redistributions of source code must retain this copyright notice, this list of conditions and the following disclaimers. 
//    Redistributions 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. 
//  Neither the names of the copyright owner nor the names of its contributors may 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".
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //

// -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. //
//  Collision - Request Functions
// -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. //

TgINLINE TgVOID V(tgCO_RQ_Set_Test)( V(PCU_STg2_CO_Request) psRequest, C_ETgPRIMITIVE enPM )
{
    V(tgCO_RQ_Reset)( psRequest );
    psRequest->m_uiPrimitive = enPM;
    psRequest->m_uiTest = ETgCO_TEST__BOOLEAN;
}


TgINLINE TgVOID V(tgCO_RQ_Set_Test_Sweep)( V(PCU_STg2_CO_Request) psRequest, C_ETgPRIMITIVE enPM, V(CPCU_TgVEC) pvDT )
{
    V(tgCO_RQ_Reset)( psRequest );
    psRequest->m_uiPrimitive = enPM;
    psRequest->m_uiTest = ETgCO_TEST__BOOLEAN_SWEEP;
    psRequest->m_fToI = MKL(1.0);
    V(tgGM_Set_DT)( &psRequest->m_sDT, pvDT );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Intersect)( V(PCU_STg2_CO_Request) psRequest, C_ETgPRIMITIVE enPM )
{
    V(tgCO_RQ_Reset)( psRequest );
    psRequest->m_uiPrimitive = enPM;
    psRequest->m_uiTest = ETgCO_TEST__INTERSECT;
}


TgINLINE TgVOID V(tgCO_RQ_Set_Penetrate)( V(PCU_STg2_CO_Request) psRequest, C_ETgPRIMITIVE enPM )
{
    V(tgCO_RQ_Reset)( psRequest );
    psRequest->m_uiPrimitive = enPM;
    psRequest->m_uiTest = ETgCO_TEST__PENETRATE;
    tgBF_Set_Flag_U32( &psRequest->m_bfFlags, ETgCO_FLAGS_ORDER_PARAMETER, TgTRUE );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Sweep)( V(PCU_STg2_CO_Request) psRequest, C_ETgPRIMITIVE enPM, V(CPCU_TgVEC) pvDT )
{
    V(tgCO_RQ_Reset)( psRequest );
    psRequest->m_uiPrimitive = enPM;
    psRequest->m_uiTest = ETgCO_TEST__SWEEP;
    psRequest->m_fToI = MKL(1.0);
    V(tgGM_Set_DT)( &psRequest->m_sDT, pvDT );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Sweep_Penetrate)( V(PCU_STg2_CO_Request) psRequest, C_ETgPRIMITIVE enPM, V(CPCU_TgVEC) pvDT )
{
    V(tgCO_RQ_Reset)( psRequest );
    psRequest->m_uiPrimitive = enPM;
    psRequest->m_uiTest = ETgCO_TEST__SWEEP_PENETRATE;
    psRequest->m_fToI = MKL(1.0);
    V(tgGM_Set_DT)( &psRequest->m_sDT, pvDT );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Touch_Draft)( V(PCU_STg2_CO_Request) psRequest, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psRequest->m_uiFilter_Objects, ETgCO_OBJECT__DRAFT, bFlag );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Touch_Static)( V(PCU_STg2_CO_Request) psRequest, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psRequest->m_uiFilter_Objects, ETgCO_OBJECT__SET_STATIC, bFlag );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Touch_Symbol_Light)( V(PCU_STg2_CO_Request) psRequest, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psRequest->m_uiFilter_Objects, ETgCO_OBJECT__LIGHT, bFlag );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Touch_Symbol_Path)( V(PCU_STg2_CO_Request) psRequest, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psRequest->m_uiFilter_Objects, ETgCO_OBJECT__PATH_POINT, bFlag );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Touch_Symbol_Probe)( V(PCU_STg2_CO_Request) psRequest, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psRequest->m_uiFilter_Objects, ETgCO_OBJECT__LIGHT_PROBE, bFlag );
}


TgINLINE TgVOID V(tgCO_RQ_Set_Touch_Water)( V(PCU_STg2_CO_Request) psRequest, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psRequest->m_uiFilter_Objects, ETgCO_OBJECT__WATER, bFlag );
}


TgINLINE TgVOID V(tgCO_RQ_RQ_Ignore_Reset)( V(PCU_STg2_CO_Request) psRequest )
{
    tgBF_Set_Flag_U32( &psRequest->m_bfFlags, ETgCO_FLAGS_IGNORE_ALL, TgFALSE );
    psRequest->m_niConnection_Graph_Ignored = 0;
    psRequest->m_niConnection_Ignored = 0;
    psRequest->m_niNative_String = 0;
}


TgINLINE TgVOID V(tgCO_RQ_Ignore_All)( V(PCU_STg2_CO_Request) psRequest, C_TgBOOL bFlag )
{
    tgBF_Set_Flag_U32( &psRequest->m_bfFlags, ETgCO_FLAGS_IGNORE_ALL, bFlag );
}


TgINLINE TgBOOL V(tgCO_RQ_Is_Ignored_All)( V(CPCU_STg2_CO_Request) psRequest )
{
    return (tgBF_Query_Flag_U32( &psRequest->m_bfFlags, ETgCO_FLAGS_IGNORE_ALL ));
}