/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Common - Geometry 3D - Plane.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_PN_Negate)( V(PCU_TgPLANE) );

TgINLINE TgVOID                                 V(tgGM_PN_Reset)( V(PCU_TgPLANE) );
TgINLINE TgBOOL                                 V(tgGM_PN_Is_Valid)( V(CPCU_TgPLANE) );
TgINLINE TgBOOL                                 V(tgGM_PN_Is_Contained)( V(CPCU_TgPLANE), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_PN_TX)( V(PCU_TgPLANE), M34(CPCU_TgMAT) );
TgINLINE TgVOID                                 V(tgGM_PN_Copy_TX)( V(PCU_TgPLANE), V(CPCU_TgPLANE), M34(CPCU_TgMAT) );

TgINLINE TgVOID                                 V(tgGM_PN_Init_ND)( V(PCU_TgPLANE), V(CPCU_TgVEC), const TYPE );
TgINLINE TgVOID                                 V(tgGM_PN_Init_NP)( V(PCU_TgPLANE), V(CPCU_TgVEC), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_PN_Copy)( V(PCU_TgPLANE), V(CPCU_TgPLANE) );
TgINLINE TgVOID                                 V(tgGM_PN_Set_PlnEqN)( V(PCU_TgPLANE), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_PN_Set_Normal)( V(PCU_TgPLANE), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_PN_Set_Origin)( V(PCU_TgPLANE), V(CPCU_TgVEC) );
TgINLINE TgVOID                                 V(tgGM_PN_Set_Constant)( V(PCU_TgPLANE), const TYPE );

TgINLINE V4(CP_TgVEC)                           V(tgGM_PN_Query_PlnEqN)( V(CPCU_TgPLANE) );
TgINLINE V(CP_TgVEC)                            V(tgGM_PN_Query_Normal)( V(CPCU_TgPLANE) );
TgINLINE TYPE                                   V(tgGM_PN_Query_Constant)( V(CPCU_TgPLANE) );

TgINLINE TYPE                                   V(tgGM_F_DistSq_PN_VT)( V(CPCU_TgPLANE), V(CPCU_TgVEC) );
TgINLINE TYPE                                   V(tgGM_F_Dist_PN_VT)( V(CPCU_TgPLANE), V(CPCU_TgVEC) );
TgINLINE TYPE                                   V(tgGM_F_Sign_Dist_PN_VT)( V(CPCU_TgPLANE), V(CPCU_TgVEC) );
TgINLINE TYPE                                   V(tgGM_F_Sign_Closest_PN_VT)( V(PCU_TgVEC), V(CPCU_TgPLANE), V(CPCU_TgVEC) );

TgINLINE TgVOID                                 V(tgGM_PN_M_TX)( V(PCU_TgPLANE), M34(CPCU_TgMAT) );
TgINLINE TgVOID                                 V(tgGM_PN_Copy_M_TX)( V(PCU_TgPLANE), V(CPCU_TgPLANE), M34(CPCU_TgMAT) );