use of maspack.matrix.Matrix3x3DiagBlock in project artisynth_core by artisynth.
the class PointFem3dAttachment method addTargetJacobian.
public int addTargetJacobian(SparseBlockMatrix J, int bi) {
for (int i = 0; i < myNodes.length; i++) {
double c = myCoords.get(i);
Matrix3x3DiagBlock blk = new Matrix3x3DiagBlock();
blk.set(c, c, c);
if (myNodes[i].getSolveIndex() != -1)
J.addBlock(bi, myNodes[i].getSolveIndex(), blk);
}
return bi++;
}
use of maspack.matrix.Matrix3x3DiagBlock in project artisynth_core by artisynth.
the class Point method addTargetJacobian.
/**
* {@inheritDoc}
*/
public int addTargetJacobian(SparseBlockMatrix J, int bi) {
if (!isControllable()) {
throw new IllegalStateException("Target point is not controllable");
}
Matrix3x3DiagBlock blk = new Matrix3x3DiagBlock();
blk.setIdentity();
J.addBlock(bi, getSolveIndex(), blk);
return bi++;
}
use of maspack.matrix.Matrix3x3DiagBlock in project artisynth_core by artisynth.
the class ForceTarget method addForceJacobian.
public int addForceJacobian(SparseBlockMatrix J, int bi, int solve_index) {
MatrixBlock blk = null;
if (myConnector instanceof PlanarConnector) {
blk = new Matrix1x1Block();
blk.set(0, 0, 1d);
J.addBlock(bi, solve_index, blk);
} else if (myConnector instanceof SphericalJointBase) {
blk = new Matrix3x3DiagBlock(1d, 1d, 1d);
J.addBlock(bi, solve_index, blk);
} else {
System.err.println("ForceTarget.addForceJacobian: unsupported connector type: " + myConnector.getClass());
}
return bi++;
}
Aggregations