step/stepcore
StepCore::Spring Class Reference
[Physical forces]
#include <spring.h>
List of all members.
Detailed Description
Massless spring.
Massless spring is the force between two selected bodies which equals:
where:
is Spring::stiffness
is difference of Particle::position of the first and second body
is Spring::restLength
- Todo:
- how to move setBody1() and setBody2() to PairForce ?
Definition at line 129 of file spring.h.
Constructor & Destructor Documentation
| StepCore::Spring::Spring |
( |
double |
restLength = 0, |
|
|
double |
stiffness = 1, |
|
|
double |
damping = 0, |
|
|
Item * |
body1 = 0, |
|
|
Item * |
body2 = 0 | |
|
) |
| | [explicit] |
Member Function Documentation
| Object* StepCore::Spring::body1 |
( |
|
) |
const [inline] |
Get pointer to the first body.
Definition at line 159 of file spring.h.
| Object* StepCore::Spring::body2 |
( |
|
) |
const [inline] |
Get pointer to the second body.
Definition at line 164 of file spring.h.
| void StepCore::Spring::calcForce |
( |
bool |
calcVariances |
) |
[virtual] |
| ObjectErrors* StepCore::Spring::createObjectErrors |
( |
|
) |
[inline, protected, virtual] |
| double StepCore::Spring::damping |
( |
|
) |
const [inline] |
Get damping of the spring.
Definition at line 154 of file spring.h.
| double StepCore::Spring::force |
( |
|
) |
const |
| double StepCore::Spring::length |
( |
|
) |
const [inline] |
Get current length of the spring.
Definition at line 146 of file spring.h.
| Vector2d StepCore::Spring::localPosition1 |
( |
|
) |
const [inline] |
Local position of the first end of the spring on the body or in the world (if the end is not connected).
Definition at line 170 of file spring.h.
| Vector2d StepCore::Spring::localPosition2 |
( |
|
) |
const [inline] |
Local position of the second end of the spring on the body or in the world (if the end is not connected).
Definition at line 177 of file spring.h.
| Particle* StepCore::Spring::particle1 |
( |
|
) |
const [inline] |
| Particle* StepCore::Spring::particle2 |
( |
|
) |
const [inline] |
| Vector2d StepCore::Spring::position1 |
( |
|
) |
const |
Position of the first end of the spring.
Definition at line 176 of file spring.cc.
| Vector2d StepCore::Spring::position2 |
( |
|
) |
const |
Set position of the first end of the spring (will be ignored the end is connected).
Position of the second end of the spring
Definition at line 197 of file spring.cc.
| double StepCore::Spring::restLength |
( |
|
) |
const [inline] |
Get rest length of the spring.
Definition at line 141 of file spring.h.
| RigidBody* StepCore::Spring::rigidBody1 |
( |
|
) |
const [inline] |
| RigidBody* StepCore::Spring::rigidBody2 |
( |
|
) |
const [inline] |
| void StepCore::Spring::setBody1 |
( |
Object * |
body1 |
) |
|
Set pointer to the first connected body.
Definition at line 136 of file spring.cc.
| void StepCore::Spring::setBody2 |
( |
Object * |
body2 |
) |
|
Set pointer to the second connected body.
Definition at line 156 of file spring.cc.
| void StepCore::Spring::setDamping |
( |
double |
damping |
) |
[inline] |
Set damping of the spring.
Definition at line 156 of file spring.h.
| void StepCore::Spring::setLocalPosition1 |
( |
const Vector2d & |
localPosition1 |
) |
[inline] |
Set local position of the first end of the spring on the body or in the world (if the end is not connected).
Definition at line 173 of file spring.h.
| void StepCore::Spring::setLocalPosition2 |
( |
const Vector2d & |
localPosition2 |
) |
[inline] |
Set local position of the second end of the spring on the body or in the world (if the end is not connected).
Definition at line 180 of file spring.h.
| void StepCore::Spring::setRestLength |
( |
double |
restLength |
) |
[inline] |
Set rest length of the spring.
Definition at line 143 of file spring.h.
| void StepCore::Spring::setStiffness |
( |
double |
stiffness |
) |
[inline] |
Set stiffness of the spring.
Definition at line 151 of file spring.h.
| double StepCore::Spring::stiffness |
( |
|
) |
const [inline] |
Get stiffness of the spring.
Definition at line 149 of file spring.h.
| Vector2d StepCore::Spring::velocity1 |
( |
|
) |
const |
Set position of the second end of the spring (will be ignored the end is connected).
Velocity of the first end of the spring
Definition at line 221 of file spring.cc.
| Vector2d StepCore::Spring::velocity2 |
( |
|
) |
const |
Velocity of the second end of the spring.
Definition at line 238 of file spring.cc.
Member Data Documentation
The documentation for this class was generated from the following files: