Search in sources :

Example 1 with RevoluteCoupling

use of maspack.spatialmotion.RevoluteCoupling in project artisynth_core by artisynth.

the class RevoluteJoint method setTheta.

public void setTheta(double theta) {
    theta = myThetaRange.makeValid(theta);
    RigidTransform3d TGD = new RigidTransform3d();
    ((RevoluteCoupling) myCoupling).setTheta(TGD, Math.toRadians(theta));
    if (getParent() != null) {
        // if we are connected to the hierarchy, adjust the poses of the
        // attached bodies appropriately.
        adjustPoses(TGD);
    }
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) RevoluteCoupling(maspack.spatialmotion.RevoluteCoupling)

Example 2 with RevoluteCoupling

use of maspack.spatialmotion.RevoluteCoupling in project artisynth_core by artisynth.

the class RevoluteJoint method copy.

@Override
public ModelComponent copy(int flags, Map<ModelComponent, ModelComponent> copyMap) {
    RevoluteJoint copy = (RevoluteJoint) super.copy(flags, copyMap);
    copy.myCoupling = new RevoluteCoupling();
    // copy.setNumConstraints (5);
    copy.setAxisLength(myAxisLength);
    copy.setRenderProps(getRenderProps());
    // copy.setBodies (copy.myBodyA, getTCA(), copy.myBodyB, getTDB());
    copy.setThetaRange(myThetaRange);
    return copy;
}
Also used : RevoluteCoupling(maspack.spatialmotion.RevoluteCoupling)

Example 3 with RevoluteCoupling

use of maspack.spatialmotion.RevoluteCoupling in project artisynth_core by artisynth.

the class RevoluteJoint method setThetaRange.

public void setThetaRange(DoubleInterval range) {
    RevoluteCoupling coupling = (RevoluteCoupling) myCoupling;
    coupling.setMaximumTheta(Math.toRadians(range.getUpperBound()));
    coupling.setMinimumTheta(Math.toRadians(range.getLowerBound()));
    myThetaRange.set(range);
    if (getParent() != null) {
        // we are attached - might have to update theta
        double theta = getTheta();
        double clipped = myThetaRange.clipToRange(theta);
        if (clipped != theta) {
            setTheta(clipped);
        }
    }
}
Also used : RevoluteCoupling(maspack.spatialmotion.RevoluteCoupling)

Aggregations

RevoluteCoupling (maspack.spatialmotion.RevoluteCoupling)3 RigidTransform3d (maspack.matrix.RigidTransform3d)1