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.

92 lines
3.0 KiB

  1. //====== Copyright � 1996-2009, Valve Corporation, All rights reserved. =======
  2. //
  3. // DmeJiggleBone
  4. //
  5. //=============================================================================
  6. // Valve includes
  7. #include "datamodel/dmelementfactoryhelper.h"
  8. #include "mdlobjects/dmejigglebone.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //-----------------------------------------------------------------------------
  12. // DmeJiggleBone
  13. //-----------------------------------------------------------------------------
  14. IMPLEMENT_ELEMENT_FACTORY( DmeJiggleBone, CDmeJiggleBone );
  15. //-----------------------------------------------------------------------------
  16. //
  17. //-----------------------------------------------------------------------------
  18. void CDmeJiggleBone::OnConstruction()
  19. {
  20. // flags
  21. m_bRigid.InitAndSet( this, "rigid", false );
  22. m_bFlexible.InitAndSet( this, "flexible", false );
  23. m_bBaseSpring.InitAndSet( this, "baseSpring", false );
  24. m_bYawConstrained.InitAndSet( this, "yawConstrained", false );
  25. m_bPitchConstrained.InitAndSet( this, "pitchConstrained", false );
  26. m_bLengthConstrained.InitAndSet( this, "lengthConstrained", false );
  27. m_bAngleConstrained.InitAndSet( this, "angleConstrained", false );
  28. // general params
  29. m_flLength.InitAndSet( this, "length", 10.0f );
  30. m_flTipMass.Init( this, "tipMass" );
  31. // angle constraint
  32. m_flAngleLimit.Init( this, "angleLimit" );
  33. // yaw constraint
  34. m_flYawMin.Init( this, "yawMin" );
  35. m_flYawMax.Init( this, "yawMax" );
  36. m_flYawFriction.Init( this, "yawFriction" );
  37. m_flYawBounce.Init( this, "yawBounce" );
  38. // flexible params
  39. m_flYawStiffness.InitAndSet( this, "yawStiffness", 100.0f );
  40. m_flYawDamping.Init( this, "yawDamping" );
  41. m_flPitchStiffness.InitAndSet( this, "pitchStiffness", 100.0f );
  42. m_flPitchDamping.Init( this, "pitchDamping" );
  43. m_flAlongStiffness.InitAndSet( this, "alongStiffness", 100.0f );
  44. m_flAlongDamping.Init( this, "alongDamping" );
  45. // pitch constraint
  46. m_flPitchMin.Init( this, "pitchMin" );
  47. m_flPitchMax.Init( this, "pitchMax" );
  48. m_flPitchFriction.Init( this, "pitchFriction" );
  49. m_flPitchBounce.Init( this, "pitchBounce" );
  50. // base spring
  51. m_flBaseMass.Init( this, "baseMass" );
  52. m_flBaseStiffness.Init( this, "baseStiffness", 100.0f );
  53. m_flBaseDamping.Init( this, "baseDamping" );
  54. // base spring yaw
  55. m_flBaseYawMin.Init( this, "baseYawMin", -100.0f );
  56. m_flBaseYawMax.Init( this, "baseYawMax", 100.0f );
  57. m_flBaseYawFriction.Init( this, "baseYawFriction" );
  58. // base spring pitch
  59. m_flBasePitchMin.Init( this, "basePitchMin", -100.0f );
  60. m_flBasePitchMax.Init( this, "basePitchMax", 100.0f );
  61. m_flBasePitchFriction.Init( this, "basePitchFriction" );
  62. // base spring pitch
  63. m_flBaseAlongMin.Init( this, "baseAlongMin", -100.0f );
  64. m_flBaseAlongMax.Init( this, "baseAlongMax", 100.0f );
  65. m_flBaseAlongFriction.Init( this, "baseAlongFriction" );
  66. }
  67. //-----------------------------------------------------------------------------
  68. //
  69. //-----------------------------------------------------------------------------
  70. void CDmeJiggleBone::OnDestruction()
  71. {
  72. }