Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #include "mathlib/ssemath.h"
  7. #include "mathlib/ssequaternion.h"
  8. // NOTE: This has to be the last file included!
  9. #include "tier0/memdbgon.h"
  10. // get the kdop vectors for k=32
  11. #include "dopvectors.h"
  12. void KDop32_t::AddPointSet( Vector const *pPoints, int nPnts )
  13. {
  14. for( int i = 0; i < nPnts; i++ )
  15. {
  16. fltx4 fl4PntX = ReplicateX4( pPoints->x );
  17. fltx4 fl4PntY = ReplicateX4( pPoints->y );
  18. fltx4 fl4PntZ = ReplicateX4( pPoints->z );
  19. for( int c = 0; c < 4; c++ )
  20. {
  21. fltx4 fl4Dot = AddSIMD( AddSIMD( MulSIMD( fl4PntX, g_KDop32XDirs[c] ), MulSIMD( fl4PntY, g_KDop32YDirs[c] ) ),
  22. MulSIMD( fl4PntZ, g_KDop32ZDirs[c] ) );
  23. m_Mins[c] = MinSIMD( fl4Dot, m_Mins[c] );
  24. m_Maxes[c] = MaxSIMD( fl4Dot, m_Maxes[c] );
  25. }
  26. pPoints++;
  27. }
  28. }
  29. void KDop32_t::CreateFromPointSet( Vector const *pPoints, int nPnts )
  30. {
  31. Init();
  32. AddPointSet( pPoints, nPnts );
  33. }