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