use of artisynth.core.mechmodels.ContactMaster in project artisynth_core by artisynth.
the class FemMeshComp method getVertexMasters.
public void getVertexMasters(List<ContactMaster> mlist, Vertex3d vtx) {
PointAttachment pa = getAttachment(vtx.getIndex());
if (pa instanceof PointFem3dAttachment) {
PointFem3dAttachment pfa = (PointFem3dAttachment) pa;
FemNode[] masters = pfa.getNodes();
for (int j = 0; j < masters.length; j++) {
mlist.add(new ContactMaster(masters[j], pfa.getCoordinate(j)));
}
} else {
PointParticleAttachment ppa = (PointParticleAttachment) pa;
mlist.add(new ContactMaster((FemNode3d) ppa.getParticle(), 1));
}
}
use of artisynth.core.mechmodels.ContactMaster in project artisynth_core by artisynth.
the class SkinMeshBody method getVertexMasters.
public void getVertexMasters(List<ContactMaster> mlist, Vertex3d vtx) {
PointSkinAttachment pa = getAttachment(vtx.getIndex());
for (int j = 0; j < pa.numConnections(); j++) {
DynamicComponent m = pa.getMaster(j);
// with a master component (i.e., numMasters <= numConnections
if (m instanceof CollidableDynamicComponent) {
double wm = pa.getWeight(j);
// System.out.println (
// "adding for "+ComponentUtils.getPathName(m)+" w=" + w*wm);
mlist.add(new ContactMaster((CollidableDynamicComponent) m, wm));
}
}
}
use of artisynth.core.mechmodels.ContactMaster in project artisynth_core by artisynth.
the class MFreeMeshComp method getVertexMasters.
public void getVertexMasters(List<ContactMaster> mlist, Vertex3d vtx) {
PointAttachment pa = getAttachment(vtx.getIndex());
if (pa instanceof PointFem3dAttachment) {
PointFem3dAttachment pfa = (PointFem3dAttachment) pa;
FemNode[] masters = pfa.getNodes();
for (int j = 0; j < masters.length; j++) {
mlist.add(new ContactMaster(masters[j], pfa.getCoordinate(j)));
}
} else {
PointParticleAttachment ppa = (PointParticleAttachment) pa;
mlist.add(new ContactMaster((MFreeNode3d) ppa.getParticle(), 1));
}
}
Aggregations