MassSpringSystem
Simple mass-spring-system for simulating cloth etc. and supports the tree standard spring types 'structural' (als originally given by index field), 'shear' (over cross), and 'bend' (from i to i+2). Output vertices can be routed to any rendering node like IndexedFaceSet.
Inheritance
Code
XML encoding
<MassSpringSystem index='' anchorIndex='' coord='' normal='' velocity='' autoCalcAnchor='TRUE' individualDistance='FALSE' collisionDomainType='' collisionDomainParam='' springTypes='' gravity='0 -1 0' externalForce='0 0 0' perMassRandomPerturbation='0' springConstantStructural='4' springConstantShear='4' springConstantBend='4' springConstantUser='1' mass='1' damping='0.1' structuralDamping='0.6' shearDamping='0.6' bendDamping='0.6' restitution='0.1' staticFriction='0.2' slidingFriction='0.2' airFriction='1.0' massRadius='1.0' springIndex='' springConstant='' integrationType='explicitEuler' time='0' speed='1' minStepsPerFrame='-1' maxStepsPerFrame='-1' maxStepTime='-1' localCoordSystem='TRUE' enabled='TRUE' logFeature='' />
Classic encoding
MassSpringSystem {
index []
anchorIndex []
coord []
normal []
velocity []
autoCalcAnchor TRUE
individualDistance FALSE
collisionDomainType [""]
collisionDomainParam []
springTypes [""]
gravity 0 -1 0
externalForce 0 0 0
perMassRandomPerturbation 0
springConstantStructural 4
springConstantShear 4
springConstantBend 4
springConstantUser 1
mass 1
damping 0.1
structuralDamping 0.6
shearDamping 0.6
bendDamping 0.6
restitution 0.1
staticFriction 0.2
slidingFriction 0.2
airFriction 1.0
massRadius 1.0
springIndex []
springConstant []
integrationType "explicitEuler"
time 0
speed 1
minStepsPerFrame -1
maxStepsPerFrame -1
maxStepTime -1
localCoordSystem TRUE
enabled TRUE
logFeature [""]
}
Interface
Filter: X3D only | Avalon only | All
| id | Name | DataType | PartType | Default | ValueType | Description |
|---|---|---|---|---|---|---|
| index | MFInt32 | inputOutput | index field, holds topological information of mesh, used to create springs | |||
| anchorIndex | MFInt32 | inputOutput | contains all points which are not allowed to move | |||
| coord | MFVec3f | inputOutput | coordinates of vertices resp. mass points (updated during simulation) | |||
| normal | MFVec3f | inputOutput | vertex normals | |||
| velocity | MFVec3f | inputOutput | initial velocity | |||
| autoCalcAnchor | SFBool | inputOutput | TRUE | if true, collect all indices of points being inside collision objects | ||
| individualDistance | SFBool | inputOutput | FALSE | use offset distance to collision objects to avoid penetration | ||
| collisionDomainType | MFString | inputOutput | [NONE, SPHERE, PLANE, BOX, ELLIPSOID, CYLINDER] | type of collision object, e.g. plane or sphere, each object has up to nine params. NONE: no object; SPHERE: spherical object; PLANE: planar object; BOX: box shaped object; ELLIPSOID: ellipsoidal object; CYLINDER: cylindrical object; | ||
| collisionDomainParam | MFFloat | inputOutput | parameters like center and radius for creating collision objects, last param [>]0 means [dis]connected | |||
| springTypes | MFString | inputOutput | [STRUCTURAL, SHEAR, BEND] | Used for automatic spring generation. STRUCTURAL: connects along edge; SHEAR: connects along along diameter; BEND: connects mass with the mass two edges further; | ||
| gravity | SFVec3f | inputOutput | 0 -1 0 | acceleration of fall due to gravity | ||
| externalForce | SFVec3f | inputOutput | 0 0 0 | e.g. wind force | ||
| perMassRandomPerturbation | SFFloat | inputOutput | 0 | perturb wind etc. per mass | ||
| springConstantStructural | SFFloat | inputOutput | 4 | hook's spring constant (for structural type) | ||
| springConstantShear | SFFloat | inputOutput | 4 | hook's spring constant (for shear type) | ||
| springConstantBend | SFFloat | inputOutput | 4 | hook's spring constant (for bend type) | ||
| springConstantUser | SFFloat | inputOutput | 1 | user spring constant (needed for e.g. dragging) | ||
| mass | SFFloat | inputOutput | 1 | the mass (assumed the same for all mass points) | ||
| damping | SFFloat | inputOutput | 0.1 | viscous drag coefficient (world) | ||
| structuralDamping | SFFloat | inputOutput | 0.6 | struct. spring-damper-element | ||
| shearDamping | SFFloat | inputOutput | 0.6 | shear spring-damper-element | ||
| bendDamping | SFFloat | inputOutput | 0.6 | bend spring-damper-element | ||
| restitution | SFFloat | inputOutput | 0.1 | coefficient of restitution (says how much object is bouncing back) | ||
| staticFriction | SFFloat | inputOutput | 0.2 | friction occuring during slow motion | ||
| slidingFriction | SFFloat | inputOutput | 0.2 | friction occuring during fast motion | ||
| airFriction | SFFloat | inputOutput | 1.0 | generic damping factor for simulationg viscosity of air | ||
| massRadius | SFFloat | inputOutput | 1.0 | max offset added to collision object size | ||
| springIndex | MFInt32 | inputOutput | user defined springs, e.g. [3 7 -1 2 9 -1] | |||
| springConstant | MFFloat | inputOutput | spring constants/ damping for springIndex field | |||
| integrationType | SFString | inputOutput | explicitEuler | [explicitEuler, implicitEuler, Verlet] | type of numerical integration scheme, default is explicitEuler. explicitEuler: the fastest one; implicitEuler: better don't use; Verlet: similiar to euler; | |
| isActive | SFBool | inputOnly | enable/ disable picking of mass points | |||
| trackPoint_changed | SFVec3f | inputOnly | For picking (and therefore dragging) single mass points. | |||
| time | SFTime | inputOutput | 0 | Externally triggered time (internally used for dT). | ||
| speed | SFFloat | inputOutput | 1 | Scaling factor for simulation speed. | ||
| minStepsPerFrame | SFInt32 | inputOutput | -1 | minimum value for iteration steps per frame | ||
| maxStepsPerFrame | SFInt32 | inputOutput | -1 | maximum value for iteration steps per frame | ||
| maxStepTime | SFTime | inputOutput | -1 | upper bound for dT (useful for preventing simulation from blowing off if frame rate is too low) | ||
| localCoordSystem | SFBool | inputOutput | TRUE | evaluate calculations (e.g. gravitation) in local or global coordinate frame | ||
| enabled | SFBool | inputOutput | TRUE | Flag to enable/disable the node behaviour | ||
| logFeature | MFString | inputOutput | state, child, parent, route, eventIn, eventOut | controls the logging of changes, state: log state changes (e.g. live), child: log child add/remove, parent: log parent add/remove, route: log route add/remove; eventIn: log receiving of events, eventOut: log sending of events: guiView, runtime system should create node-view, guiEdit: runtime system should create node-editeverything: log everything | ||
| metadata | SFNode | inputOutput | MetadataObject | container for payload metadata inside MetadataSet element |
