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 |
---|---|---|---|---|---|---|
collisionDomainParam | MFFloat | inputOutput | parameters like center and radius for creating collision objects, last param [>]0 means [dis]connected | |||
springConstant | MFFloat | inputOutput | spring constants/ damping for springIndex field | |||
anchorIndex | MFInt32 | inputOutput | contains all points which are not allowed to move | |||
index | MFInt32 | inputOutput | index field, holds topological information of mesh, used to create springs | |||
springIndex | MFInt32 | inputOutput | user defined springs, e.g. [3 7 -1 2 9 -1] | |||
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; | ||
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 | ||
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; | ||
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 | ||
enabled | SFBool | inputOutput | TRUE | Flag to enable/disable the node behaviour | ||
individualDistance | SFBool | inputOutput | FALSE | use offset distance to collision objects to avoid penetration | ||
isActive | SFBool | inputOnly | enable/ disable picking of mass points | |||
localCoordSystem | SFBool | inputOutput | TRUE | evaluate calculations (e.g. gravitation) in local or global coordinate frame | ||
airFriction | SFFloat | inputOutput | 1.0 | generic damping factor for simulationg viscosity of air | ||
bendDamping | SFFloat | inputOutput | 0.6 | bend spring-damper-element | ||
damping | SFFloat | inputOutput | 0.1 | viscous drag coefficient (world) | ||
mass | SFFloat | inputOutput | 1 | the mass (assumed the same for all mass points) | ||
massRadius | SFFloat | inputOutput | 1.0 | max offset added to collision object size | ||
perMassRandomPerturbation | SFFloat | inputOutput | 0 | perturb wind etc. per mass | ||
restitution | SFFloat | inputOutput | 0.1 | coefficient of restitution (says how much object is bouncing back) | ||
shearDamping | SFFloat | inputOutput | 0.6 | shear spring-damper-element | ||
slidingFriction | SFFloat | inputOutput | 0.2 | friction occuring during fast motion | ||
speed | SFFloat | inputOutput | 1 | Scaling factor for simulation speed. | ||
springConstantBend | SFFloat | inputOutput | 4 | hook's spring constant (for bend type) | ||
springConstantShear | SFFloat | inputOutput | 4 | hook's spring constant (for shear type) | ||
springConstantStructural | SFFloat | inputOutput | 4 | hook's spring constant (for structural type) | ||
springConstantUser | SFFloat | inputOutput | 1 | user spring constant (needed for e.g. dragging) | ||
staticFriction | SFFloat | inputOutput | 0.2 | friction occuring during slow motion | ||
structuralDamping | SFFloat | inputOutput | 0.6 | struct. spring-damper-element | ||
maxStepsPerFrame | SFInt32 | inputOutput | -1 | maximum value for iteration steps per frame | ||
minStepsPerFrame | SFInt32 | inputOutput | -1 | minimum value for iteration steps per frame | ||
metadata | SFNode | inputOutput | MetadataObject | container for payload metadata inside MetadataSet element | ||
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; | |
maxStepTime | SFTime | inputOutput | -1 | upper bound for dT (useful for preventing simulation from blowing off if frame rate is too low) | ||
time | SFTime | inputOutput | 0 | Externally triggered time (internally used for dT). | ||
externalForce | SFVec3f | inputOutput | 0 0 0 | e.g. wind force | ||
gravity | SFVec3f | inputOutput | 0 -1 0 | acceleration of fall due to gravity | ||
trackPoint_changed | SFVec3f | inputOnly | For picking (and therefore dragging) single mass points. |