Search in sources :

Example 11 with Wrench

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

the class RigidBody method copy.

@Override
public RigidBody copy(int flags, Map<ModelComponent, ModelComponent> copyMap) {
    RigidBody comp = (RigidBody) super.copy(flags, copyMap);
    // comp.myAttachments = new ArrayList<PointFrameAttachment>();
    // comp.myComponents = new ArrayList<ModelComponent>();
    // comp.indicesValidP = false;
    comp.setDynamic(true);
    comp.mySpatialInertia = new SpatialInertia(mySpatialInertia);
    // comp.myEffectiveInertia = new SpatialInertia (mySpatialInertia);
    PolygonalMesh mesh = getMesh();
    comp.myMeshInfo = new MeshInfo();
    if (mesh != null) {
        PolygonalMesh meshCopy = mesh.copy();
        comp.setMesh(meshCopy, getMeshFileName(), getMeshFileTransform());
        comp.myMeshInfo.myFlippedP = myMeshInfo.myFlippedP;
    } else {
        comp.setMesh(null, null, null);
    }
    // comp.myMarkers =
    // new PointList<FrameMarker> (
    // FrameMarker.class, "markers", "k");
    // comp.add (comp.myMarkers);
    comp.myBodyForce = new Wrench();
    comp.myCoriolisForce = new Wrench();
    comp.myBodyVel = new Twist();
    comp.myBodyAcc = new Twist();
    comp.myQvel = new Quaternion();
    comp.myTmpPos = new Point3d();
    comp.myConnectors = null;
    return comp;
}
Also used : Twist(maspack.spatialmotion.Twist) Wrench(maspack.spatialmotion.Wrench) Quaternion(maspack.matrix.Quaternion) Point3d(maspack.matrix.Point3d) PolygonalMesh(maspack.geometry.PolygonalMesh) SpatialInertia(maspack.spatialmotion.SpatialInertia)

Aggregations

Wrench (maspack.spatialmotion.Wrench)11 Twist (maspack.spatialmotion.Twist)7 SpatialInertia (maspack.spatialmotion.SpatialInertia)4 Point3d (maspack.matrix.Point3d)3 RigidTransform3d (maspack.matrix.RigidTransform3d)2 Point (artisynth.core.mechmodels.Point)1 HasCoordinateFrame (artisynth.core.modelbase.HasCoordinateFrame)1 PolygonalMesh (maspack.geometry.PolygonalMesh)1 Matrix3d (maspack.matrix.Matrix3d)1 Matrix3x3Block (maspack.matrix.Matrix3x3Block)1 Matrix6d (maspack.matrix.Matrix6d)1 Matrix6dBlock (maspack.matrix.Matrix6dBlock)1 MatrixBlock (maspack.matrix.MatrixBlock)1 Quaternion (maspack.matrix.Quaternion)1 RotationMatrix3d (maspack.matrix.RotationMatrix3d)1