Packageorg.generalrelativity.foam.dynamics.force.spring
Classpublic class RigidBodySpring
InheritanceRigidBodySpring Inheritance Spring Inheritance SimpleForceGenerator
SubclassesRigidBodyBungee



Public Properties
 PropertyDefined by
 InheritedrestLength : Number
Spring
Protected Properties
 PropertyDefined by
 Inheriteddamp : Number
damping
Spring
 Inheritedelement1 : ISimulatable
element to generate spring force on
Spring
 Inheritedelement2 : ISimulatable
element to connect "other" end of spring to
Spring
 Inherited_force : Vector
force to apply to element(s)
SimpleForceGenerator
 Inheritedk : Number
spring coefficient (0 - 1.0)
Spring
  point1 : Vector
RigidBodySpring
  point2 : Vector
RigidBodySpring
 Inherited_restLength : Number
the spring's happy length (where no force is generated
Spring
Public Methods
 MethodDefined by
  
RigidBodySpring(body1:IBody, point1:Vector, body2:IBody, point2:Vector, k:Number = 0.01, damp:Number = 0.01)
Creates a new RigidBodySpring
RigidBodySpring
  
clone(invert:Boolean = true):Spring
RigidBodySpring
 Inherited
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
 Inherited
invert():void
Inverts the spring so that the force is applied to element2 instead of 1
Spring
Property detail
point1property
protected var point1:Vector
point2property 
protected var point2:Vector
Constructor detail
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

Parameters
body1: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
Method detail
clone()method
public override function clone(invert:Boolean = true):SpringParameters
invert:Boolean (default = true)

Returns
Spring
generate()method 
public override function generate(element:ISimulatable):voidParameters
element:ISimulatable
getPoint1InWorldSpace()method 
public override function getPoint1InWorldSpace():Vector

Returns
Vector
getPoint2InWorldSpace()method 
public override function getPoint2InWorldSpace():Vector

Returns
Vector