use of artisynth.core.mechmodels.CollisionBehavior 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);
}
}
use of artisynth.core.mechmodels.CollisionBehavior 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);
}
}
use of artisynth.core.mechmodels.CollisionBehavior in project artisynth_core by artisynth.
the class FemMuscleArm method getCollisions.
public boolean getCollisions() {
MechModel mech = (MechModel) models().get(0);
PointToPointMuscle muscle = (PointToPointMuscle) mech.findComponent("models/0");
RigidBody upperArm = (RigidBody) mech.findComponent("rigidBodies/upper");
if (muscle == null || upperArm == null) {
return false;
}
CollisionBehavior cb = mech.getCollisionBehavior(muscle, upperArm);
return cb != null && cb.isEnabled();
}
Aggregations