use of artisynth.core.probes.NumericControlProbe in project artisynth_core by artisynth.
the class SpinControlProbe method build.
public void build(String[] args) {
MechModel mech = new MechModel("mech");
addModel(mech);
// Create a parametrically controlled rigid body to spin:
RigidBody body = RigidBody.createBox("box", 1.0, 1.0, 0.5, 1000.0);
mech.addRigidBody(body);
body.setDynamic(false);
// Create a NumericControlProbe with size 1, initial spin data
// with time step 2.0, start time 0, and stop time 8.
NumericControlProbe spinProbe = new NumericControlProbe(/*vsize=*/
1, new double[] { 0.0, 90.0, 0.0, -90.0, 0.0 }, 2.0, 0.0, 8.0);
// set cubic interpolation for a smoother result
spinProbe.setInterpolationOrder(Interpolation.Order.Cubic);
// then set the data function:
spinProbe.setDataFunction(new SpinFunction(body));
addInputProbe(spinProbe);
}
Aggregations