Search in sources :

Example 6 with Quaternion

use of maspack.matrix.Quaternion 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

Quaternion (maspack.matrix.Quaternion)6 Point3d (maspack.matrix.Point3d)3 RigidTransform3d (maspack.matrix.RigidTransform3d)3 RotationMatrix3d (maspack.matrix.RotationMatrix3d)2 Vector3d (maspack.matrix.Vector3d)2 SpatialInertia (maspack.spatialmotion.SpatialInertia)2 Twist (maspack.spatialmotion.Twist)2 PolygonalMesh (maspack.geometry.PolygonalMesh)1 NumericListKnot (maspack.interpolation.NumericListKnot)1 Matrix3d (maspack.matrix.Matrix3d)1 VectorNd (maspack.matrix.VectorNd)1 Wrench (maspack.spatialmotion.Wrench)1