@Goocolax post TWT no DC/Ban
- - - Updated - - -
Based on this article:
PT-BR ( https://pt.wikipedia.org/wiki/Caixa_...ra_m%C3%ADnimaⓘ ).
EN-US ( https://en.wikipedia.org/wiki/Bounding_volumeⓘ ).

Dynamic 3D Boxes based on player AABB.
PT-BR ( https://pt.wikipedia.org/wiki/Caixa_...ra_m%C3%ADnimaⓘ ).
EN-US ( https://en.wikipedia.org/wiki/Bounding_volumeⓘ ).

Dynamic 3D Boxes based on player AABB.
Code:
template<class it, class actor>
void CESPFunctions<it, actor>::AABB3D( void ) const
{
D3DXVECTOR3 vec[ 8 ] { D3DXVECTOR3( 0, 0, 0 ) };
D3DXVECTOR3 max = this->getEntityIterator( )->getLTObject( )->BoxMax;
D3DXVECTOR3 min = this->getEntityIterator( )->getLTObject( )->BoxMin;
if( pEngine->worldToScreen( min, &vec[ 0 ] ) &&
pEngine->worldToScreen( max, &vec[ 1 ] ) &&
pEngine->worldToScreen( D3DXVECTOR3( max.x, min.y, min.z ), &vec[ 2 ] ) &&
pEngine->worldToScreen( D3DXVECTOR3( min.x, max.y, min.z ), &vec[ 3 ] ) &&
pEngine->worldToScreen( D3DXVECTOR3( min.x, min.y, max.z ), &vec[ 4 ] ) &&
pEngine->worldToScreen( D3DXVECTOR3( min.x, max.y, max.z ), &vec[ 5 ] ) &&
pEngine->worldToScreen( D3DXVECTOR3( max.x, min.y, max.z ), &vec[ 6 ] ) &&
pEngine->worldToScreen( D3DXVECTOR3( max.x, max.y, min.z ), &vec[ 7 ] ) )
{
pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 4 ].x, vec[ 4 ].y, Color( dwColor ) );
pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 7 ].x, vec[ 7 ].y, Color( dwColor ) );
pRender->Line( vec[ 2 ].x, vec[ 2 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
pRender->Line( vec[ 3 ].x, vec[ 3 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );
pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 2 ].x, vec[ 2 ].y, Color( dwColor ) );
pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 3 ].x, vec[ 3 ].y, Color( dwColor ) );
pRender->Line( vec[ 7 ].x, vec[ 7 ].y, vec[ 2 ].x, vec[ 2 ].y, Color( dwColor ) );
pRender->Line( vec[ 7 ].x, vec[ 7 ].y, vec[ 3 ].x, vec[ 3 ].y, Color( dwColor ) );
pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );
pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
pRender->Line( vec[ 4 ].x, vec[ 4 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );
pRender->Line( vec[ 4 ].x, vec[ 4 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
}
}
more work for little gain
#16 ·



