GetTriKey: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "<pageclass subcaption="C++ Function"></pageclass> This C++ namespace function is a helper function for '''CAdditionalVertexStreamManager'''. It gets 64 bit key for a triangle...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<pageclass subcaption="C++ Function"></pageclass>
<pageclass subcaption="C++ Function"></pageclass>


This C++ namespace function is a helper function for '''CAdditionalVertexStreamManager'''.
This C++ namespace function is a helper function for [[CAdditionalVertexStreamManager]].
 
It gets 64 bit key for a triangle by using the ordered vertex indices.
It gets 64 bit key for a triangle by using the ordered vertex indices.


Line 12: Line 13:


==Returns==
==Returns==
Returns a long long 64 bit key for a triangle --.
Returns a long long 64 bit key for a triangle.


==Code==
==Code==
Line 27: Line 28:


==See Also==
==See Also==
[[CAdditionalVertexStreamManager]]
*[[CAdditionalVertexStreamManager]]

Latest revision as of 13:00, 14 May 2017

This C++ namespace function is a helper function for CAdditionalVertexStreamManager.

It gets 64 bit key for a triangle by using the ordered vertex indices.

It can be found in Client/Client Core/Sources/CAdditionalVertexStreamManager.cpp in Visual Studio.

Required Arguments

  • a: To be defined.
  • b: To be defined.
  • c: To be defined.

Returns

Returns a long long 64 bit key for a triangle.

Code

long long getTriKey ( WORD a, WORD b, WORD c )
{
    WORD tmp;
    if ( b < a ) { tmp = b; b = a; a = tmp; }
    if ( c < b ) { tmp = c; c = b; b = tmp; }
    if ( b < a ) { tmp = b; b = a; a = tmp; }
    return ( ((long long)a) << 32 ) | ( ((long long)b) << 16 ) | ((long long)c);
}

See Also