Team Fortress 2 Source Code as on 22/4/2020
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.

37 lines
914 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #ifndef BUMPVECTS_H
  10. #define BUMPVECTS_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "mathlib/mathlib.h"
  15. #define OO_SQRT_2 0.70710676908493042f
  16. #define OO_SQRT_3 0.57735025882720947f
  17. #define OO_SQRT_6 0.40824821591377258f
  18. // sqrt( 2 / 3 )
  19. #define OO_SQRT_2_OVER_3 0.81649661064147949f
  20. #define NUM_BUMP_VECTS 3
  21. const TableVector g_localBumpBasis[NUM_BUMP_VECTS] =
  22. {
  23. { OO_SQRT_2_OVER_3, 0.0f, OO_SQRT_3 },
  24. { -OO_SQRT_6, OO_SQRT_2, OO_SQRT_3 },
  25. { -OO_SQRT_6, -OO_SQRT_2, OO_SQRT_3 }
  26. };
  27. void GetBumpNormals( const Vector& sVect, const Vector& tVect, const Vector& flatNormal,
  28. const Vector& phongNormal, Vector bumpNormals[NUM_BUMP_VECTS] );
  29. #endif // BUMPVECTS_H