Search in sources :

Example 1 with ContactMaster

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));
    }
}
Also used : ContactMaster(artisynth.core.mechmodels.ContactMaster) PointAttachment(artisynth.core.mechmodels.PointAttachment) PointParticleAttachment(artisynth.core.mechmodels.PointParticleAttachment) ContactPoint(artisynth.core.mechmodels.ContactPoint) Point(artisynth.core.mechmodels.Point)

Example 2 with ContactMaster

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));
        }
    }
}
Also used : DynamicComponent(artisynth.core.mechmodels.DynamicComponent) CollidableDynamicComponent(artisynth.core.mechmodels.CollidableDynamicComponent) CollidableDynamicComponent(artisynth.core.mechmodels.CollidableDynamicComponent) ContactMaster(artisynth.core.mechmodels.ContactMaster) ContactPoint(artisynth.core.mechmodels.ContactPoint) Point(artisynth.core.mechmodels.Point)

Example 3 with ContactMaster

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));
    }
}
Also used : FemNode(artisynth.core.femmodels.FemNode) ContactMaster(artisynth.core.mechmodels.ContactMaster) PointFem3dAttachment(artisynth.core.femmodels.PointFem3dAttachment) PointAttachment(artisynth.core.mechmodels.PointAttachment) PointParticleAttachment(artisynth.core.mechmodels.PointParticleAttachment) ContactPoint(artisynth.core.mechmodels.ContactPoint) Point(artisynth.core.mechmodels.Point)

Aggregations

ContactMaster (artisynth.core.mechmodels.ContactMaster)3 ContactPoint (artisynth.core.mechmodels.ContactPoint)3 Point (artisynth.core.mechmodels.Point)3 PointAttachment (artisynth.core.mechmodels.PointAttachment)2 PointParticleAttachment (artisynth.core.mechmodels.PointParticleAttachment)2 FemNode (artisynth.core.femmodels.FemNode)1 PointFem3dAttachment (artisynth.core.femmodels.PointFem3dAttachment)1 CollidableDynamicComponent (artisynth.core.mechmodels.CollidableDynamicComponent)1 DynamicComponent (artisynth.core.mechmodels.DynamicComponent)1