void FoundryHelpers_DrawEntityHighlightEffect( C_BaseEntity *pEnt )
{
	CCollisionProperty *pCollision = pEnt->CollisionProp();

	// Transform the OBB corners into world space.
	const Vector &vMins = pCollision->OBBMins();
	const Vector &vMaxs = pCollision->OBBMaxs();
	Vector vPoints[8] = 
	{
		Vector( vMins.x, vMins.y, vMins.z ),
		Vector( vMaxs.x, vMins.y, vMins.z ),
		Vector( vMaxs.x, vMaxs.y, vMins.z ),
		Vector( vMins.x, vMaxs.y, vMins.z ),
		
		Vector( vMins.x, vMins.y, vMaxs.z ),
		Vector( vMaxs.x, vMins.y, vMaxs.z ),
		Vector( vMaxs.x, vMaxs.y, vMaxs.z ),
		Vector( vMins.x, vMaxs.y, vMaxs.z )
	};

	for ( int i=0; i < 8; i++ )
	{
		Vector vTmp;
		vPoints[i] = pCollision->CollisionToWorldSpace( vPoints[i], &vTmp );
	}

	// Draw lines connecting them up...
	for ( int i=0; i < 4; i++ )
	{
		AddCoolLine( vPoints[i], vPoints[(i+1)%4], 0, false );
		AddCoolLine( vPoints[i+4], vPoints[(i+1)%4 + 4], 4, true );
		AddCoolLine( vPoints[i], vPoints[i+4], i*2+4, (i%1) == 0 );
	}
}
示例#2
0
static bool IsSmall( CBaseEntity *pBlocker )
{
	CCollisionProperty *pCollisionProp = pBlocker->CollisionProp();
	int  nSmaller = 0;
	Vector vecSize = pCollisionProp->OBBMaxs() - pCollisionProp->OBBMins();
	for ( int i = 0; i < 3; i++ )
	{
		if ( vecSize[i] >= 42 )
			return false;

		if ( vecSize[i] <= 30 )
		{
			nSmaller++;
		}
	}

	return ( nSmaller >= 2 );
}
示例#3
0
static void RecvProxy_OBBMins( const CRecvProxyData *pData, void *pStruct, void *pOut )
{
	CCollisionProperty *pProp = ((CCollisionProperty*)pStruct);
	Vector &vecMins = *((Vector*)pData->m_Value.m_Vector);
	pProp->SetCollisionBounds( vecMins, pProp->OBBMaxs() );
}