use of artisynth.core.mechmodels.Particle in project artisynth_core by artisynth.
the class PointModel1d method setProperties.
public void setProperties() {
double springK = 100.0;
double passiveFraction = 0.5;
double muscleD = 0.0;
double pointDamping = 0.1;
for (AxialSpring s : model.axialSprings()) {
if (s instanceof AxialSpring) {
if (s.getMaterial() instanceof LinearAxialMaterial) {
LinearAxialMaterial mat = (LinearAxialMaterial) s.getMaterial().clone();
mat.setStiffness(springK);
s.setMaterial(mat);
}
}
if (s instanceof Muscle) {
Muscle m = (Muscle) s;
if (m.getMaterial() instanceof AxialMuscleMaterial) {
AxialMuscleMaterial mat = (AxialMuscleMaterial) m.getMaterial().clone();
mat.setPassiveFraction(passiveFraction);
mat.setDamping(muscleD);
m.setMaterial(mat);
}
}
}
for (Particle p : model.particles()) {
p.setPointDamping(pointDamping);
}
}
Aggregations