use of artisynth.core.materials.RotAxisFrameMaterial in project artisynth_core by artisynth.
the class FrameSpringDemo method addFrameSpring.
public void addFrameSpring(RigidBody bodyA, RigidBody bodyB, double x, double y, double z, double kRot) {
RigidTransform3d TDW = new RigidTransform3d();
RigidTransform3d TCA = new RigidTransform3d();
RigidTransform3d XDB = new RigidTransform3d();
TDW.p.set(x, y, z);
TCA.mulInverseLeft(bodyA.getPose(), TDW);
XDB.mulInverseLeft(bodyB.getPose(), TDW);
FrameSpring spring = new FrameSpring(null);
spring.setMaterial(new RotAxisFrameMaterial(0, kRot, 0, 0));
// spring.setRotaryStiffness (kRot);
spring.setAttachFrameA(TCA);
spring.setAttachFrameB(XDB);
myMechMod.attachFrameSpring(bodyA, bodyB, spring);
}
use of artisynth.core.materials.RotAxisFrameMaterial in project artisynth_core by artisynth.
the class LaymanModel method addFrameSpring.
// private void addContact (RigidBody bodyA, RigidBody bodyB, double mu)
// {
// myMechMod.addRigidBodyContact(new RigidBodyContact(bodyA, bodyB), mu);
// }
public void addFrameSpring(RigidBody bodyA, RigidBody bodyB, double x, double y, double z, double kRot) {
RigidTransform3d TDW = new RigidTransform3d();
RigidTransform3d TCA = new RigidTransform3d();
RigidTransform3d XDB = new RigidTransform3d();
TDW.p.set(x, y, z);
TCA.mulInverseLeft(bodyA.getPose(), TDW);
XDB.mulInverseLeft(bodyB.getPose(), TDW);
FrameSpring spring = new FrameSpring(null);
spring.setMaterial(new RotAxisFrameMaterial(0, kRot, 0, 0));
// spring.setRotaryStiffness (kRot);
spring.setAttachFrameA(TCA);
spring.setAttachFrameB(XDB);
attachFrameSpring(bodyA, bodyB, spring);
}
Aggregations