Search in sources :

Example 1 with TargetPoint

use of artisynth.core.inverse.TargetPoint in project artisynth_core by artisynth.

the class FemSurfaceTargetDemo method addTrackingController.

public void addTrackingController() {
    TrackingController tcon = new TrackingController(mech, "tcon");
    for (FemNode n : fem.getNodes()) {
        if (n.getPosition().x < -l / 2 + eps) {
            tcon.addMotionTarget(n);
            RenderProps.setAlpha(n, 0.5);
        }
    }
    for (MuscleBundle b : fem.getMuscleBundles()) {
        tcon.addExciter(b);
    }
    // project reference points to body
    addController(new SurfaceTargetController(body.getMesh(), tcon.getMotionSources(), tcon.getTargetPoints()));
    for (TargetPoint p : tcon.getTargetPoints()) {
        RenderProps.setPointRadius(p, l / 100);
    }
    tcon.addL2RegularizationTerm(0.1);
    tcon.setProbeDuration(10);
    tcon.createProbesAndPanel(this);
    addController(tcon);
}
Also used : FemNode(artisynth.core.femmodels.FemNode) MuscleBundle(artisynth.core.femmodels.MuscleBundle) TargetPoint(artisynth.core.inverse.TargetPoint) TrackingController(artisynth.core.inverse.TrackingController)

Aggregations

FemNode (artisynth.core.femmodels.FemNode)1 MuscleBundle (artisynth.core.femmodels.MuscleBundle)1 TargetPoint (artisynth.core.inverse.TargetPoint)1 TrackingController (artisynth.core.inverse.TrackingController)1