PhysicsSpring Class Reference

Spring. More...

List of all members.

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

Detailed Description

Spring.


Constructor & Destructor Documentation

PhysicsSpring ( PhysicsBody  body1,
PhysicsBody  body2,
Vector2  anchor1,
Vector2  anchor2,
uint  index1,
uint  index2 
)

PhysicsSpring Constructor.

Parameters:
body1one of rigid body for spring
body2the other of rigid body for spring
anchor1anchor point1 of spring
anchor2anchor point2 of spring
index1index of body1
index2index of body2

Member Function Documentation

void CopySpring ( PhysicsSpring  jnt)

Copy all members of spring.

Parameters:
jntspring

Member Data Documentation

float dumping = 0.4f

velocity dumping parameter

To remove unstability of frequent oscillation