Search in sources :

Example 61 with VectorNd

use of maspack.matrix.VectorNd in project artisynth_core by artisynth.

the class RigidTransformInputProbe method setRigid.

/**
 * Set the rigid body associated with this probe.
 *
 * This must only be called once in the lifetime of the probe. Reseting the
 * rigid body is not supported at the moment.  Create a new
 * RigidTransformInputProbe instead.
 *
 * @param rigid rigid body for this probe
 */
public void setRigid(RigidBody rigid) {
    if (rigid != null) {
        throw new UnsupportedOperationException("A rigid body has already been set! Aborting");
    }
    myRigid = rigid;
    /*
       * setup default interpolator
       */
    myTransAndQuaternParams = new NumericList(myVectorSize);
    myInterpolation = new Interpolation(Interpolation.Order.Linear, myExtendEnd);
    myTransAndQuaternParams.setInterpolation(myInterpolation);
    myTmpVec = new VectorNd(myVectorSize);
    setStartTime(0.);
    setStopTime(0.);
    setUpdateInterval(-1);
    setActive(true);
}
Also used : Interpolation(maspack.interpolation.Interpolation) NumericList(maspack.interpolation.NumericList) VectorNd(maspack.matrix.VectorNd)

Example 62 with VectorNd

use of maspack.matrix.VectorNd in project artisynth_core by artisynth.

the class NumericProbeBase method scaleNumericList.

/**
 * Scales the values of a numberic probe. Method added by Chad. author: Chad
 * Scales the values of a numberic probe.
 *
 * @param scale
 * the parameter by which to scale the values.
 */
public void scaleNumericList(double scale) {
    Iterator numericListIterator = myNumericList.iterator();
    NumericListKnot datavalue = null;
    VectorNd yVector = null;
    double[] vectorArray = null;
    while (numericListIterator.hasNext()) {
        datavalue = (NumericListKnot) numericListIterator.next();
        yVector = datavalue.v;
        vectorArray = yVector.getBuffer();
        for (int i = 0; i < yVector.size(); i++) {
            // System.out.print(vectorArray[i]+ ",");
            vectorArray[i] *= scale;
        // System.out.println(vectorArray[i]);
        }
    }
    updateDisplays();
}
Also used : NumericListKnot(maspack.interpolation.NumericListKnot) VectorNd(maspack.matrix.VectorNd)

Example 63 with VectorNd

use of maspack.matrix.VectorNd in project artisynth_core by artisynth.

the class MFreeMuscleModel method getActivations.

public VectorNd getActivations() {
    VectorNd act = new VectorNd(numActivations());
    getActivations(act, 0);
    return act;
}
Also used : VectorNd(maspack.matrix.VectorNd)

Example 64 with VectorNd

use of maspack.matrix.VectorNd in project artisynth_core by artisynth.

the class MFreeNode3d method setNodeCoordinates.

public void setNodeCoordinates(VectorNd coords) {
    myCoords = new VectorNd(coords);
    updateSlavePos();
}
Also used : VectorNd(maspack.matrix.VectorNd)

Example 65 with VectorNd

use of maspack.matrix.VectorNd in project artisynth_core by artisynth.

the class MLSShapeFunction method computePCorrelation.

protected void computePCorrelation(MatrixNd out, double x, double y, double z) {
    VectorNd _p = new VectorNd(nBasis);
    computeP(_p, x, y, z);
    computeCorrelation(out, _p);
}
Also used : VectorNd(maspack.matrix.VectorNd)

Aggregations

VectorNd (maspack.matrix.VectorNd)136 Point (artisynth.core.mechmodels.Point)29 Point3d (maspack.matrix.Point3d)16 Vector3d (maspack.matrix.Vector3d)15 PointParticleAttachment (artisynth.core.mechmodels.PointParticleAttachment)11 ArrayList (java.util.ArrayList)11 ContactPoint (artisynth.core.mechmodels.ContactPoint)9 MatrixNd (maspack.matrix.MatrixNd)9 Vertex3d (maspack.geometry.Vertex3d)8 SparseMatrixNd (maspack.matrix.SparseMatrixNd)8 IntegrationPoint3d (artisynth.core.femmodels.IntegrationPoint3d)7 PointAttachment (artisynth.core.mechmodels.PointAttachment)7 PointFem3dAttachment (artisynth.core.femmodels.PointFem3dAttachment)6 FemNode (artisynth.core.femmodels.FemNode)5 PolygonalMesh (maspack.geometry.PolygonalMesh)5 ReaderTokenizer (maspack.util.ReaderTokenizer)5 FemNode3d (artisynth.core.femmodels.FemNode3d)4 IntegrationData3d (artisynth.core.femmodels.IntegrationData3d)4 StringReader (java.io.StringReader)4 HashMap (java.util.HashMap)4