Search in sources :

Example 1 with RotAxisFrameMaterial

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);
}
Also used : RotAxisFrameMaterial(artisynth.core.materials.RotAxisFrameMaterial)

Example 2 with RotAxisFrameMaterial

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);
}
Also used : RotAxisFrameMaterial(artisynth.core.materials.RotAxisFrameMaterial)

Aggregations

RotAxisFrameMaterial (artisynth.core.materials.RotAxisFrameMaterial)2