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);
}
}
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;
}
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);
}
}
}
Aggregations