Spring. More...
Public Member Functions | |
PhysicsSpring (PhysicsBody body1, PhysicsBody body2, Vector2 anchor1, Vector2 anchor2, uint index1, uint index2) | |
PhysicsSpring Constructor. | |
void | CopySpring (PhysicsSpring jnt) |
Copy all members of spring. | |
uint | GetIndex1 () |
GetIndex1. | |
uint | GetIndex2 () |
GetIndex2. | |
Public Attributes | |
uint | totalIndex |
totalIndex of spring | |
Vector2 | localAnchor1 = new Vector2(0, 0) |
relative position to anchor point from bodyA | |
Vector2 | localAnchor2 = new Vector2(0, 0) |
relative position to anchor point from bodyB | |
float | distance = 0.0f |
original distance between two anchor points | |
float | currentDistance = 0.0f |
current distance between two anchor points | |
float | elastic = 10.0f |
spring parameter | |
float | dumping = 0.4f |
velocity dumping parameter | |
Properties | |
uint | TotalIndex [get, set] |
setter and getter of totalIndex | |
Vector2 | LocalAnchor1 [get, set] |
setter and getter of localAnchor1 | |
Vector2 | LocalAnchor2 [get, set] |
setter and getter of localAnchor2 | |
float | Distance [get, set] |
setter and getter of distance | |
float | CurrentDistance [get, set] |
setter and getter of currentDistance | |
float | Elastic [get, set] |
setter and getter of elastic | |
float | Dumping [get, set] |
setter and getter of dumping |
Spring.
PhysicsSpring | ( | PhysicsBody | body1, |
PhysicsBody | body2, | ||
Vector2 | anchor1, | ||
Vector2 | anchor2, | ||
uint | index1, | ||
uint | index2 | ||
) |
PhysicsSpring Constructor.
body1 | one of rigid body for spring |
body2 | the other of rigid body for spring |
anchor1 | anchor point1 of spring |
anchor2 | anchor point2 of spring |
index1 | index of body1 |
index2 | index of body2 |
void CopySpring | ( | PhysicsSpring | jnt | ) |
Copy all members of spring.
jnt | spring |
float dumping = 0.4f |
velocity dumping parameter
To remove unstability of frequent oscillation