Search in sources :

Example 1 with CollidablePair

use of artisynth.core.mechmodels.CollidablePair in project artisynth_core by artisynth.

the class SetDefaultCollisionsCommand method execute.

public void execute() {
    for (CollidablePair pair : myNewBehaviors.keySet()) {
        Group g0 = (Group) pair.get(0);
        Group g1 = (Group) pair.get(1);
        CollisionBehavior oldBehav = myMechMod.getDefaultCollisionBehavior(g0, g1);
        myOldBehaviors.put(new CollidablePair(pair), new CollisionBehavior(oldBehav));
        CollisionBehavior newBehav = myNewBehaviors.get(pair);
        myMechMod.setDefaultCollisionBehavior(g0, g1, newBehav);
    }
}
Also used : Group(artisynth.core.mechmodels.Collidable.Group) CollidablePair(artisynth.core.mechmodels.CollidablePair) CollisionBehavior(artisynth.core.mechmodels.CollisionBehavior)

Example 2 with CollidablePair

use of artisynth.core.mechmodels.CollidablePair in project artisynth_core by artisynth.

the class SetDefaultCollisionsCommand method undo.

public void undo() {
    for (CollidablePair pair : myOldBehaviors.keySet()) {
        CollisionBehavior oldBehav = myOldBehaviors.get(pair);
        myMechMod.setDefaultCollisionBehavior((Group) pair.get(0), (Group) pair.get(1), oldBehav);
    }
}
Also used : CollidablePair(artisynth.core.mechmodels.CollidablePair) CollisionBehavior(artisynth.core.mechmodels.CollisionBehavior)

Aggregations

CollidablePair (artisynth.core.mechmodels.CollidablePair)2 CollisionBehavior (artisynth.core.mechmodels.CollisionBehavior)2 Group (artisynth.core.mechmodels.Collidable.Group)1