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.

68 lines
1.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef C_JIGGLEBONES_H
  9. #define C_JIGGLEBONES_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "studio.h"
  14. #include "utlvector.h"
  15. #include "utllinkedlist.h"
  16. //-----------------------------------------------------------------------------
  17. /**
  18. * JiggleData is the instance-specific data for a jiggle bone
  19. */
  20. struct JiggleData
  21. {
  22. void Init( int initBone, float currenttime, const Vector &initBasePos, const Vector &initTipPos )
  23. {
  24. bone = initBone;
  25. lastUpdate = currenttime;
  26. basePos = initBasePos;
  27. baseLastPos = basePos;
  28. baseVel.Init();
  29. baseAccel.Init();
  30. tipPos = initTipPos;
  31. tipVel.Init();
  32. tipAccel.Init();
  33. }
  34. int bone;
  35. int id;
  36. float lastUpdate; // based on gpGlobals->realtime
  37. Vector basePos; // position of the base of the jiggle bone
  38. Vector baseLastPos;
  39. Vector baseVel;
  40. Vector baseAccel;
  41. Vector tipPos; // position of the tip of the jiggle bone
  42. Vector tipVel;
  43. Vector tipAccel;
  44. };
  45. class CJiggleBones
  46. {
  47. public:
  48. JiggleData * GetJiggleData( int bone, float currenttime, const Vector &initBasePos, const Vector &initTipPos );
  49. void BuildJiggleTransformations( int boneIndex, float currentime, const mstudiojigglebone_t *jiggleParams, const matrix3x4_t &goalMX, matrix3x4_t &boneMX, bool coordSystemIsFlipped );
  50. CUtlLinkedList< JiggleData > m_jiggleBoneState;
  51. };
  52. extern void DevMsgRT( PRINTF_FORMAT_STRING char const* pMsg, ... );
  53. #endif // C_BASEANIMATING_H