instantreality 1.0

Component:
Simulator
Status:
fully implemented
Structure type:
concrete
Standard:
Avalon

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