SpringGenerator Class
This generator simulates a spring with both ends attached to entities.
Constructor
SpringGenerator
(
-
entity
-
restLength
-
stiffness
Parameters:
-
entity
EntityThis entity should have the Position and Movable components.
-
restLength
Number -
stiffness
Number
Item Index
Methods
applyForce
(
-
entity
Parameters:
-
entity
EntityThe other entity the spring force should be applied to. This entity should have the Position and Movable components.
getRestLength
()
Number
Returns:
Number:
getStiffness
()
Number
Returns:
Number:
setEntity
(
-
entity
Parameters:
-
entity
EntityThis entity should have the Position and Movable components.
setRestLength
(
-
restLength
Parameters:
-
restLength
Number
setStiffness
(
-
stiffness
Parameters:
-
stiffness
Number