-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathSpringData.cs
More file actions
30 lines (27 loc) · 763 Bytes
/
SpringData.cs
File metadata and controls
30 lines (27 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public struct SpringData
{
//Spring constant
public readonly float k;
//Rest length
public readonly float restLength;
//Spring mass
public readonly float m;
//Radius of the wire the spring is made up of
public readonly float wireRadius;
//Radius of the spring
public readonly float radius;
//Number of spirals
public readonly int spirals;
public SpringData(float k, float restLength, float m, float wireRadius, float radius, int spirals = 5)
{
this.k = k;
this.restLength = restLength;
this.m = m;
this.wireRadius = wireRadius;
this.radius = radius;
this.spirals = 5;
}
}