| Package | org.generalrelativity.foam.dynamics.force.spring |
| Class | public class RigidBodySpring |
| Inheritance | RigidBodySpring Spring SimpleForceGenerator |
| Subclasses | RigidBodyBungee |
| Property | Defined by | ||
|---|---|---|---|
![]() | damp : Number damping
| Spring | |
![]() | element1 : ISimulatable
element to generate spring force on
| Spring | |
![]() | element2 : ISimulatable
element to connect "other" end of spring to
| Spring | |
![]() | _force : Vector
force to apply to element(s)
| SimpleForceGenerator | |
![]() | k : Number spring coefficient (0 - 1.0)
| Spring | |
| point1 : Vector | RigidBodySpring | ||
| point2 : Vector | RigidBodySpring | ||
![]() | _restLength : Number the spring's happy length (where no force is generated
| Spring | |
| Method | Defined by | ||
|---|---|---|---|
|
RigidBodySpring(body1:IBody, point1:Vector, body2:IBody, point2:Vector, k:Number = 0.01, damp:Number = 0.01)
Creates a new RigidBodySpring
| RigidBodySpring | ||
| RigidBodySpring | |||
![]() |
createDoubleSidedSpring(element1:ISimulatable, element2:ISimulatable, k:Number = 0.01, damp:Number = 0.1):void
[static]
Creates forces for both elements
| Spring | |
|
generate(element:ISimulatable):void
| RigidBodySpring | ||
| RigidBodySpring | |||
| RigidBodySpring | |||
![]() |
invert():void
Inverts the spring so that the force is applied to element2 instead of 1
| Spring | |
| point1 | property |
protected var point1:Vector
| point2 | property |
protected var point2:Vector
| RigidBodySpring | () | constructor |
public function RigidBodySpring(body1:IBody, point1:Vector, body2:IBody, point2:Vector, k:Number = 0.01, damp:Number = 0.01)Creates a new RigidBodySpring
Parametersbody1:IBody — first body involved in spring
|
|
point1:Vector — point on body1 given in relative coordinates
|
|
body2:IBody — second body attached to spring
|
|
point2:Vector — point on body2 given in relative coordinates
|
|
k:Number (default = 0.01) — spring constant
|
|
damp:Number (default = 0.01) — damping coefficient
|
| clone | () | method |
public override function clone(invert:Boolean = true):SpringParameters
invert:Boolean (default = true) |
Spring |
| generate | () | method |
| getPoint1InWorldSpace | () | method |
| getPoint2InWorldSpace | () | method |