#include <spring.h>
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.
StepCore::Spring::Spring |
( |
double |
restLength = 0 , |
|
|
double |
stiffness = 1 , |
|
|
double |
damping = 0 , |
|
|
Item * |
body1 = 0 , |
|
|
Item * |
body2 = 0 |
|
) |
| |
|
explicit |
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 |
Creates specific ObjectErrors-derived class (to be reimplemented in derived classes)
Reimplemented from StepCore::Item.
Definition at line 217 of file spring.h.
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 177 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 198 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 137 of file spring.cc.
void StepCore::Spring::setBody2 |
( |
Object * |
body2 | ) |
|
Set pointer to the second connected body.
Definition at line 157 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 222 of file spring.cc.
Vector2d StepCore::Spring::velocity2 |
( |
| ) |
const |
Velocity of the second end of the spring.
Definition at line 239 of file spring.cc.
Object* StepCore::Spring::_body1 |
|
protected |
Object* StepCore::Spring::_body2 |
|
protected |
double StepCore::Spring::_damping |
|
protected |
Vector2d StepCore::Spring::_localPosition1 |
|
protected |
Vector2d StepCore::Spring::_localPosition2 |
|
protected |
double StepCore::Spring::_restLength |
|
protected |
double StepCore::Spring::_stiffness |
|
protected |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:43 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.