Guest User

Jiggle.cs

a guest
Jan 24th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. namespace Assets.DuckType.Jiggle
  6. {
  7. public class Jiggle : MonoBehaviour
  8. {
  9. private const float TORQUE_FACTOR = 0.001f;
  10.  
  11. private bool m_Initialised;
  12.  
  13. private Quaternion m_RestLocalRotation;
  14.  
  15. private Quaternion m_LastWorldRotation;
  16.  
  17. private Quaternion m_Torque = Quaternion.identity;
  18.  
  19. private Vector3 m_LastCenterOfMassWorld;
  20.  
  21. private float m_NoisePhase;
  22.  
  23. public bool UpdateWithPhysics;
  24.  
  25. public bool UseCenterOfMass = true;
  26.  
  27. public Vector3 CenterOfMass = new Vector3(1f, 0f, 0f);
  28.  
  29. public float CenterOfMassInertia = 1f;
  30.  
  31. public bool AddWind;
  32.  
  33. public Vector3 WindDirection = new Vector3(1f, 0f, 0f);
  34.  
  35. public float WindStrength = 1f;
  36.  
  37. public bool AddNoise;
  38.  
  39. public float NoiseStrength = 1f;
  40.  
  41. public float NoiseScale = 1f;
  42.  
  43. public float NoiseSpeed = 1f;
  44.  
  45. public float RotationInertia = 1f;
  46.  
  47. public float Gravity;
  48.  
  49. public float SpringStrength = 0.4f;
  50.  
  51. public float Dampening = 0.4f;
  52.  
  53. public bool BlendToOriginalRotation;
  54.  
  55. public bool Hinge;
  56.  
  57. public float HingeAngle;
  58.  
  59. public bool UseAngleLimit;
  60.  
  61. public float AngleLimit = 180f;
  62.  
  63. public bool UseSoftLimit;
  64.  
  65. public float SoftLimitInfluence = 0.5f;
  66.  
  67. public float SoftLimitStrength = 0.5f;
  68.  
  69. public bool ShowViewportGizmos = true;
  70.  
  71. public float GizmoScale = 0.1f;
  72.  
  73. }
  74. }
  75.  
Advertisement
Add Comment
Please, Sign In to add comment